chore(recorder): render highlights via the shared element highlight - #42253
chore(recorder): render highlights via the shared element highlight#42253Dmitry Gozman (dgozman) wants to merge 3 commits into
Conversation
The recorder now highlights the current selector through the shared element highlight, replacing the actionSelector in the UIState. The trace viewer calls injectedScript.addHighlight() directly for the same purpose. Frame.addHighlight does not require a Progress anymore. Also fix a few issues in the shared element highlight this uncovered: - The action point element is created lazily, so that highlights that never show it do not affect 'x-pw-action-point' selectors. - The rAF loop ignores elements inside glass panes to avoid matching its own tooltips, and tolerates selectors that cannot be queried in the frame, e.g. those with frame steps. - The recorder does not track internal calls, so that Frame.highlight calls coming from locator.highlight() do not interfere with the user-added highlights.
Introduce an internal 'aria-template=<json>' selector engine that matches elements against the serialized aria template. The recorder and the trace viewer now highlight the aria template through the same code path as the highlighted selector, and the UIState does not carry any highlight state anymore. Tooltips are skipped for aria-template highlights.
…pported Highlights now resolve through the selector machinery, which confines a plain selector to the frame it resolves to. Highlighting across frames will be restored together with the piercing frames support.
Test results for "tests 1"3 flaky51122 passed, 1208 skipped Merge workflow run. |
Test results for "MCP"3 failed 8098 passed, 1311 skipped Merge workflow run. |
|
Hi, I'm the Playwright bot and I took a first look at the CI failures. 🟢 CI is clear — the 3 failures are pre-existing Firefox flakesThe three failing MCP tests all flip verdict on unrelated PRs and on DetailsThe Pre-existing flake / infra
All three are green on every other browser (chromium, webkit, chrome, msedge: 0 failures across ~2000 runs each), and this PR's diff — shared element highlight, Triaged by the Playwright bot - agent run |
Summary
Frame.addHighlight) instead of theUIState.aria-template=<json>selector engine, so that the highlighted aria template goes through the same code path.injectedScript.addHighlight()directly.