Skip to content

test(locators): parse nested locators in locator(), and() and or() - #42899

Merged
Yury Semikhatsky (yury-s) merged 1 commit into
microsoft:mainfrom
yury-s:test-42891
Sep 24, 2026
Merged

Yury Semikhatsky (yury-s) merged 1 commit into
microsoft:mainfrom
yury-s:test-42891

Conversation

@yury-s

Copy link
Copy Markdown
Member

Summary

Fixes #42891

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

9 flaky ⚠️ [chromium-library] › library/video.spec.ts:762 › screencast › should work with video+trace `@frozen-time-library-chromium-linux`
⚠️ [chromium-library] › library/video.spec.ts:690 › screencast › should capture full viewport `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/video.spec.ts:725 › screencast › should capture full viewport on hidpi `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/chromium/chromium.spec.ts:179 › serviceWorker(), and fromServiceWorker() work `@chromium-ubuntu-22.04-node24`
⚠️ [chromium-library] › library/video.spec.ts:521 › screencast › should capture static page in persistent context Radoslav Kirilov (@smoke) `@chromium-ubuntu-22.04-node20`
⚠️ [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`
⚠️ [webkit-page] › page/page-leaks.spec.ts:164 › waitFor should not leak `@webkit-ubuntu-22.04-node20`
⚠️ [playwright-test] › ui-mode-test-output.spec.ts:80 › should show console messages for test `@macos-latest-node22`

52209 passed, 1241 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

1 failed
❌ [webkit] › mcp/sse.spec.ts:196 › sse transport browser lifecycle (persistent) @mcp-ubuntu-latest-webkit

8704 passed, 1474 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

🟢 The one failure is a pre-existing flake — this PR is clear

Hi, I'm the Playwright bot and I triaged the failing CI run.

The single failure, [webkit] › mcp/sse.spec.ts:196 › sse transport browser lifecycle (persistent), also flaked on main with a byte-identical error, on a sha that predates this PR. This PR only adds 17 lines to tests/library/locator-generator.spec.ts and touches no product code.

Details

The MCP report has 1 failed, 8704 passed. The "tests 1" report has 9 flaky and no failures, so there is nothing to triage there.

Pre-existing flake / infra

  • [webkit] › mcp/sse.spec.ts:196 › sse transport browser lifecycle (persistent) (mcp-ubuntu-latest-webkit) — flake. The same (project_name, file, test_title) failed on main, sha 3847b98, run 35785310453 — no PR attached — with exactly the same assertion:

    expect(received).toEqual(expected)
    - ObjectContaining { "result": "\"42\"" }
    + Object {            "result": "undefined" }
    Ran Playwright code: await page.evaluate('() => localStorage.a');
    

    On that main run the test passed on the other attempts, so it is a within-run flake there too. Across the aggregated CI results it is otherwise solid — 1 failing run out of 745 for this project/test, and the sibling sse transport browser lifecycle variants (isolated, multiclient, and the chromium/firefox/chrome/msedge projects) are at 0 failures. The signature is a localStorage value not yet visible to the restarted persistent-profile browser, i.e. a timing race in the SSE lifecycle test, not something a locator-parsing test can reach.

    This PR adds a regression test for nested locator parsing in locator(), and() and or(). It changes no product code and nothing under packages/playwright/src/mcp, so it cannot influence the SSE transport lifecycle.

Worth noting the DB also has this test failing on an earlier sha of this branch (f0a6442, run 35944787945), which is consistent with an intermittent failure rather than a deterministic break — and the main occurrence is what settles it.

Triaged by the Playwright bot - agent run

@yury-s
Yury Semikhatsky (yury-s) merged commit a119e14 into microsoft:main Sep 24, 2026
44 of 45 checks passed
@yury-s
Yury Semikhatsky (yury-s) deleted the test-42891 branch September 24, 2026 16:19
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.

[Bug]: Trace viewer Locator tab doesn't highlight .locator() calls

2 participants