I understand that Cypress does not allow flipping from one domain to another domain because it will error with:
chrome-error://chromewebdata/
However, I need a workaround. I am providing a test set for multiple environments: STAGE, DEMO, PROD.
With DEMO and PROD, during the authentication phase (username/password), stay within the same domain:
- VISIT:
https://[demo|www].foo.com - AUTH:
https://account.foo.com/auth>> username >> password - CONSENT:
https://[demo|www].foo.com/action...
With STAGE, the authentication phase flips to another domain:
- VISIT:
https://[stage].foo.com - AUTH:
https://account.bar.com/auth>> username >> password - CONSENT:
https://[stage].foo.com/action...
Thereby, Cypress fails to redirect from VISIT to AUTH because of domain flip. This is blocking testing of STAGE.
What recommended workaround approaches?
- Puppeteer?
- Native Cypress using
cy.request()?
Referenced:
- Handling Cypress url redirect
- Error with authentication in e2e tests using cypress: chrome-error://chromewebdata
Thank you, much appreciate the assistance.