Auth0 Home Blog Docs

E2e Testing React SPA with Cypress

I have added user login to a React application using the following guide:

This all works fine, but when I want to test the application in Cypress I am having some problems. I was initially following this guide: and this seems to implement the best practices from Cypress by using the password grant to log the user in before running the tests.

However, this guide isn’t using the auth0-spa-js library and implements its own container for storing the access token (

auth0-spa-js has its own logic for caching the access token.

Is it possible to use the auth0-spa-js library and use the password grant type for Cypress tests?