1

I would like to open a different domain url as a popup window for authentication and authorization. Cypress.io does not allow a second unique domain. I have found a related question answered here, about opening a new window with the same domain URL.

Access a new window - cypress.io

I would like to know if it is possible to do this.

Example - Let's say my domain is abc.com, Start functional test on abc.com then open xyz.com as a new window and confirm the user-entered parameter and close the xyz.com.

Pravanjan
  • 698
  • 7
  • 16
  • Could you clarify? Have you tried this yet? If it hasn't worked, what was the problem? – R. Barzell Apr 03 '18 at 14:36
  • I have added code here https://github.com/pravanjanDev/cypressDemo/blob/master/cypress/integration/open_windo_spec.js . This example does work for same domain but it does not work if i open popup with a different domain. Its says failed because your are attempting to visit second unique domain. – Pravanjan Apr 09 '18 at 15:08

1 Answers1

0

Add the following to your cypress.json file:

"chromeWebSecurity": false

This will allow you to visit and test other domains. I have successfully used this on cypress.io on Windows 10 when testing (at least under Chrome); however, I don't know if you can rely on this in the future, so keep this in mind!

R. Barzell
  • 666
  • 5
  • 24
  • R. Brazell . I have already added the "chromeWebSecurity": false. But it does not work . The demo project is here in github . https://github.com/pravanjanDev/cypressDemo/blob/master/cypress.json – Pravanjan May 11 '18 at 12:56