Skip to content

Wait for request animation frame after scrolling into view in element click/clear/send keys #1944

@juliandescottes

Description

@juliandescottes

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions