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

ScrollTop value leaks between test cases #31158

Open
zero-one-code opened this issue Feb 22, 2025 · 0 comments
Open

ScrollTop value leaks between test cases #31158

zero-one-code opened this issue Feb 22, 2025 · 0 comments

Comments

@zero-one-code
Copy link

zero-one-code commented Feb 22, 2025

Current behavior

Please note that the scrollTop value logged in the console from the video may not always be 0. In my first test, I executed scrollIntoView, and in the second test, I logged the scrollTop value. However, I observed that it isn't always 0, even though the second test merely mounted the component without any other actions.

2025-02-22.12.14.14.mov

Desired behavior

Both tests should have scrollTop set to 0 initially.

Test code to reproduce

https://github.com/zero-one-code/cypress-demo.git

  1. Open the project and run:
pnpm i
pnpm test
  1. In the scrollTop test, refresh the page multiple times.

  2. Observe that the second test's scrollTop sometimes incorrectly retains the value from the first test.

Cypress Version

v14.0.3

Node version

v18.20.4

Operating System

macOS 15.3.1

Debug Logs

No response

Other

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant