When I resize window to "number"

This step resizes the browser viewport to a specified pixel width before capturing a Diffy screenshot. The width you provide is the target breakpoint value; the step adds an internal padding of 8 pixels to the viewport so that Diffy can record the correct breakpoint width from the screenshot metadata. The viewport height is set to the value of DIFFY_WINDOW_HEIGHT (default: 2000), which is tall enough to capture most page content in a single full-page shot.

Use this step before I take screenshot to explicitly control which breakpoint a capture belongs to. Breakpoint values are arbitrary integers - common choices are 320, 375, 640, 768, 1024, 1200, 1440, and 1920. If you need to capture several breakpoints in one step, use I take screenshots for all breakpoints instead.

Accepted phrasings

When I resize window to "1200"
When we resize window to "1200"
When resize window to "1200"

Examples

When I resize window to "1200"
When we resize window to "640"
When I resize window to "320"
When we resize window to "1440"

In a real scenario

Scenario: Capture the homepage at multiple breakpoints for visual comparison
  Given I am on "https://example.org"
  When I resize window to "1200"
  Then I take screenshot
  When I resize window to "768"
  Then I take screenshot
  When I resize window to "375"
  Then I take screenshot
  Then send screenshots to diffy with name "homepage-baseline"

Related steps

Back to Diffy Step Definitions