feat(selenium-devtools-py): A11y tree and element overlay in Python traces - #343
Merged
Conversation
Greptile SummaryThe PR adds accessibility snapshots and element-overlay evidence to Python Selenium traces while centralizing browser element scripts in the shared package.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| packages/shared/src/element-scripts.ts | Centralizes runner-aware browser extraction scripts and projects trace element records to the fields consumed by overlays. |
| packages/selenium-devtools-py/src/selenium_devtools/instrumentation.py | Adds guarded per-command accessibility, element, selector, and viewport capture to Python Selenium instrumentation. |
| packages/selenium-devtools-py/src/selenium_devtools/element_scripts.py | Fetches and caches version-aligned element scripts from the active backend without affecting test execution on failure. |
| packages/trace/src/a11y-snapshot.ts | Converts captured accessibility nodes into the shared snapshot text consumed by trace viewers. |
| packages/backend/src/index.ts | Exposes the runner-specific element-script endpoint used by adapters that cannot import the TypeScript package. |
| packages/backend/src/trace-export.ts | Carries the new action snapshot evidence through backend-managed trace export. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Page[Browser page] --> Scripts[Shared element scripts]
Backend[Backend route] --> Python[Python Selenium adapter]
Scripts --> Backend
Python --> Capture[Per-action capture]
Capture --> A11y[Accessibility snapshot]
Capture --> Elements[Element bounds and selectors]
Capture --> Viewport[Viewport metadata]
A11y --> Trace[Trace archive]
Elements --> Trace
Viewport --> Trace
Trace --> Viewer[A11y tree and element overlay]
Reviews (5): Last reviewed commit: "refactor(shared): capture only the eleme..." | Re-trigger Greptile
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.
What & why
Type of change
Packages touched
shared(types and contracts)core(framework-agnostic capture/reporting)elements(published element/snapshot API —@wdio/elements)service(WebdriverIO adapter)nightwatch-devtools(Nightwatch adapter)selenium-devtools(Selenium adapter)backend(server)app(UI)script(page-injected runtime)selenium-devtools-pytraceNotes for reviewers
Screenshots / recordings