-
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
Cypress test hangs forever when system throws an unexpected alert during the test #27896
Comments
@tausif29 can you please specify the version(s) of Cypress, Node and what OS(es) you are running and seeing this behavior? Please also include debug logs which will assist in helping us debug this issue. Are you using Test replay as well? |
@nagash77 Issue is not version specific, It replicates on the all the versions, I have checked on version I have shared the sample HTML & Cypress Code to reproduce the issue. |
Have the same issue. I was trying to handle that with cypress events like |
Just a thought @tausif29 in your e2e.ts or index.js in support do you have:
|
@ojemuyiwa Yes its there in my test [Refer below screenshot] |
Ahh I see, so although I don't see any use case for an iframe showing alerts, your |
@ojemuyiwa The issue is: if an alert pops up from the main content (top) Cypress handles it correctly and accepts it by default, but when alerts are invoked from the iframe - Cypress hangs, |
We are facing the same issue. I confirm what @tausif29 said, we can reproduce it on all versions of node/cypress using the code sample they provided. |
Hey @jennifer-shehane 👋 any updates on this one? |
+1 for this thread, we are experiencing the same issue and it is disrupting major portions of our test suite. I wonder if this is related to the Chrome team deprecating the |
I'm able to recreate this given the example in Chrome, Firefox, and Electron in Cypress 13.7.1. This doesn't seem browser specific, or related to Chrome's deprecation of the upload event. We don't have a timeline to share for addressing this issue unfortunately. |
@jennifer-shehane Thanks for looking into this! I'll stay subscribed to this issue and hope for an update soon, as this is currently blocking large portions of our test suite. If possible, it would be really helpful to know what version introduced this bug. When I rolled my Cypress installation back to a version when we last had successful runs ( |
Hello, I have been working with Cypress since the beginning of the year and have now also encountered the problem that I cannot automate a window that comes from an IFrame. |
One solution we found is to use the cy.stub() utility function: https://docs.cypress.io/api/commands/stub.
|
Would I put this source code e.g. in beforeEach() or does it have to be directly in the test case? |
We call it inside a getIframe function that is used to get the body of an iframe to fetch any element inside that iframe.
|
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 has been closed due to inactivity. |
Current behavior
When Web application unexpectedly throws an error by alert box
Cypress test hangs/stuck forever and test never gets completed or failed until user manually closes the browser.
I have a below sample HTML page to reproduce the issue, Here I am explicitly throwing the alert box after 5 seconds of the page load.
Below is the Cypress test to reproduce the issue:
NOTE: Issue gets reproduced when the webpage contains the the
iFrame
, WithoutiFrame
Cypress automatically accepts the alert message.Desired behavior
Either Cypress test should automatically accept the alert message and test should be continued further or Cypress test should gets failed immediately.
Test code to reproduce
Sample HTML Page to Reproduce the Issue:
Sample Cypress Code:
Cypress Version
All
Node version
All
Operating System
All
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: