Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 22514

Cypress - (uncaught exception)NotSupportedError: The user agent does not support public key credentials

$
0
0

Normally we are able to login with self signed certificate from localhost pointing to different server.

But during cypress end to end testing, this is failing with the

(uncaught exception)NotSupportedError: The user agent does not support public key credentials

Is there a cypress setting to configure and suppress this error?

This is observed mainly in chrome, chromium and electron environment but passing for firefox browser.

cypress      : 13.3.0,mac os sonoma: v14.4.1chrome       : 124.x

enter image description here

Working reference in firefox

enter image description here

Is the implementation below to be changed:

export default (email, password) => {    if (!window.PasswordCredential) {        return Promise.resolve(false);    }    const cred = new PasswordCredential({        id: email,        password,        name: email,    });    return navigator.credentials.store(cred).then(() => {        return true;    });};

As per the doc:

https://developer.mozilla.org/en-US/docs/Web/API/PasswordCredential/PasswordCredential

I am not 100% sure if its because of PasswordCredential or browser not supporting. How can we stub this in cypress environment for chrome and other unsupported browsers?

Firefox browser is working absolutely fine, where as chrome is not. I upgraded node version from 16 to 18 and the superagent library to the latest to see if that helps, but no luck so far.


Viewing all articles
Browse latest Browse all 22514

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>