-
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
Auto scrolling is not working #25084
Comments
Yes, this is highly annoying for me also.. |
Yeah 10.11 same issue so annoying |
yes, It's very annoying. Even If it is a radio button like the older version, It does not affect us much. |
I've tried to reproduce this and have not been able to. I believe it is happening for you - I feel like I have noticed this behavior though...It'll be hard for us to track down the root issue and be confident in a fix if we aren't able reproduce this. @mohanbabu-zumen @romankhomitskyi @WORMSS is this happen in a specific browser or all browsers? also what browser versions are you using? @romankhomitskyi @WORMSS can you share your OS? |
OS version: Big Sur 11.6.5 Not sure about firefox because I dont run tests in it as much |
I mean to reproduce it you might need to have a test with commands logs more than 300 lines Then do some hover over commands, clicking, messing arround, than move mouse over the Application under test, than retry test, leave mouse on the command log, something like that |
It might have smth to do with this issue Issue |
@romankhomitskyi If you are clicking on the command logs while the test is executing that will disable the auto-scroll when tests are running. That behavior is expected. Is the issue you are seeing that the next run isn't restoring the autoscroll behavior? |
Hi @emilyrohrbough It's happened in all browsers frequently. My chrome version is 108.0.5359.125 |
@emilyrohrbough Yes. If we click command logs or anything else, then the disable behavior is expected. In my case, I haven't clicked anything. But, It's disabled. |
Hmmm interesting, I guess I have expirienced both cases |
@romankhomitskyi any browser or all? what is your OS? |
I gave a details a couple of comments above |
@romankhomitskyi whoops. Missed those details. thanks. |
I reached out to @marktnoonan to see if he had any insights to this issue. He said:
Sounds like we understand the basics of the issue at least which should be enough to route this. and Mark has a few ideas on how we might be able to improve this. |
Linking up to the previous issue that mentioned this: #24171 Also noticed this morning that there’s already a rubric, which looks arbitrary, that we could change based on trying to avoid "false positives" in scroll listeners: https://github.com/cypress-io/cypress/blob/develop/packages/reporter/src/lib/scroller.ts#L48-L49 That would be a good place to do another checks we think are needed, or we could just beef up the threshold for how many scroll events are needed to prove it's the user and not the browser reacting to elements populating the log. |
For what it's worth, I'm still experiencing this issue. I added some logpoints and confirmed that, without any user scrolling at all (hands completely away from all pointing devices), I do see a number of In my case, anecdotally it seems to occur at a particular test that has a slow-ish set of commands (enough to exceed the 1s threshold and automatically expand the command log), and after the test passes and the command log is automatically collapsed, the It would seem that the assumption of "3 or more scroll events within a 50ms timeframe === user is scrolling" is an unreliable one, and that some browsers (in my case, Chrome) may trigger scroll events without any intentional user activity. Perhaps instead of counting scroll events, another heuristic might be if the scroll position indicated in the scroll event is a certain distance away from the scroll position calculated by the scroller? (i.e. user must actually scroll a minimum threshold before autoscrolling is disabled?) |
I have a hypothesis on what may be causing this. (Apologies, I don't yet have anything that I'm able to share that will reproduce the issue, but I can reliably reproduce it in our internal test suite. I hope to follow up this comment with a link to an example at some point, if necessary). First, here's what I've learned so far about how auto-scrolling is supposed to work (for those that might be unfamiliar with the code): How auto-scrolling worksThe
In the same
With that brief explainer out of the way, here's what I believe is actually happening... How auto-scrolling breaks (in theory)Under perfect conditions, based on the above logic, we would expect things to execute in the following order:
That is:
However, as With some additional logging in both
That is:
Solution?Given the asynchronous nature of event handling, and the possibility of things to occur in a different order than you would normally expect; it would seem that using a simple One possible alternate approach would be to change
In this model, Or
With more accurate counting of I hope this helps. |
@scottohara Thanks for investigating! This is great. Mostly our problem was even beginning to reliably reproduce. I'll get the team to take a look at this overview. |
@scottohara Thank you so much for this in-depth investigation! We would welcome a PR that addresses the issue with either approach outlined, though a slight preference is granted to the negative-number approach. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior
Initially, auto-scrolling is enabled. When we run the scripts, it's automatically disabled in the run time.
Desired behavior
It's shouldn't be automatically disabled
Test code to reproduce
chrome_KYAzJ7OCeX.mp4
Cypress Version
11.2.0
Node version
16.17.0
Operating System
Windows 11
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: