Repository navigation
feat(native): locators, actionability and trusted input (phase 3) - #10
Merged
Merged
Conversation
unohee
force-pushed
the
feat/native-cdp-driver
branch
from
October 25, 2026 03:53
3fc4686 to
dc9805a
Compare
The native driver now acts on elements, so click, type_text, press_key, hover, scroll, select_option, upload_file, set_editor, wait_for, read_page (text) and read_image run on it unchanged. - selectors: Playwright's syntax as lyra and its callers use it, parsed into steps: css with open shadow roots pierced and :visible / :has-text() peeled into their own steps, text= (substring, "exact", /regex/), role= resolved through Chrome's own accessibility tree (Accessibility.queryAXTree) so roles and names are the browser's, xpath=, id=, data-testid=, nth=, visible=. An unknown engine is refused by name, never guessed. - locator: resolved afresh on every call in the frame's isolated world (frame_locator enters same-process iframes), first match acted on, retried until the timeout with Playwright's call-log wording, because describe_failure reads it: not visible / not enabled / not editable / not stable / outside of the viewport / "<x> intercepts pointer events" from a hit test at the element's centre. Remote objects live in a per-attempt object group released afterwards. - input: Input.dispatchMouseEvent / dispatchKeyEvent with a US key table and modifiers, Input.insertText for everything else (Korean and any committed IME text), macOS editing commands for Meta+A/C/X/V/Z. - Locator.evaluate takes world="main", so set_editor's CKEditor sync reaches window.CKEDITOR on native as it now does on patchright. The tree view (aria_snapshot and aria-ref) is phase 4; until then it raises "not implemented by the native driver yet". Verified: pytest 1741 passed (2 pre-existing macOS sha256sum failures deselected); tests/native 78; a real-Chrome smoke of the element tools (testing/native_locator_smoke_261023_v1.py, 19/19 headless and headful): clicks by css, text= and role=, hidden / disabled / read-only reported with the right reason, Korean typed exactly, Enter submits, Backspace, hover, select by value and label, a hidden file input filled, scroll to an element, wait_for, read_page text, an element image, set_editor into an iframe editor with the CKEditor field synced, and an overlay named as the element that intercepts the click. The phase 1-2 smoke still passes 18/18.
unohee
force-pushed
the
feat/native-locators
branch
from
October 25, 2026 03:57
7ef0ae0 to
38fe0db
Compare
unohee
marked this pull request as ready for review
October 25, 2026 03:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #9 (phases 1–2). Phase 3 of the plan.
What
With this PR, these tools run on the native driver unchanged:
click,type_text,press_key,hover,scroll,select_option,upload_file,set_editor,wait_for,read_page(text) andread_image.native/selectors.py):visible/:has-text()become their own steps.text=matches by substring, by"exact"text, or by/regex/.role=…[name=…]is resolved through Chrome's accessibility tree (Accessibility.queryAXTree).xpath=,id=,data-testid=,nth=,visible=.native/locator.py,native/injected.py)frame_locatorenters same-process iframes.describe_failurereads: not visible, not enabled, not editable, not stable, outside of the viewport, or<x> intercepts pointer events(from a hit test at the element's centre).native/input.py)Input.dispatch*Eventwith a US key table and modifiers.Input.insertTextfor Korean, IME text and anything else not on the table.Locator.evaluate(world="main")lets the CKEditor sync reachwindow.CKEDITOR.Not in this PR: the tree view (
aria_snapshotandaria-ref) is phase 4.Verified
pytest: 1741 passed. The two pre-existing macOSsha256sumfailures intests/test_claude_plugin.pywere deselected.tests/native: 78 tests.Real-Chrome smoke of the element tools (
testing/native_locator_smoke_261023_v1.py): 19/19, headless and headful.text=androle=wait_forread_pagetext; an element imageset_editorinto an iframe editor, with the CKEditor field syncedThe phase 1–2 smoke still passes 18/18.