Uploads every PNG and WebP image found under a local folder (searched recursively) to Diffy as a single named custom snapshot. This lets you feed Diffy screenshots produced outside the current scenario: an earlier CI job, another tool, or the DIFFY_SCREENSHOTS_DIR on-disk copies saved by the screenshot steps. The resulting snapshot id is stored in the scenario state for use by create diffy comparison.
For each image, the breakpoint is detected from the PNG width read out of the file header, and the URL slug shown in Diffy is derived from the file name (lowercased, non-alphanumeric runs replaced with hyphens). The step fails if the folder does not exist, contains no PNG/WebP files, or if a PNG width cannot be read. Requires DIFFY_API_KEY and DIFFY_PROJECT_ID.
Accepted phrasings
Then upload folder "PATH" to diffy as "SNAPSHOT NAME"
Then I upload folder "PATH" to diffy as "SNAPSHOT NAME"
Then we upload folder "PATH" to diffy as "SNAPSHOT NAME"
And upload folder "PATH" to diffy as "SNAPSHOT NAME"
Examples
Then upload folder "./screenshots/baseline" to diffy as "baseline"
Then upload folder "./screenshots/changed" to diffy as "changed"
Then I upload folder "./reports/screenshots" to diffy as "nightly"
Then we upload folder "./diffy/before" to diffy as "before-deploy"
In a real scenario
@diffy
Feature: Visual regression from pre-rendered screenshots
Scenario: Compare before and after folders produced by the CI pipeline
Then upload folder "./diffy/before" to diffy as "before-deploy"
And upload folder "./diffy/after" to diffy as "after-deploy"
Then create diffy comparison with name "deploy-check"
And wait for diffy comparison to complete