-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redirection breaks out of cypress iframe when a top
or parent
redirection is made inside an iframe
#19234
Comments
Is this issue resolved ? |
I found this worked when we were testing a stripe payment flow:
Docs here:
|
@mathias-vandaele have you tried the |
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided. |
I tried using this and the stripe checkout flow loads correctly where it should, instead of window.top mode and force-quitting Cypress. Thanks! |
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided. |
This issue is still exist |
Current behavior
When clicking on a button (in an iframe) that is triggering a Javascript function that does :
window.top.location.href = <any url>
Cypress breaks out of its iframe and is redirecting to new page.
Desired behavior
the iframe cypress is using should always be considered as the top level window/document and we should not be able to break this behavior.
I provided a very simple repository where you can reproduce the issue
Test code to reproduce
https://github.com/mathias-vandaele/issuecypress
README.md for more information
Cypress Version
9.1.0
Other
I found a way (dirty) to workaround this issue 👍🏼
I check which Js is causing the problem and I execute before opening the page :
The text was updated successfully, but these errors were encountered: