TL;DR: Great reference for cypress testing of components affected by the Auth-0 SPA SDK state: https://github.com/adamjmcgrath/cypress-spa-example
After weeks of not getting our cypress tests working, we finally found this repo by Adam Grath: https://github.com/adamjmcgrath/cypress-spa-example
It gives a very simple and clear example on how to implement the JS SPA SDK login and logout and it works straight out of the box with little configuration to fit your own tenant details. While we’re not related to the contributor we really enjoyed a simple solution compared to the insane amount of work-arounds presented out there and in the comment section of the official Auth-0 blog post (https://auth0.com/blog/end-to-end-testing-with-cypress-and-auth0/) which doesn’t address how to test secured pages / content.
The only back-draw is that one has to use
localstorage for the Auth-0 token. However, functionality should be just as when using