Repository navigation
ci: make /update-snapshots regenerate all baselines again - #456
Conversation
The update-all-snapshots job and npm run test:visual:update passed a bare --update-snapshots. Since Playwright 1.50 that means "changed", which only rewrites snapshots that fail comparison, so a real change within maxDiffPixelRatio left the baselines untouched and the summary comment reported them as identical. Pass --update-snapshots=all, which rewrites every snapshot whose render differs, as the docs describe. In "all" mode Playwright writes only the new image to test-results, so the artifact no longer carries before/after pairs; point the docs and the summary comment at the PR's Files changed view instead. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #456 +/- ##
=======================================
Coverage ? 59.48%
=======================================
Files ? 2
Lines ? 548
Branches ? 0
=======================================
Hits ? 326
Misses ? 222
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟢 Approval recommended
It is a minimal, well-understood one-flag correction applied consistently across the workflow, npm script, docs, and changelog, with no leftover inconsistencies or objective issues.
0 open findings
What changed in this PR
This PR fixes a behavioral drift in the visual-snapshot tooling. Since Playwright 1.50, a bare --update-snapshots means changed mode, which only rewrites baselines that fail comparison — so a real visual change that stays within maxDiffPixelRatio tolerance was silently left un-regenerated, and the bot incorrectly reported the snapshots as "identical". The fix makes /update-snapshots and the local tox -e visual-update path explicitly use --update-snapshots=all so any baseline whose render differs byte-for-byte is rewritten, and updates the docs/comment to point reviewers at the PR's Files changed view for before/after comparison (since all mode no longer produces diff pairs in the artifact).
Changes:
- Pass
--update-snapshots=allin theupdate-all-snapshotsworkflow job and thetest:visual:updatenpm script, with an explanatory comment on why the mode must be explicit. - Update the summary comment and developer docs to reflect that the artifact now holds only regenerated images and to point to the Files changed view.
- Add a
### CICHANGELOG entry documenting the fix.
| File | Description |
|---|---|
.github/workflows/update-snapshots.yml |
Switches the regenerate-all job to --update-snapshots=all with explanatory comment; updates summary-comment wording about the artifact. |
package.json |
Updates test:visual:update script to --update-snapshots=all (used by tox -e visual-update). |
docs/developer/visual-testing.md |
Documents the all mode behavior and points to the Files changed view for before/after. |
tests/visual/README.md |
Mirrors the same documentation update for the regenerate-all flow. |
CHANGELOG.md |
Adds a ### CI entry describing the fix. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
🎭 Visual Regression Test ResultsDetails
Skipped testsdesktop-chrome › theme.spec.ts › Visual Regression Tests › prob-matrix - full page screenshot |
) * test: refresh visual baselines after #453 Starter commit for the snapshot refresh; the regenerated baselines are added by /update-snapshots once #456 is on main. Co-Authored-By: Claude Opus 5.5 <[email protected]> * UPDATE: Regenerate all visual snapshots (39 files) * ci: trigger run on regenerated baselines Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
What was wrong
/update-snapshotsis documented as "Regenerates all baselines", but theupdate-all-snapshotsjob runsnpx playwright test --update-snapshotswith no mode. Since Playwright 1.50 a bare--update-snapshotsmeanschanged, and this repo is on 1.61.1. Inchangedmode a screenshot that passes comparison, meaning it stays withinmaxDiffPixelRatio, is treated as matching and is not rewritten (handleMatching()inplaywright/lib/matchers/expect.js). Onlyallrewrites a snapshot whose bytes differ from its baseline.So a real visual change that stays within tolerance can't be captured with the bot. The summary comment then says the snapshots "came out identical to the existing baselines", which isn't true. The case that turned this up: since #453 the fixtures site no longer shows the toolbar's GitHub icon (the fixtures set no
repository_url), but the change is within tolerance (3% fortoolbar.png, 1% for full-page shots), so/update-snapshotswould leave the baselines showing an icon the site no longer renders.npm run test:visual:update, whichtox -e visual-updateuses for the local macOS baselines, has the same drift.The change
update-snapshots.yml(update-all-snapshotsjob) and thetest:visual:updatenpm script now pass--update-snapshots=all, with a comment in the workflow saying why the mode has to be explicit.allwrites only snapshots whose new render differs byte-for-byte from the baseline, so baselines that render identically are left alone./update-new-snapshotsalready passes--update-snapshots=missingand is unchanged.allmode Playwright skips the comparison and writes only the new image totest-results/, so thesnapshot-update-diffartifact no longer has before/after pairs.docs/developer/visual-testing.md,tests/visual/README.mdand the summary comment now point to the PR's Files changed view, which shows each rewritten baseline before and after.### CI.Needs merging before it can be used
GitHub runs the default branch's copy of this workflow on
issue_comment, so the change only takes effect for/update-snapshotsonce it's onmain. The snapshot refresh for the #453 toolbar change is the follow-up: after this merges, I'll comment/update-snapshotson that PR.Verification
toHaveScreenshotupdate path in the installed Playwright 1.61.1. A comparison that passes returnshandleMatching()inchangedmode. Inallmode the expected image is not used for comparison, and the new render is written if its bytes differ.check-yaml,check-json, whitespace hooks) passes.issue_comment, so the first real test is the follow-up refresh.🤖 Generated with Claude Code