Skip to main content



Configure visual regression testing within your deployment pipeline

The visual-regression-deployment generator configures your pipeline to enable visual regression testing either natively, or through a cloud based provider.


nx g @ensono-stacks/playwright:visual-regression-deployment

Upon calling the visual-regression-deployment generator you will be presented with a number of options:

  • What type of visual regression tests would you like to use?
    • native
    • applitools

You should select the type of visual regression tests which you created through the @ensono-stacks/playwright:visual-regression generator.

Command line arguments

The following command line arguments are available:

OptionDescriptionTypeAccepted ValuesDefault
--type, -tMethod used to conduct visual testingstring[choices: "native", "applitools"]none

Generator Output

Playwright with native visual comparisons

Opting to scaffold native visual testing will make a number of amendments to your test projects configuration:

Generated files
β”œβ”€β”€ build
β”‚ β”œβ”€β”€ azDevOps
β”‚ β”‚ β”œβ”€β”€ azuredevops-updatesnapshots.yaml #Pipeline to capture and update baseline images within the CI
# New update snapshots task definition to update snapshots for all affected projects
description: Run e2e snapshot updates in ci
- npx nx affected --base="$BASE_SHA" --target=e2e --parallel=1
--skip-nx-cache --update-snapshots --grep @visual-regression
# Update snapshots task added to taskctl.yaml which can be called by adding a comment to pull requests
- task: e2e:updatesnapshots

Visit the Updating your baseline images​ documentation for further details!

Playwright with Applitools Eyes

Opting to scaffold visual testing with applitools will make a small change your test projects configuration:

- task: AzureCLI@2
displayName: build_deployment_${{ parameters.environment }}
APPLITOOLS_API_KEY: $(APPLITOOLS_API_KEY) # API key for applitools api added

Visit the Playwright with Applitools Eyes documentation for further details!