Scrolls the page to the right by a given number of pixels. The step takes one optional parameter: the pixel amount. When no number is supplied, the page scrolls right by the default of 350 pixels. Under the hood the step shifts the window's horizontal scroll position relative to where it currently is, so calling it several times keeps moving further right.
This step only affects the page-level horizontal scrollbar. If the wide content lives inside a scrollable container (for example a data table wrapped in an overflow container), use the element-scoped steps such as scrolling to the end of a selector instead. Scrolling past the maximum width is safe: the browser simply stops at the edge.
Accepted phrasings
When I scroll right
When I scroll right 1000
When we scroll right
When we scroll right 300
When scrolling right
When scrolling right 750
The step also works with And as a continuation keyword inside a When block.
Examples
And I scroll right
When I scroll right 1000
And we scroll right 300
When scrolling right 750
In a real scenario
Scenario: The wide pricing comparison table reveals extra plans when scrolled
Given I am an anonymous user
When I go to "/pricing/compare"
And wait
Then I should see "Starter"
When I scroll right 1000
And I wait 2s
Then I should see "Enterprise"
And the element ".plan-enterprise" should be displayed