Resizes the browser viewport to the given width and height (in pixels) and then saves a screenshot of the visible viewport at that size. Two files are written to the screenshot directory (default ./screenshots): a PNG image and a matching .html snapshot of the page source. This is the quickest way to capture how a page renders at a specific device size, such as 375 x 667 for a small phone or 1920 x 1080 for a desktop monitor.
Note that the viewport stays resized after the step runs: any steps that follow in the same scenario execute at the new size. If later assertions depend on a desktop layout, resize back or place this step at the end of the scenario. Only the viewport area is captured; for the full scrollable page at a given size, use the fullscreen variant of this step.
Accepted phrasings
Then I save 1440 x 900 screenshot
Then we save 1440 x 900 screenshot
Then save 1440 x 900 screenshot
When I save 375 x 667 screenshot
And I save 768 x 1024 screenshot
Examples
Then I save 1440 x 900 screenshot
Then I save 375 x 667 screenshot
Then I save 768 x 1024 screenshot
Then I save 1920 x 1080 screenshot
In a real scenario
Scenario: The header renders correctly on a mobile screen
Given I am an anonymous user
When I go to the homepage
And wait
Then I see visible site header
And the "site header" should be sticky
And I save 375 x 812 screenshot