Skip to content

feat(ui-mode): update individual snapshots - #42421

Open
Devin Rousso (dcrousso) wants to merge 1 commit into
microsoft:mainfrom
dcrousso:fix-42393
Open

feat(ui-mode): update individual snapshots#42421
Devin Rousso (dcrousso) wants to merge 1 commit into
microsoft:mainfrom
dcrousso:fix-42393

Conversation

@dcrousso

Copy link
Copy Markdown
Contributor

reviewing image diffs currently requires rerunning tests with snapshot updates enabled

add a button for each diff that copies the actual image over the expected snapshot

fixes #42393

@dcrousso

This comment was marked as outdated.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Hi, I'm the Playwright bot and I took a first look at the CI failures here.

🟢 CI is clear — the one failure is a pre-existing flake

The single failure, [firefox] › mcp/cli-core.spec.ts:123 › select, is a known flake: the same test failed on the same mcp-windows-latest-firefox bot on an unrelated push SHA (610977b), and timed out on chromium/chrome on other SHAs/PRs. This PR only touches UI-mode snapshot-update code, which the MCP select tool doesn't exercise.

Details

Overall: nothing in this diff reaches the failing paths. The PR adds a "Save actual as expected" button in trace-viewer plus an updateSnapshot test-server endpoint (testServer.ts, testServerInterface.ts, attachmentsTab.tsx, uiModeTraceView.tsx, workbench.tsx). None of that is loaded by the MCP CLI or the library/page tests below.

Pre-existing flake / infra

  • [firefox] › mcp/cli-core.spec.ts:123 › select — pre-existing flake. In the test-results DB this test has failed/timed out on SHAs this PR can't be responsible for: firefox on push SHA 610977b (run 30020951381), chromium timedOut on push SHA 3e14efd (run 30034115836), and chrome timedOut on PR feat(trace): load trace files independently, produce a single context entry #42350 (run 32489690957). Firefox alone is green in 722 of 724 runs. The MCP browser_select path is untouched by this PR.

Not failures (no action)

  • The "tests 1" report lists 3 flaky, 0 failed — within-run flakes rescued on retry, all with long flake histories (e.g. firefox-page › page-goto.spec.ts:90 › should work with Cross-Origin-Opener-Policy rescued 302 times; page-event-request.spec.ts:181 › ...COOP... rescued 373 times; chromium.spec.ts:436 › Service Worker (advanced) rescued 239 times). Nothing to triage.

I'm a first pass, not the final word — but I couldn't find any failure that points back at this change.

Triaged by the Playwright bot - agent run

@dgozman

Copy link
Copy Markdown
Collaborator

There have been multiple attempts at this functionality (some examples: #12707, #14883, #24310, #28415) that never landed, so I'd recommend to first research what went wrong with previous attempts.

@pavelfeldman

Copy link
Copy Markdown
Member

Requesting a demo of this one, unclear from the code what is happening and which scenarios this supports.

@dcrousso
Devin Rousso (dcrousso) force-pushed the fix-42393 branch 2 times, most recently from c38f708 to 7308b9e Compare August 28, 2026 18:39
@dcrousso

Copy link
Copy Markdown
Contributor Author

before
Screenshot 2026-08-28 at 12 26 16

after
Screenshot 2026-08-28 at 12 25 21

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

</div>;
};

function UpdateSnapshotButton({ actualPath, expectedPath, onUpdateSnapshot }: {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we agreed to flash a green checkmark instead of updating the text?

/>;
};

function addLocalAttachmentPaths(model: TraceModel, result: reporterTypes.TestResult) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's going on here? Why don't we have correct attachment paths? Why do we only call before a single setModel(), and not before all the others?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ive reworked this

reviewing image diffs currently requires rerunning tests with snapshot updates enabled

add a button for each diff that copies the actual image over the expected snapshot
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

5 flaky ⚠️ [chromium-library] › library/video.spec.ts:736 › screencast › should work with video+trace `@realtime-time-library-chromium-linux`
⚠️ [chromium-library] › library/video.spec.ts:736 › screencast › should work with video+trace `@chromium-ubuntu-22.04-node22`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:257 › third party 'Partitioned;' cookies `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:470 › top level 'Partitioned;' cookie and same origin iframe `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-page] › page/page-event-request.spec.ts:181 › should return response body when Cross-Origin-Opener-Policy is set `@firefox-ubuntu-22.04-node20`

51277 passed, 1241 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

8305 passed, 1367 skipped


Merge workflow run.

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

Successfully merging this pull request may close these issues.

[Feature]: Update snapshot sticky header in UI Mode Attachments panel

3 participants