-
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 v13.6.0 no longer running commands (hangs) when we focus out of the window #28392
Comments
@Julien-Marcou That's certainly not intended. We haven't observed this behavior so I wonder if it is something specific with your tests. A reproducible example or a video of the hanging behavior would be helpful. We'll keep an eye on tracking for this. |
I am experiencing the same issue in v13.6.0 |
I am experiencing this issue as well in 13.6.0 When I open a test in test runner it runs correctly, but if I go to VS Code and make a change to the code and save, normally the test will run again in test runner, but it hangs. I have to stop and restart the test every time I make a change to the code. |
I have the same focus issue with Cypress 13.6.0 and Chrome 119 but it does not occur when selecting Edge, Firefox or Electron. In my case, saving changes in VS Code still causes the test runner to start over but because the focus was lost, the process stops there. |
We are experiencing the same issue after we updated to v13.6.0 NOTE: |
I see the same issue with 13.6.0 |
Does anyone have a clone-able repo that can be used to reliably reproduce this issue? I've tried a few projects, but can't recreate the described behavior, so I wonder if there's something project-specific that I'm missing. A way to reproduce it locally would provide a way forward to diagnose and fix the problem. |
I am seeing this constantly when running Cypress 13.6.0 with latest Chrome interactively on Windows. If the Cypress window loses focus it will hang. Even if I let it run, it eventually hangs when it gets to some download tests because the browser pops up a tooltip: 'Find your downloads here'. |
Steps to reproduce:
Note that in Firefox the text field does not loose focus unwantedly until the Firefox window gets the focus back. |
@iomedico-beyer I'm not able to reproduce this behavior from this example still :/ We are looking into the possibility that this issue may be the cause: #28443 If you open devTools after the hang, do you see a message like below?
|
Hi @jennifer-shehane and @chrisbreiding , I created a video and captured the test execution incl. 2 scenarios when Cypress gets stuck.
|
I found something interesting after creating a complete code sample:
I found that I couldn't reproduce my problem here either. So my (specific?) problem seems to be somehow related with the web app I am trying to test. It also is not Cypress 13.6 specific. Happens the same with Cypress 13.0 (don't know about even older). |
@jennifer-shehane In my case I only experienced this in a dual monitor setup I think where my editor and Cypress runner window are on different screens. Maybe you can reproduce it that way? |
Hmm... In my case it is definitely related to v13.6 as rolling back to any prior version of cypress does not reproduce the issue.
I am also on a dual monitor setup for what it's worth. |
What happens in my case is: Let's say Cypress is typing into a text field which represents a date. When it already typed e.g. So I guess my problem is something very different than what is discussed in this issue and may be related to a general constraint of the |
@iomedico-beyer For me, the issue you describe seems to originate from the behavior of the UI component framework you are using in your app. Not really related to the topic discussed here. |
Partly. I think my main problem is that Cypress cannot supress the focus loss which happens when I click on another window. There should not be a focus loss because the simulated user is typing in something, not clicking around. I just want to know if this is documented somewhere and then it's fine for me. @jennifer-shehane Do you know, perhaps? It's just that I lost almost a week on this until I understood why my tests are so flaky ...
I agree. |
@jennifer-shehane We've got same issue. Since 13.6, only in Chrome browser, when you get focus out of cypress runner window it hangs without any errors. Also when I try to download a file in a test. it also hangs after the (download) step without any information. (Chrome 119) |
Also getting this. New to cypress, but hard refreshes work, because focused on the chrome window. But save in vscode, and it just doesn't run in chrome unless I click over and focus, hard refresh again. Also, even with the provided sample tests, when running in the middle, if I click out of chrome just to try and see what happens, it instantly hangs the moment I focus away from chrome. |
What OS and OS version is everyone using? Just seeing if there's a trend with OS. |
MacOS 14.1.1 (23B81) |
Windows 10 |
MacOS Ventura 13.3.1 |
MacOS Sonoma 14.1.2 |
MacOS Ventura 13.4.1 (22F82) |
@xxluke The Cypress Chrome extension has a static ID of Edit: Found the docs for this: https://docs.cypress.io/guides/references/troubleshooting#Allow-the-Cypress-Chrome-extension |
We are currently blocked from testing with the latest version of Chrome (v120) in our build pipeline due to #25891. Although fixed in Cypress 13.6.3, we cannot take this version as this issue seriously impacts developer experience. Would appreciate a quick fix for this issue. Thanks! |
@blackgrouse The workaround is to manually turn on the Cypress extension as explained here: #28392 (comment) We know this isn't ideal and we've been actively looking into ways to improve this experience. Not surprisingly, Google Chrome doesn't really offer an automated way for us to override a user's behavior to not allow an extension to take control of the browser, so there isn't a quick way to force our extension behavior to work. There are some other things we're considering, like making the extension less necessary for users until they want to do an action that would require our extension. But we are working through ideas, so thanks for your patence. |
@jennifer-shehane Thank you, appreciate you and your team's effort on this. FWIW, I have not edited the extension's permissions but am still seeing this issue. |
@jennifer-shehane @chrisbreiding does it possible to identify if the browser is managed by organization? if so maybe adding a banner to cypress app to warning dev its something that will be already a huge help. I am willing to help on this |
@schirrel We did discuss something like a warning as an option, but I'll summarize what we're attempting to move forward with now. We intend to move the logic that's executed from the Cypress extension around tab focus into the This will mean that running tests without using We're prioritizing this work currently. |
Niceee, thanks a lot @jennifer-shehane ❤️ |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior
When I launch my E2E tests on Chrome, if I focus out of the Chrome window, the E2E commands are no longer running, it's hanging there doing nothing.
If I always stay focused on the Chrome window, the commands work as expected.
After focusing out, re-focusing in the window does not make the commands continue/restart.
Might be related to this PR this #28334
Desired behavior
I should be able to run E2E tests while not being focused on Chrome (as before) so I can do something else while the E2E tests are running.
Test code to reproduce
Sorry I don't have time to create a reproduction of the bug for the moment
Cypress Version
13.6.0
Node version
v18.18.2
Operating System
macOS 14.1.1
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: