Then I take screenshot

This step captures a full-page screenshot of the current page at the current viewport size and holds it in an in-memory buffer for the rest of the scenario. If DIFFY_SCREENSHOTS_DIR (or worldParameters.diffy.screenshotsDir) is configured, the PNG is also written to disk as a timestamped file. The step records the current page URL path and the active breakpoint width (viewport width minus 8 pixels of padding) alongside each image so that Diffy can associate screenshots with the correct page and breakpoint when they are uploaded.

Screenshots stay buffered until you call send screenshots to diffy with name, which uploads the entire batch as a single named snapshot. You can call this step multiple times across different pages or viewport sizes within one scenario before sending. The buffer is cleared after a successful upload.

Accepted phrasings

Then I take screenshot
Then we take screenshot
Then take screenshot
And I take screenshot
And we take screenshot
And take screenshot
But I take screenshot

Examples

Then I take screenshot
Then we take screenshot
And I take screenshot
And take screenshot

In a real scenario

Scenario: Build a baseline snapshot of the home and about pages
  Given I am on "https://example.org"
  When I resize window to "1200"
  Then I take screenshot
  Given I am on "https://example.org/about"
  Then I take screenshot
  Then send screenshots to diffy with name "baseline"
  Then create diffy comparison

Related steps

Back to Diffy Step Definitions