feat: add pierceFrames() locator API#41963
Conversation
Introduces page.pierceFrames() and frame.pierceFrames() that return a FrameLocator searching for elements in the main frame and in all iframes on the page, based on the pierce-frames selector.
Test results for "MCP"2 failed 7793 passed, 1266 skipped Merge workflow run. |
Test results for "tests 1"9 flaky50624 passed, 1190 skipped Merge workflow run. |
|
Hi, I'm the Playwright bot and I took a first look at the CI failures here. 🟢 Both failures are pre-existing flakes — the PR looks clearThe two reds are MCP tests, and this PR only touches the DetailsThis PR adds Pre-existing flake / infra
I'm a first pass, not the final word — but there's no evidence either failure is caused by this change. Triaged by the Playwright bot - agent run |
Summary
page.pierceFrames()andframe.pierceFrames()return aFrameLocatorthat searches for elements in the main frame and in all iframes on the page, based on the recently introducedpierce-framesselector.frameLocator()andfirst()/last()/nth()throw immediately when piercing frames; locator generators and parser render the new token aspierceFrames()/pierce_frames/PierceFrames.EvaluationStalledErrordistinguishes stalled-frame evaluations: pierce mode skips stalled frames but propagates real errors such as strict mode violations; assertions now report non-recoverable errors like "matched elements from multiple frames".