Skip to content

Fix ScrollIntoView - DeltaX and DeltaY should be rounded#10091

Merged
christian-bromann merged 1 commit intowebdriverio:mainfrom
niklasschaeffer:fix-scrollintoview
Apr 5, 2023
Merged

Fix ScrollIntoView - DeltaX and DeltaY should be rounded#10091
christian-bromann merged 1 commit intowebdriverio:mainfrom
niklasschaeffer:fix-scrollintoview

Conversation

@niklasschaeffer
Copy link
Contributor

Proposed changes

ERROR webdriver: Request failed with status 400 due to invalid argument: invalid argument
[0-0] from invalid argument: 'delta x' must be an int
[0-0]   (Session info: chrome=111.0.5563.64)

deltaX and deltaY should be rounded values

Types of changes

  • Bugfix (non-breaking change which fixes an issue)

Checklist

  • I have read the CONTRIBUTING doc

  • I have added tests that prove my fix is effective or that my feature works

  • Ran Tests locally. They were fine.

Further comments

Reviewers: @webdriverio/project-committers

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 31, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: niklasschaeffer / name: Niklas Schäffer (cae460e)

@niklasschaeffer niklasschaeffer changed the title fix Fix ScrollIntoView - DeltaX and DeltaY should be rounded Mar 31, 2023
Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for coming up with a PR, could you add a unit test to packages/webdriverio/tests/commands/element/scrollIntoView.test.ts to ensure we don't run into any regression?


try {
return await browser.action('wheel')
.scroll({ duration: 200, deltaX, deltaY })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would've round it here

Suggested change
.scroll({ duration: 200, deltaX, deltaY })
.scroll({ duration: 200, deltaX: Math.round(deltaX), deltaY: Math.round(deltaY) })

@ghost ghost mentioned this pull request Apr 5, 2023
8 tasks
Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to include this into the next release so I will go ahead and merge this. Thanks @niklasschaeffer for the fix 👍 and congrats on your first contribution to WebdriverIO 🎉

@christian-bromann christian-bromann added the PR: Bug Fix 🐛 PRs that contain bug fixes label Apr 5, 2023
@christian-bromann christian-bromann merged commit a17ebdc into webdriverio:main Apr 5, 2023
christian-bromann added a commit that referenced this pull request Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Bug Fix 🐛 PRs that contain bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants