chore(locators): rewrite locator parser with per-language parsers - #42895
Conversation
Replace regex-based template rewriting with a tokenizer, a recursive descent parser per language producing language-neutral calls, and a shared selector builder. Also parses and(), or() and locator(locator).
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Map each language's method names to call handlers that produce selector parts, and pass the ParsedSelector to asLocators directly. Support multiple regex flags in Python, Java and C# locators.
The parser validates methods, arguments and options itself, so the selector no longer needs to be rendered back and compared to the input.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Test results for "tests 1"7 flaky52181 passed, 1241 skipped Merge workflow run. |
Test results for "MCP"2 failed 8703 passed, 1474 skipped Merge workflow run. |
|
Hi, I'm the Playwright bot and I took a look at the failing CI runs here. 🟢 Both failures are pre-existing Firefox MCP flakes — the PR is clear
DetailsThis PR only touches Pre-existing flake / infra
Caveat, as always: this is a statistical argument, not a proof. A rerun of the MCP job should come back green. Triaged by the Playwright bot - agent run |
d6a10f6
into
microsoft:main
Summary
ParsedSelectordirectly; each language maps its method names to shared call handlers.asLocatorsis removed. Also parsesand(),or()andlocator(locator).i,m,s) in Python, Java and C# locators; the generators no longer dropmands.locator('css=.foo')now yields.foo.References #42891