Skip to content

fix(aria): do not hang ai snapshot on frameset pages - #41816

Merged
dgozman merged 1 commit into
microsoft:mainfrom
dgozman:fix-41784
Jul 16, 2026
Merged

fix(aria): do not hang ai snapshot on frameset pages#41816
dgozman merged 1 commit into
microsoft:mainfrom
dgozman:fix-41784

Conversation

@dgozman

@dgozman dgozman commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Query body,frameset instead of just body when taking an aria snapshot without an explicit selector, following the document.body spec. Otherwise, snapshot never resolves on frameset pages that do not have a body element.
  • Non-strict query, because pages with nested framesets have multiple frameset elements.

Fixes #41784

Query "body,frameset" instead of just "body" when taking a snapshot
without an explicit selector, following the "document.body" spec.
Otherwise, snapshot never resolves on frameset pages that do not have
a "body" element.

Fixes: microsoft#41784
@dgozman
dgozman requested a review from Skn0tt July 16, 2026 10:37
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

2 failed
❌ [chromium] › mcp/annotate.spec.ts:230 › should capture annotations via show --annotate @mcp-macos-latest-chromium
❌ [webkit] › mcp/annotate.spec.ts:173 › user-initiated annotate downloads zip with feedback.md @mcp-macos-latest-webkit

7758 passed, 1249 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

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

🟢 The two failures are pre-existing flakes — this PR is clear

Both failures are in mcp/annotate.spec.ts, which never touches the aria-snapshot code path this PR changes (page.ts querying body,frameset). Each test flips verdict across hundreds of runs on unrelated SHAs.

Details

This PR only changes the no-selector aria-snapshot query in packages/playwright-core/src/server/page.ts (plus a frameset test in page-aria-snapshot-ai.spec.ts). The MCP annotate download/feedback flow doesn't exercise aria snapshots, so the diff can't reach either failure.

Pre-existing flake / infra

  • [chromium] › mcp/annotate.spec.ts:230 › should capture annotations via show --annotate — flaky across the test-results DB, flipping verdict on SHAs unrelated to this PR: failed 4 of 446 chromium runs (and 6/446 chrome, 8/434 firefox, 6/451 webkit, 3/221 msedge), passing the rest.
  • [webkit] › mcp/annotate.spec.ts:173 › user-initiated annotate downloads zip with feedback.md — same story: failed 10 of 451 webkit runs (and 13/434 firefox, 3/446 chrome), passing the rest, on unrelated SHAs.

No test the diff can reach failed, and everything else passed (7758 passed, 1249 skipped).

Triaged by the Playwright bot - agent run

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

1 failed
❌ [playwright-test] › playwright.spec.ts:248 › should respect headless in launchPersistent @ubuntu-latest-node26

8 flaky ⚠️ [chromium-library] › library/chromium/chromium.spec.ts:211 › should intercept service worker requests (main and within) `@frozen-time-library-chromium-linux`
⚠️ [chromium-library] › library/video.spec.ts:699 › screencast › should capture full viewport on hidpi `@frozen-time-library-chromium-linux`
⚠️ [chromium-library] › library/video.spec.ts:736 › screencast › should work with video+trace `@frozen-time-library-chromium-linux`
⚠️ [chromium-library] › library/chromium/chromium.spec.ts:211 › should intercept service worker requests (main and within) `@chromium-ubuntu-22.04-node24`
⚠️ [chromium-library] › library/video.spec.ts:699 › screencast › should capture full viewport on hidpi `@chromium-ubuntu-22.04-node20`
⚠️ [chromium-library] › library/video.spec.ts:294 › screencast › should capture navigation `@chromium-ubuntu-22.04-node22`
⚠️ [chromium-library] › library/video.spec.ts:664 › screencast › should capture full viewport `@chromium-ubuntu-22.04-node22`
⚠️ [chromium-library] › library/video.spec.ts:699 › screencast › should capture full viewport on hidpi `@chromium-ubuntu-22.04-node22`

49724 passed, 1156 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

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

🟡 Two confirmed flakes, plus one failure I can't fully close out

This PR only changes the no-selector aria-snapshot query in packages/playwright-core/src/server/page.ts (bodybody,frameset). None of the failing tests exercise that path, so I don't think any is caused by the change — but one of them has no history to prove it's a flake, so I'm calling it uncertain rather than clean.

Details

Caused by this PR

  • None. The diff is confined to ariaSnapshotForFrame; none of the failures touch aria snapshots.

Pre-existing flake / infra

  • [chromium] › mcp/annotate.spec.ts:230 › should capture annotations via show --annotate — flaky across the test-results DB, flipping verdict on SHAs unrelated to this PR: failed 8/222 firefox, 6/228 webkit, 3/226 chromium, 3/227 chrome runs, passing the rest.
  • [webkit] › mcp/annotate.spec.ts:173 › user-initiated annotate downloads zip with feedback.md — same story: failed 13/222 firefox, 8/228 webkit, 4/227 chrome, 2/226 chromium runs on unrelated PRs/SHAs (fix-41766, route-from-cache, main, …).

Uncertain

  • [playwright-test] › playwright.spec.ts:248 › should respect headless in launchPersistent (@ubuntu-latest-node26) — failed with expect(result.exitCode).toBe(0) → got 1, in 1.2s. Across the DB this test is 1464 passed / 1 failed, and the single failure is this very run — no other run failed it, so I can't cite a pre-existing flake. The diff has no path to it: it launches a headed persistent context and asserts navigator.userAgent lacks Headless, nothing aria-related. Reads like a one-off headed-launch hiccup, but with no second occurrence I won't call it a flake outright. A rerun of that job should tell — if it goes green, it's noise.

Everything else passed (MCP: 7758 passed / 1249 skipped; tests 1: 49724 passed / 1156 skipped, 8 flaky rescued on retry).

Triaged by the Playwright bot - agent 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

2 participants