cypress: Cypress Runner unexpectedly closes itself while navigating to a specific URL with a different origin

Current behavior

If you navigate to the following url using cy.visit https://rom.my.universe.cdp.gigya.com, the test will close itself and Cypress will go back to the main specs screen. A test shouldn’t behave like that, any error message would be in line.

Other people have tried to navigate to this URL on their end and got the same result.

I’m baffled as to why this is happening, but I noticed that after closing itself, the URL of the Runner itself changes to https://socialize.us1.gigya.com/__/#/specs

My suspicion: Somehow the redirection manages to change the topmost URL outside of Cypress’ test iframe and thus exit the test. What can be done about this?

Desired behavior

Cypress should complete the navigation successfully, or at the very least, provide an error message.

Test code to reproduce

it('Should navigate to a different url', () => {
     cy.visit(`https://rom.my.universe.cdp.gigya.com`);
     cy.wait(5000); // Waiting here so the test won't finish immediately and wait for some requests to be fetched.
});

Cypress Version

10.9.0

Node version

v14.18.0

Operating System

Windows

Debug Logs

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 4
  • Comments: 15 (2 by maintainers)

Most upvoted comments

Is there someone I can tag from Cypress team to look into this:

Each time we run our scripts and there is a “iFrame” naviagting away from the iFrame to a normal page causes cypress just to display a white screen, nothing then happens, no actual cypress crash. Its very hard to debug this.

UPDATE: I found the issue that seems causing cypress to just go back to the select specs screen from my end, it seems that cypress is trying to open a New Window whenever it reaches the confirmation page. I notice this when i run the test using Firefox, the test will continue working until it opens the confirmation screen in a New Window even though it results in failed test since cypress was unable to validate the page that showing up in different window. The issue seems only happens in Chrome and Electron.

Note: this opening confirmation page in a new window behaviour never happened during the manual test, so it only happens in cypress

Anw, is there a way to force cypress to keep opening url even when it is form different origin in the same window?

Hello, i’m currently facing the same issue. In my case is where my scripts interact with an iFramed payment form. It seems the payment validation process was smooth after clicking on submit payment button but it suddenly just go back to the main specs screen before it reaches the correct confirmation page every single time.