scrollIntoView options as parameters in the Scroll Interaction #2041
jotacoroe2y
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
@jotacoroe2y I faced a similar problem. You may refer this issue. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
Hi again,
in one of our projects, we usually need to scroll to an element but placing it into the middle of the viewport.
This is needed specially when working with viewports of portable devices, where there's usually both sticky header and footer.
So we usually faced situations where the click was intercepted by another element (these sticky elements in most of the cases), so our tests failed.
The current implementation of the Scroll interaction doesn't support the scrollIntoView options, so we implemented the following to have the chance and choose the most suitable scroll depending on the situation:
When calling the Interaction, it's pretty similar as calling the default Scroll interaction:
Pros ✅
This is currently a valid solution for us because our setup consists basically on this (Serenity-js, Cucumber, WebdriverIO).
Actually, all the methods used comes directly from WebdriverIO (waitForExist, scrollIntoView, waitForDisplayed). As it can be seen, the
scrollIntoView
method from WebdriverIO support thesescrollIntoViewOptions
.Cons ❌
But we need to type it as a WebdriverIO element:
Requesting 🙏
Beta Was this translation helpful? Give feedback.
All reactions