-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Clicks handled differently in headless vs. headed (React + Material UI use case) #1892
Comments
Does it work correctly with |
@brian-mann Yes, when I run headed with either Chrome or Electron, it works correctly. It seems the only time it runs incorrectly is headless Electron. Edit: I updated my CI to use your handy Docker image with Chrome, and when running it in CI, the clicks happen quickly, which is nice. Unfortunately I can no longer get video output, though, so there's a pretty high cost. |
@harvitronix can you see if this is an active window issue, by running |
@bkucera wow, interesting. If I run with chrome as you suggested and click away from the window, the clicks become very slow again. Then if I put the Chrome browser window back in focus, it starts going fast again. Good find! @brian-mann does this help at all? |
@harvitronix we're working on this issue, related here: #1909 |
This was fixed in 3.0.2. 💯 |
@bkucera I believe this issue is partially fixed. |
@piotralefeducation that is fixed in We've normalized all of the focus/blur events to work identically whether or not the browser is in focus |
@brian-mann Thank you and I'm waiting for the release 3.0.3 |
Hi @brian-mann I'm experiencing the same issue with cypress 3.3.2. I have the following link element : <a class="link browse-tasks-link" data-ui-test="browse-tasks-link">Browse tasks</a> Looks like it doesn't get clicked when running tests in headless mode. Chrome + Electron --headed work perfectly though. I ran Electron and created a Do you have any idea of what can go wrong ? Thank you |
Hey @medric, please create a new issue detailing exactly how to reproduce the issue and we can look at it. Thanks! |
Current behavior:
I have test cases that click on a styled select and then click on an item in the resulting menu. When I run my tests headed, using
npx cypress open
, with either Chrome or Electron, the click events happen almost instantly, as expected. However, when I run the same tests headlessly, withnpx cypress run
, each select item click takes "timeout" seconds to complete the click. This leads to a very slow test suite when timeout is a few seconds and I have hundreds of such clicks.Here is a video showing the headless run and unexpected behavior:
https://youtu.be/MCbIhEoN7Is
You will see the down click seems to be initiated immediately (the ripple is triggered), but it takes "timeout" ms to complete the click. (I set the
defaultCommandTimeout
config option to 10,000 to exaggerate the problem.)Desired behavior:
Here is a video showing the headed run and expected behavior:
https://youtu.be/vVzrdBvhnlg
Steps to reproduce:
I'm using React with Material UI. Here is the component under test in the videos:
And here is the spec:
Versions
Cypress 3.0.1
Electron 59
The text was updated successfully, but these errors were encountered: