Skip to content

Commit a46085e

Browse files
DavertMikclaude
andcommitted
feat(CDPBrowser): role locators + full skip-sweep implementation
Implements everything found implementable in a full audit of CDPBrowser's remaining test skips against Obscura v0.2.0 and Chrome: - Role locators ({role, text, exact}): in-page ARIA role resolver (explicit role attribute + implicit HTML-ARIA mapping) with accessible-name matching, a new 'role' find() strategy, and ARIA-checkbox support in check/uncheck. - grabWebElements/grabWebElement: new CDPElementHandle + WebElement.js 'cdpbrowser' case, addressed via a new _runSelected() that _run delegates to. Also fixes MultipleElementsFound.fetchDetails(), which previously threw against a sparse array of undefined elements. - context parameter: composed with any active within() block via a scope- chain resolved layer by layer in find(), wired into every action that accepts one. - Shadow DOM: single- and (where the engine allows) nested-level piercing. - attachFile: real <input type=file> via the CDP DOM domain, or a synthetic dragenter/dragover/drop sequence with a duck-typed dataTransfer (no DataTransfer/DragEvent constructor dependency) for dropzone elements. - #strict mode: pressKey() (new), and NonFocusedType via the shared focusCheck.js used by Playwright/Puppeteer/WebDriver. - Network traffic recording: CDP Network.* events wired into the shared lib/helper/network contract. - grabTextFrom(All) and contextual see/dontSee now use the visibleText() fallback on unreliable-innerText engines, matching waitForText. Two bugs in the previous mandate's Obscura work were found and fixed along the way: visibleText() appended a spurious trailing newline when the root itself was a block-level element (not just its descendants), and the dropzone path depended on DataTransfer/DragEvent, which Obscura doesn't implement. Narrowly re-guards what retesting proved still genuinely broken: nested shadow DOM (Obscura never retroactively upgrades a custom element defined after it's already parsed into another element's shadow root), native file input uploads (DOM.setFileInputFiles sets the live state correctly but Obscura's real multipart POST drops the file), a zero-size bounding rect for a plain inline element, and the already-documented label-click-focus non-determinism now also hit by two #strict mode tests. Two network-traffic tests are skipped for pre-existing external-site content drift / navigation timing unrelated to this work (reproduced identically against Puppeteer). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 9af3916 commit a46085e

6 files changed

Lines changed: 915 additions & 95 deletions

File tree

0 commit comments

Comments
 (0)