Repository navigation
feat(helpers): acting CDP helpers, HelperCapabilities type, ARIA snapshots for CDP and Puppeteer - #5749
Merged
Conversation
… for CDP and Puppeteer - Add Obscura and Lightpanda to Container.STANDARD_ACTING_HELPERS so aiTrace, pageInfo, Decision, screenshot, pause and heal find them - Fix aiTrace crashing container creation via missing output.warn - Add CodeceptJS.HelperCapabilities type (screenshot, video, trace, aria + CDP-detected layout/xpath/innerText); Playwright, Puppeteer, WebDriver and CDPBrowser declare this.capabilities - Add grabAriaSnapshot to CDPBrowser (Accessibility.getFullAXTree) and Puppeteer (page.accessibility.snapshot), rendered in Playwright's ARIA snapshot format by lib/aria.js - Skip screenshots / ARIA in screenshot plugin, aiTrace and Decision when the helper declares the capability false - CDPBrowser screenshots resolve paths via screenshotOutputFolder so absolute paths from aiTrace work Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ex in CDP snapshot Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Playwright Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
aiTrace crashed the whole run under Obscura and Lightpanda. This PR makes the CDP helpers first-class acting helpers, adds a typed
capabilitiescontract for all acting helpers, and brings ARIA snapshots to Lightpanda, Obscura and Puppeteer so aiTrace, pageInfo and Decision can use them.Fixes
ObscuraandLightpandaadded toContainer.STANDARD_ACTING_HELPERS. aiTrace, pageInfo, Decision, screenshot, pause, heal, expose and autoDelay now find them.output.warn, soCould not load plugin aiTraceaborted container creation. It now prints the message instead.CDPBrowser.saveScreenshot/saveElementScreenshotjoinedoutput_dirwith absolute paths, so aiTrace step screenshots on Obscura were silently lost. They now resolve paths viascreenshotOutputFolder, like Playwright.CodeceptJS.HelperCapabilitiesA new type in
typings/index.d.tsthat helper authors can implement:The screenshot plugin,
captureSnapshot(aiTrace, pageInfo) and Decision skip screenshots and ARIA when a helper declares themfalse. Lightpanda no longer produces dangling screenshot links in traces.ARIA snapshots
CDPBrowser.grabAriaSnapshot(locator = '//body')usesAccessibility.getFullAXTree(supported by Lightpanda and Obscura). It scopes to an element viaDOM.describeNode→backendDOMNodeId.Puppeteer.grabAriaSnapshot(locator = '//body')usespage.accessibility.snapshot({ root }).lib/aria.jsrenders the engine's tree as a nested- role "name"list. Generic wrappers are dropped, and text that repeats its parent's name is skipped. The output is not normalized to Playwright's format, but it stays parseable bycompactAriaSnapshotanddiffAriaSnapshots.Testing
test/unit/aria_test.js: CDP and Puppeteer trees, scoping, and compact/diff round-trip.test/helper/webapi.js:#grabAriaSnapshotfor every helper that supports it.typings/tests/helper.types.ts: valid and invalidHelperCapabilitiesobjects;npm run defandnpm run dtslintpass.grabAriaSnapshot()works on all three, and aiTrace writes an ARIA file per step on Lightpanda.Not in this PR
videoandtraceare declared but not read yet; the screencast plugin still duck-typesstartScreencast.STANDARD_ACTING_HELPERS.<label for>, so checkboxes and radios come out unnamed there.🤖 Generated with Claude Code