Skip to content

feat(selenium-devtools-py): A11y tree and element overlay in Python traces - #343

Merged
vishnuv688 merged 22 commits into
mainfrom
vv/341-python-a11y-elements
Sep 1, 2026
Merged

feat(selenium-devtools-py): A11y tree and element overlay in Python traces#343
vishnuv688 merged 22 commits into
mainfrom
vv/341-python-a11y-elements

Conversation

@vishnuv688

@vishnuv688 vishnuv688 commented Aug 31, 2026

Copy link
Copy Markdown
Member

What & why

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Polish (an improvement to an existing feature)
  • Breaking change (existing behavior changes for users)
  • Documentation
  • Internal (build, CI, dependencies, tooling)

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-py
  • trace

Notes for reviewers

Screenshots / recordings

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds accessibility snapshots and element-overlay evidence to Python Selenium traces while centralizing browser element scripts in the shared package.

  • Serves runner-specific accessibility and element scripts from the backend for the Python adapter.
  • Captures per-action accessibility trees, element bounds, selectors, viewport metadata, and overlay points.
  • Extends trace generation and baseline handling for the new snapshot evidence.
  • Removes unused input values and links from captured element resources while retaining the full live element API.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

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]
Loading

Reviews (5): Last reviewed commit: "refactor(shared): capture only the eleme..." | Re-trigger Greptile

Comment thread packages/shared/src/element-scripts.ts Outdated
Comment thread packages/shared/src/element-scripts.ts
@vishnuv688
vishnuv688 merged commit b2a5fe1 into main Sep 1, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A11y tree is empty in a Python trace: no per-action element snapshots

1 participant