Skip to content
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 scroll is turned off sometimes #16098

Closed
bukharov opened this issue Apr 20, 2021 · 36 comments · Fixed by #23053
Closed

Auto scroll is turned off sometimes #16098

bukharov opened this issue Apr 20, 2021 · 36 comments · Fixed by #23053
Assignees
Labels
pkg/reporter This is due to an issue in the packages/reporter directory type: unexpected behavior User expected result, but got another

Comments

@bukharov
Copy link

Current behavior

As you can see in the video below, auto scroll turns off at 27s mark and then stays off for the rest of the spec:

Cypress.mp4

It's not consistent, it happened locally more often than in CI, but the recording above is from CI.

Desired behavior

I'd like it to stay on, as there's no way to see the commands without it.

Versions

Cypress 7.1.0

@jennifer-shehane
Copy link
Member

That's pretty weird. I don't see where this code would have been updated at all recently, so I don't think this would be a regression. Also it seems like in the code that this should only toggle if you click on it?

Providing a way to reproduce this reliably would be helpful, without that this will be pretty difficult to track down.

@jennifer-shehane jennifer-shehane added pkg/reporter This is due to an issue in the packages/reporter directory stage: needs information Not enough info to reproduce the issue type: unexpected behavior User expected result, but got another labels Apr 21, 2021
@bukharov
Copy link
Author

It's in CI so no one clicked on it :trollface:

@todd-m-kemp
Copy link

todd-m-kemp commented Apr 30, 2021

I've noticed this as well during recordings from our test runs in CI. It's making it difficult (if not impossible) to really tell what's going on the video because the command log doesn't scroll and so we can't see what command is being executed at the time of failure.

EDIT: I guess I should also say that we are using Cypress 7.2.0.

@jpourdanis
Copy link

I have seen the same behavior on our CI also and we use cypress 8.7.0 on Gitlab. It's not happening to all tests runs but this is an example and I cannot reproduce it locally :

cypress-scrolling-on-ci.mov

This is the reason that we add this plugin to see what's going on when a test fails: https://github.com/bahmutov/cypress-failed-log

Can we ensure somehow this scrollbar tries always to go to the bottom? Is there any test for that?

@jpourdanis
Copy link

After upgrading to cypress 9.4.1 we still see this behavior on Gitlab Pipelines

@BlueWinds
Copy link
Contributor

We do indeed have extensive tests around the scrolling behavior, and as noted, this isn't something we've seen in cypress' own tests. Which isn't to say that your issue isn't real, just that without a publicly visible case demonstrating it, we're pretty limited in our ability to figure out what's going on.

If you can reproduce the behavior in a public repo, I'm definitely willing to spend some time looking into it.

@Elli143
Copy link

Elli143 commented Mar 30, 2022

I'm seeing this happen regularly in our CI tests, which makes the screenshots and videos useless. We're on Cypress 9.5 in Gitlab, though I see the behavior in Jenkins as well. We use 'npx cypress run' with Electron.

@Elli143
Copy link

Elli143 commented Mar 30, 2022

I'm watching the behavior of the scroll across our different tests, and one thing that I notice is that it seems to freeze when there are several requests being made at once, especially if they are resolving at different times, and particularly if there are enough requests that either the lagging request (above) or the new one (below) scrolls out of view for a moment.

I'm looking at the video that jpourdanis posted and the same behavior seems to occur in his video - the scroll stops immediately after several requests at once suddenly push the remaining tests out of view.

