Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: ability to save snapshot diffs with trace when --update-snapshots is run #34197

Open
keyserj opened this issue Jan 2, 2025 · 0 comments

Comments

@keyserj
Copy link

keyserj commented Jan 2, 2025

🚀 Feature Request

With npx playwright test, if a snapshot fails and traces are being saved, the trace will have nice attachments for debugging - actual.png, expected.png, diff.png.

But with npx playwright test --update-snapshots, these attachments are not saved. It would be nice to have these when snapshots are being updated, so that I can still see the pixel-precise differences. Potentially saving these in this case could be based on a config or CLI option.

Initial thread on Discord

Example

No response

Motivation

I'm using a workflow where I assume that snapshot diffs are intentional, so that when there are diffs I don't have to run the tests a second time just to fix them. I'm also running this in CI, and automatically creating a commit with the diffs.

Most of the time, I expect this to be good because the diffs are intentional, and usually using github/vscode git diff to compare before/after is good enough, but sometimes there have been small pixel diffs that are hard to tell without the playwright-generated diff file.

Since I'm using version control, I can always run the tests locally without --update-snapshots in order to see the diffs (or maybe manually use the same algorithm that playwright uses to create a diff file), but that seems like more effort than is necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant