Saves a screenshot of the current viewport under an explicit filename, as an action step within the scenario flow. Both a PNG and a matching .html snapshot of the page source are written to the screenshot directory (default ./screenshots, configurable with WEBSHIP_SCREENSHOT_DIR or the screenshot.dir world parameter). A name like checkout-step-2 produces checkout-step-2.png and checkout-step-2.html; the correct extension is appended automatically when the name does not include one.
The filename accepts tokens that are resolved at capture time: {datetime} (with an optional format such as {datetime:YYYY-MM-DD}), {feature_file}, {step_line}, {step_name}, and URL tokens like {url_path}, {url_domain}, and {url_origin}. Explicit names without a {datetime} token are overwritten on each run, which makes them convenient stable artifacts for visual review between runs.
Accepted phrasings
When I save screenshot with name "checkout-step-2.png"
When we save screenshot with name "checkout-step-2.png"
When save screenshot with name "checkout-step-2.png"
Then I save screenshot with name "checkout-step-2.png"
And I save screenshot with name "checkout-step-2.png"
Examples
When I save screenshot with name "about-us.png"
When I save screenshot with name "news-latest.png"
When I save screenshot with name "contact-form-before-submit.png"
When I save screenshot with name "{url_path}-{datetime}.png"
In a real scenario
Scenario: Capture each stage of the contact form flow with readable names
Given I am on "/contact"
When I save screenshot with name "contact-empty.png"
And I fill in "email" with "user@example.org"
And I fill in "message" with "Please send the brochure"
And I save screenshot with name "contact-filled.png"
And I press "Send"
Then I should see "Thank you for contacting us"