You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is based off messages like the following:
Simulates a click event on the given DOM element. The element is scrolled into view if it is not already pointer-interactable. https://nightwatchjs.org/api/click.html
This scrolling usually (but not always) works as expected when working through a page top-down incrementally.
However, anytime an element requires scrolling significantly far up or down the page (out of view), or an element interaction causes an element to be moved far up or down on the page (out of view), the scroll function either does not scroll or doesn't scroll as far up as needed.
When an element is behind another in the UI while scrolling (e.g. having a nav bar at a higher index that is always present when scrolling, elements that happen to be positioned behind the nav do not benefit from this auto-scrolling either because they are technically still in view, (albeit at the edge), and technically are click interactable (although click will be intercepted).
We have tried manually implementing the following scroll functions to handle these issues: browser.execute('scrollBy(0, -window.innerHeight)'); browser.execute("scrollTo({ top: 0, behavior: 'smooth' })");
However this has variable success e.g. no scrolling happens, scrolls only a little bit, scrolls as expected, etc.
Before trying to re-invent the wheel by creating a custom scrolling solution I am trying to figure out how Nightwatch's scrolling into view code looks like to see if we can better manage test steps based on that deeper understanding or find a way to work with the API as is.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This is based off messages like the following:
Simulates a click event on the given DOM element. The element is scrolled into view if it is not already pointer-interactable.
https://nightwatchjs.org/api/click.html
This scrolling usually (but not always) works as expected when working through a page top-down incrementally.
However, anytime an element requires scrolling significantly far up or down the page (out of view), or an element interaction causes an element to be moved far up or down on the page (out of view), the scroll function either does not scroll or doesn't scroll as far up as needed.
When an element is behind another in the UI while scrolling (e.g. having a nav bar at a higher index that is always present when scrolling, elements that happen to be positioned behind the nav do not benefit from this auto-scrolling either because they are technically still in view, (albeit at the edge), and technically are click interactable (although click will be intercepted).
We have tried manually implementing the following scroll functions to handle these issues:
browser.execute('scrollBy(0, -window.innerHeight)');
browser.execute("scrollTo({ top: 0, behavior: 'smooth' })");
However this has variable success e.g. no scrolling happens, scrolls only a little bit, scrolls as expected, etc.
Before trying to re-invent the wheel by creating a custom scrolling solution I am trying to figure out how Nightwatch's scrolling into view code looks like to see if we can better manage test steps based on that deeper understanding or find a way to work with the API as is.
Beta Was this translation helpful? Give feedback.
All reactions