Skip to content

feat(locator): introduce locator.visible() - #42479

Open
Pavel Feldman (pavelfeldman) wants to merge 1 commit into
microsoft:mainfrom
pavelfeldman:locator-visible
Open

feat(locator): introduce locator.visible()#42479
Pavel Feldman (pavelfeldman) wants to merge 1 commit into
microsoft:mainfrom
pavelfeldman:locator-visible

Conversation

@pavelfeldman

Copy link
Copy Markdown
Member

Summary

  • New locator.visible() shortcut, equivalent to filter({ visible: true }), documented as the recommended alternative to the :visible CSS pseudo-class
  • Locator generators render visible=true as the shortcut (visible() / .visible / .Visible per language); parser accepts both the shortcut and the filter form
  • Console API parity: playwright.locator(...).visible()

Adds a shortcut for filter({ visible: true }) to make matching only
visible elements more prominent than the :visible CSS pseudo-class.
Locator generators now render visible=true as the new shortcut, and the
locator parser accepts it alongside the filter form.
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

6 flaky ⚠️ [chromium-library] › library/video.spec.ts:736 › screencast › should work with video+trace `@frozen-time-library-chromium-linux`
⚠️ [chromium-library] › library/screencast.spec.ts:267 › start dispose stops recording `@chromium-ubuntu-22.04-node24`
⚠️ [chromium-library] › library/video.spec.ts:495 › screencast › should capture static page in persistent context Radoslav Kirilov (@smoke) `@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`

51284 passed, 1241 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

2 failed
❌ [firefox] › mcp/cli-devtools.spec.ts:138 › request* and response* commands support --filename @mcp-windows-latest-firefox
❌ [firefox] › mcp/cli-devtools.spec.ts:199 › recording-start-stop @mcp-windows-latest-firefox

8303 passed, 1367 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

🟢 CI is clear — both MCP failures are pre-existing Firefox flakes

Hi, I'm the Playwright bot and I took a first look at the CI failures. Nothing here points back to this PR: the two failed MCP tests are known Firefox/Windows flakes that also fail on unrelated PRs and pushes, and the "tests 1" report only had flaky retries.

Details

This PR adds locator.visible() — client locator, generators/parser, console API, docs and a few tests. It doesn't touch the MCP CLI devtools request/response or recording code paths, so it has no plausible mechanism to break them.

Pre-existing flake / infra

Both are Firefox-on-Windows only, in code this PR doesn't modify for that engine.

Flaky (no triage needed)

The "tests 1" report listed 6 flaky (video/screencast, third-party cookies, cross-origin request body) and 0 failures — all passed on retry, unrelated to locators.

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

Development

Successfully merging this pull request may close these issues.

2 participants