Then compare diffy "ENV1" with "ENV2"

Kicks off a Diffy comparison directly between two environments of the project, in a single step. Diffy captures both sides itself, so you do not need to take or upload any screenshots first. The comparison id is stored in the scenario state, ready for wait for diffy comparison to complete.

Each side accepts prod, stage, dev (long forms production, staging, development are mapped automatically), plus baseline and custom. When either side is custom, the URL to capture is taken from DIFFY_ENV1_URL / DIFFY_ENV2_URL (or worldParameters.diffy.env1Url / env2Url). Any other environment name fails the step with an error listing the allowed values. Requires DIFFY_API_KEY and DIFFY_PROJECT_ID.

Accepted phrasings

Then compare diffy "ENV1" with "ENV2"
Then I compare diffy "ENV1" with "ENV2"
Then we compare diffy "ENV1" with "ENV2"
And compare diffy "ENV1" with "ENV2"

Examples

Then compare diffy "prod" with "stage"
Then compare diffy "production" with "development"
Then I compare diffy "prod" with "baseline"
Then we compare diffy "baseline" with "custom"

In a real scenario

@diffy
Feature: Visual regression after a deployment
  Scenario: Compare production against the freshly deployed staging site
    Then compare diffy "prod" with "stage"
    And wait for diffy comparison to complete

  Scenario: Compare the baseline against a review app
    # DIFFY_ENV2_URL=https://review.example.org
    Then compare diffy "baseline" with "custom"
    And wait for diffy comparison to complete

Related steps

Back to Diffy Step Definitions