/diff
Scaffolds visual regression with playwright snapshots.
When to use
- The user wants visual regression coverage
- "Set up screenshot diffing", "snapshot tests", "pixel diff"
- Before any major UI refactor
What it writes
playwright.visual.config.tssnapshot-tuned configtests/visual/routes.tslist of routes to capture (default/)tests/visual/snapshots.spec.tsspec that loops routes and runstoHaveScreenshot
Pixel diffing is done by playwright's built-in toHaveScreenshot, not by dragoon. We just generate the harness.
Run it
dragoon diff
dragoon diff --apply
dragoon diff --apply --routes "/,/about,/login"
Then
npm i -D @playwright/test
npx playwright install --with-deps chromium
npx playwright test tests/visual --update-snapshots # first time, baselines
npx playwright test tests/visual # after that, regression