-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
WebdriverIO Version
8.8.7
Node.js Version
18.16.0
Mode
WDIO Testrunner
Which capabilities are you using?
https://github.com/wvankuipers/wdio-scroll-issue/blob/main/wdio.conf.tsWhat happened?
When using WDIO 8.8.6 or later scrolling seems to be incorrect. When using scrollIntoView on an element the scroll position is incorrect rendering the element outside of the screen. This is introduced in this PR: #10044
Incorrect result (generated using WDIO 8.8.7) https://github.com/wvankuipers/wdio-scroll-issue/blob/main/incorrect_wdio_8.8.7.png
What is your expected behavior?
Before this version (latest tested with WDIO 8.8.4) the element should be aligned to the top of the viewport when using scrollIntoView.
Expected result (generated using WDIO 8.8.4) https://github.com/wvankuipers/wdio-scroll-issue/blob/main/correct_wdio_8.8.4.png
How to reproduce the bug.
A minimal project to reproduce this can be found here: https://github.com/wvankuipers/wdio-scroll-issue/tree/main
In short using scrollIntoView() on an element that is not already in the viewport is causing the behaviour depending on the viewport size.
Relevant log output
No helpfull log output:
[0-0] 2023-04-27T07:52:44.352Z INFO webdriver: DATA {
[0-0] actions: [
[0-0] { id: 'action1', type: 'wheel', parameters: {}, actions: [Array] }
[0-0] ]
[0-0] }Code of Conduct
- I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- I have searched the existing issues