Wait for request animation frame after scrolling into view in element click/clear/send keys
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 718
- Forks
- 228
- PR merge metrics
- No merged PRs in 30d
Description
All three commands of the interaction module involve performing a scroll into view in case the element we want to interact with is not in view.
However, even with behavior instant, the document handles scrolls in a queue, so there's no guarantee the scroll is synchronously executed, and that a corresponding scroll event is emitted in the page. If the test page has some logic attached as a listener to the "scroll" event which is necessary to make the element in view (eg changing the visibility of the element or its parent), then we would need to wait a bit after the scroll in order to perform the next is in view check.
This originally came from https://bugzilla.mozilla.org/show_bug.cgi?id=2014538, where the tested application uses a panel list widget which does react to the scroll event. Without waiting after the scroll, this application cannot use element click / clear / send keys to test their widget.
The current suggestion was to at least wait for the next animation frame. But we can have other strategies.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the WebDriver element interaction module and its scroll-into-view and in-view steps, then review the linked Mozilla bug for the triggering behavior. Determine and document an agreed waiting strategy, such as the next animation frame, and update the interaction algorithms so click, clear, and send keys consistently handle scroll-event-driven visibility changes.
Written by the indexing model from the issue text.
Assessment
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100