I can confirm it is not related to test order or number of tests in a file (so whether there are tests shown below the logs does not matter, I've seen it happen on the first and last tests and when there is only one test in the spec file).

@dlabrecque-uzinakod
Copy link

Also seeing it with same context.
I posted this in issue #8646 a few weeks ago.

Hi,
This behavior also happens in our environment. We are using cypress 9.3.1 with cypress-cucumber-preprocessor.
It happens with cypress open and cypress run.
It also happens on our CI/CD pipeline which is a problem because we can't rely on the screenshot or the video to troubleshoot because it doesn't show the error which is at the end of the scroll.
I tried to make a video of it. I have it available if you want. It is weird because it appears to happen at the same place in a test, but it does not happen on every run.
In the video I recorded, it seems to happen right after a page load when there are a lot of backend requests.
I ran it with a spec file where only one test runs and it happens approx 2 times out of 3.
I don't understand the used case where one would like the cypress command log to not auto-scroll. Maybe this toggle should be removed along with the feature.

@bukharov
Copy link
Author

I agree with @dlabrecque-uzinakod. How useful is this feature? Perhaps the fix to this issue is to remove the feature completely?

@JessicaSachs
Copy link
Contributor

JessicaSachs commented Apr 4, 2022

The reason we have this feature is for users reviewing video artifacts in CI to debug what happened in a failing test. It makes a lot of sense for those workflows. I have a 100% reproduction with this repository https://github.com/JessicaSachs/rune-scrape

Video here: https://www.loom.com/share/61ff11e54ae6457c93b8d2191aa31b65 best listened to at 1.5x 🐢

@bukharov
Copy link
Author

bukharov commented Apr 5, 2022

@JessicaSachs I understand, but what would be the use case for disabling auto scroll? I suppose my comment's a bit ambiguous. The suggestion was to remove the toggle and keep in always on.

@dlabrecque-uzinakod
Copy link

dlabrecque-uzinakod commented Apr 28, 2022

Thanks @JessicaSachs for the video.
If the scroll bar for the commands log even slightly moves away from the bottom while auto-scrolling is enabled, it gets disabled. Knowing this, I believe the defect happens (in our case) when several backend calls are being made, hence filling the commands log rather quickly and then responses are received and the corresponding command lines are modified. In this context, the height of some lines in the commands log may be modified moving the scroll bar just slightly away from the bottom and it disables the auto-scroll. Is there a way to modify the onScrollBarMove event if such an event exists and make it accept a certain margin before triggering off the auto scroll?
Or as discussed, just remove the feature.

@marktnoonan
Copy link
Contributor

marktnoonan commented Apr 28, 2022

A starting point for the implementation of this might be, when in headless mode, to not do this scroll handling, since any scrollbar movement was definitely not caused by the user wanting to pause autoscrolling to look at something - they can't see the browser.

@astone123
Copy link
Contributor

Marking #22772 as a duplicate of this issue. Seems related to auto-scroll stopping mid-spec

@steve78GA
Copy link

After upgrading to v10 we are now encountering this issue as well. It happens both in the runner and in CI which makes it particularly irritating.

Screen.Recording.2022-07-22.at.08.23.48.mov

.

@cypress-bot cypress-bot bot added stage: investigating Someone from Cypress is looking into this and removed stage: backlog labels Aug 1, 2022
@marktnoonan marktnoonan self-assigned this Aug 1, 2022
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: investigating Someone from Cypress is looking into this labels Aug 2, 2022
@marktnoonan
Copy link
Contributor

marktnoonan commented Aug 2, 2022

Hi folks, I have a build that removes the "temporarily disable auto scrolling" feature for non-interactive mode. The reason I didn't fully remove that feature, is that in open mode, when tests are running, I think users pretty often will actually scroll the reporter manually while tests run, and it's fair to expect that to work. Removing that would probably cause some frustration, so it might be more suitable as a configuration or something eventually.

But there's a big caveat. I could not reproduce this issue at all, no matter what I tried. I let @JessicaSachs's tests run over and over and even though this happened for her in the video she shared, I never once saw the autoscroll fail or turn off on its own.

So I have no idea if the code I changed actually addresses this problem. It's a hunch.

Preview builds of the Cypress binary for linux and mac can be found in the comments here: #23053 (comment)

@steve78GA or @JessicaSachs, maybe one of you who can reproduce can try the altered binary and confirm if, using cypress run --headed, this problem still happens for you.

@cypress-bot cypress-bot bot added stage: investigating Someone from Cypress is looking into this and removed stage: awaiting response Potential fix was proposed; awaiting response labels Aug 5, 2022
@marktnoonan
Copy link
Contributor

marktnoonan commented Aug 5, 2022

Thanks @DannyBunny, and shoot it looks like I started my branch during the hot second that develop wasn't working on Windows, branch is updated and the Windows build should appear in the comments for this commit: a28d6f8 (#23053)

Will check back on Monday.

EDIT: the links don't seem to always include the commit comments, so here is the command for windows:

npm install https://cdn.cypress.io/beta/npm/10.4.0/win32-x64/marktnoonan/16098-a28d6f80e953126cd3144dc756a4df26633227e0/cypress.tgz

@cypress-bot cypress-bot bot added stage: awaiting response Potential fix was proposed; awaiting response stage: investigating Someone from Cypress is looking into this stage: internal and removed stage: investigating Someone from Cypress is looking into this stage: awaiting response Potential fix was proposed; awaiting response labels Aug 8, 2022
@cposada23
Copy link

Any news about this, It's happening to me even when I run the test in my local machine. The auto scroll stops working after some time. This is really annoying when it happens on CI because it leaves me with NO LOGS to see what cypress is doing. THis makes IMPOSIBLE to review the failures.... I have cypress version 10.4.0

@marktnoonan
Copy link
Contributor

@cposada23 since you can reproduce, can you verify one of these builds fixes the problem (using cypress run, no change expected in cypress open)

I've tried a bunch to reproduce it and had several others trying as well but we have not at any luck.

Linux: npm install https://cdn.cypress.io/beta/npm/10.4.0/linux-x64/marktnoonan/16098-a28d6f80e953126cd3144dc756a4df26633227e0/cypress.tgz

Windows: npm install https://cdn.cypress.io/beta/npm/10.4.0/win32-x64/marktnoonan/16098-a28d6f80e953126cd3144dc756a4df26633227e0/cypress.tgz

Mac: npm install https://cdn.cypress.io/beta/npm/10.4.0/darwin-x64/marktnoonan/16098-2eb2f82b23cc0fc086254e64a61cd91ea04488d7/cypress.tgz

Mac (ARM): npm install https://cdn.cypress.io/beta/npm/10.4.0/darwin-arm64/marktnoonan/16098-2eb2f82b23cc0fc086254e64a61cd91ea04488d7/cypress.tgz

@Tom5om are you able to confirm if the problem was truly fixed for you? @ngandymovpr would you be able to try one of these builds?

@Tom5om
Copy link

Tom5om commented Aug 16, 2022

Yes @marktnoonan I have implemented this build in my pipelines and have not seen the issue since

@leonard2901
Copy link

I had the same issue for one of my specs with Cypress 10.3.0. There it occurred in about 50% of the times. Since I installed your Build, I have done 15 more runs and have not seen this behavior again.

@kevingorry
Copy link

@marktnoonan can we get it merged, it's impacting us too. Thank you

@marktnoonan
Copy link
Contributor

Thanks @leonard2901 and @Tom5om, that seems like plenty validation that this was the issue.

@kevingorry this thread should automatically update when the PR is merged, it will need a test as well, which @viniciuspietscher has offered to pick up to get the PR over the finish line. This will likely make it into the next Cypress release at the end of the month.

@romankhomitskyi
Copy link

@marktnoonan hello, any updates on this? This is really critical issue

@cposada23
Copy link

I update to cypress version 10.7.0.... Still happening.... am I really the only one that's getting this annoying behavior ? It's really impossible to see what is happening on the video when I run the test on CI. Guess we just need to change the testing framework

@romankhomitskyi
Copy link

😄😄 yeah

@marktnoonan
Copy link
Contributor

Hi folks, this just missed the cut for 10.7.0 due to a conflict with some of the changes made to bring Studio back. PR is updated now, hoping to merge in the next few days.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 13, 2022

The code for this is done in cypress-io/cypress#23053, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 13, 2022

Released in 10.8.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v10.8.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Sep 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pkg/reporter This is due to an issue in the packages/reporter directory type: unexpected behavior User expected result, but got another
Projects
None yet
Development

Successfully merging a pull request may close this issue.