fix(playwright): infer snapshot platform for Accept and Undo - #1
Draft
dimazollo wants to merge 2 commits into
Draft
fix(playwright): infer snapshot platform for Accept and Undo#1dimazollo wants to merge 2 commits into
dimazollo wants to merge 2 commits into
Conversation
Downloaded blob reports may not retain the original baseline path. Allow GUI Accept and Undo to resolve platform tokens explicitly without changing the default local behavior. Recognize modern screenshot matcher errors using their diff attachments so accepted images do not leave an error result with no message. Keep mixed functional failures non-acceptable as a whole.
Persist the test-process platform or read it from each source blob during merge. Retain provenance across queued results and synthetic Accept/Undo attempts so opening a Linux report on macOS needs no platform flag. Use the flag only as a fallback for legacy reports. Refuse unknown or conflicting platforms before any batch writes instead of silently selecting the GUI host OS.
This was referenced Sep 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Opening a Linux Playwright screenshot report on macOS made GUI Accept resolve
the baseline using the GUI host's platform. It can create a new
*-darwin.pnginstead of updating the existing
*-linux.png. Blob-merged reports do notnecessarily retain the original baseline filename or source platform.
Playwright 1.59 also uses a new screenshot error header. The adapter classified
it as a generic error, leaving an accepted attempt with an error status but no
error message (displayed as Unknown error).
Changes
their test process; blob merges read each source ZIP's metadata header using
Playwright's V2 per-report merge hook. Queued results retain their own source.
{platform}and the default{snapshotSuffix}in GUI Accept and Undo. Preserve it in accepted results.every selected platform before starting a batch of writes.
--snapshot-platform linux|darwin|win32only as a legacy fallback. Rejectit if it conflicts with a recorded platform; it is not required in normal use.
actual and diff attachments. Preserve unrelated functional failures.
mismatch classification and mixed failures with regression tests.
Verification
npm teston Node 20.19.6: 690 server tests and 847 frontend tests passed;full lint and test typechecks passed.
npm run buildpassed (existing webpack warnings).producing a blob report. Merged on macOS using both reporters.
report database retained
html-reporter:platform=linux.platform flag. Clicked Accept: existing Linux baseline changed to the exact
actual image bytes; no Darwin baseline was created. The image exposed Undo.
darwin.unreadable or malformed metadata, unknown platforms, conflicting fallback and
batch preflight before any writes.
unavailable; local checks and UI verification above were completed.
Usage
Run from the source checkout containing the matching Playwright config and
downloaded report database/images. A static file server cannot write baselines.
Automatic blob detection is verified with Playwright 1.59.1 and uses internal V2
merge hooks and
onBlobReportMetadata.userAgent. Unsupported formats, unknownLinux distribution IDs, and older merge versions without the hook fail closed.
This does not recover arbitrary custom
testInfo.snapshotSuffixvalues or migratemetadata/errors already stored by old reporters. Re-merge their original blobs
with the fixed reporter; use the explicit fallback only when the source platform
has been independently verified and cannot be recovered. This is a draft in the
personal fork, not an upstream submission.