The scroll steps group provides actions for controlling page and element scroll position. Both vertical scrolling (up, down, to top, to bottom) and horizontal scrolling (left, right, to start, to end) are covered. All steps work against the current browser page context and can also be scoped to a specific element by CSS selector.
Every step accepts three pronoun forms: I scroll, we scroll, or just scrolling. Where a pixel amount is optional, the default delta is 350 px. Pixel-delta steps use window.scrollBy for relative movement, while absolute-position steps use window.scrollTo. Element-scoped steps locate the element with Playwright's locator API and set scrollTop or scrollLeft directly, then dispatch a scroll event so listeners are notified.
Steps in this group
- Scroll down - scroll the page downward by a pixel amount
- Scroll up - scroll the page upward by a pixel amount
- Scroll to top - jump to the very top of the page
- Scroll to bottom - jump to the very bottom of the page
- Scroll to top of selector - jump to the top of a scoped element
- Scroll to bottom of selector - jump to the bottom of a scoped element
- Scroll left - scroll the page horizontally to the left
- Scroll to start - jump to the horizontal origin of the page
- Scroll to end - jump to the horizontal maximum of the page
- Scroll to start of selector - jump to the horizontal start of a scoped element
- Scroll to end of selector - jump to the horizontal end of a scoped element