Skip to content

chore(server): simplify action helper signatures - #42904

Open
Dmitry Gozman (dgozman) wants to merge 1 commit into
microsoft:mainfrom
dgozman:chore-action-helpers
Open

Dmitry Gozman (dgozman) wants to merge 1 commit into
microsoft:mainfrom
dgozman:chore-action-helpers

Conversation

@dgozman

@dgozman Dmitry Gozman (dgozman) commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Introduce SelectorTarget { selector, strict, scope } and use it across frame, element handle and frame selectors methods instead of passing selector, strict and scope separately. StrictOptions is gone.
  • Introduce a PointerAction descriptor for _retryPointerAction and _performPointerAction, separating what the action decides from what the user passed.
  • _retryWithProgressIfNotConnected takes explicit retry options instead of spreading the whole action options.
  • Dispatchers pass params as the SelectorTarget.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

- Introduce SelectorTarget { selector, strict, scope } and use it in
  frame, element handle and frame selectors methods instead of passing
  selector, strict and scope separately. StrictOptions is gone.
- Introduce PointerAction descriptor for _retryPointerAction and
  _performPointerAction, separating what the action decides from what
  the user passed.
- _retryWithProgressIfNotConnected takes explicit retry options instead
  of spreading the whole action options.
- Dispatchers pass params as the SelectorTarget.
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

1 failed
❌ [firefox] › mcp/cli-json.spec.ts:220 › request and per-part commands return JSON result @mcp-windows-latest-firefox

8763 passed, 1480 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

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

4 flaky ⚠️ [chromium-library] › library/video.spec.ts:762 › screencast › should work with video+trace `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/chromium/chromium.spec.ts:373 › should produce network events, routing, and annotations for Service Worker `@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`

52291 passed, 1243 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 on this PR.

🟢 Both failures are pre-existing flakes / infra

Neither failing test runs through the selector or pointer-action code this PR refactors, and both have failed before on SHAs this PR can't be responsible for.

Details

The PR only touches server-side action plumbing (SelectorTarget, PointerAction, _retryWithProgressIfNotConnected) in frames.ts, dom.ts, frameSelectors.ts, their dispatchers and the recorder/screenshotter callers. About 61k other tests passed across both workflows (tests 1 and MCP) on 586dec2, including the page/locator suites that run this code most heavily.

Pre-existing flake / infra

Triaged by the Playwright bot - agent run

@github-actions

Copy link
Copy Markdown
Contributor

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

🟢 The one failure looks like pre-existing infra noise, not this PR

playwright.spec.ts:276 › should respect headless in launchPersistent failed on one Linux bot because Chromium couldn't find an X server. This PR only refactors action helper signatures and doesn't touch browser launch.

Details

There was one real failure. The 4 flaky tests were rescued on retry and aren't counted.

Pre-existing flake / infra

  • [playwright-test] › playwright.spec.ts:276 › should respect headless in launchPersistent (ubuntu-latest-node24, job). The inner test launches a headed persistent Chromium, and it died right away:
    browserType.launchPersistentContext: Target page, context or browser has been closed
    Looks like you launched a headed browser without having a XServer running.
    ERROR:ui/ozone/platform/x11/ozone_platform_x11.cc:257] Missing X server or $DISPLAY
    
    That points to the bot's xvfb/DISPLAY setup, not to Playwright code. The same test failed the same way (Expected: 0, Received: 1 on the exit code) in run 32517090820 on ubuntu-latest-node26 for feat(chromium): roll to r1242 #42356, a Chromium roll that has nothing to do with this PR. It's rare: that is the only failure in about 2,580 Ubuntu runs of this test in the test-results DB (this PR's run isn't in the snapshot yet).
  • Does the diff reach it? Not in any way I can find. The PR changes dom.ts, frames.ts, page.ts, screenshotter.ts, the recorder, and the element/frame dispatchers. None of these are on the launchPersistentContext / X11 startup path, and the browser exited before it got a page.

A caveat: the DB refresh (update) failed with a GitHub API 500, so the newest runs may be missing from the snapshot. A re-run of the failed job should come back green.

Triaged by the Playwright bot - agent run

This branch has not been deployed

No deployments
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.

2 participants