Skip to content

feat(selenium-devtools-py): export a trace archive through the backend - #340

Merged
vishnuv688 merged 6 commits into
mainfrom
vv/288-python-trace-export
Aug 31, 2026
Merged

feat(selenium-devtools-py): export a trace archive through the backend#340
vishnuv688 merged 6 commits into
mainfrom
vv/288-python-trace-export

Conversation

@vishnuv688

@vishnuv688 vishnuv688 commented Aug 30, 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

Notes for reviewers

Screenshots / recordings

@greptile-apps

greptile-apps Bot commented Aug 30, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds backend-assisted trace archive export for the Python Selenium adapter and aligns raw WebDriver commands with the shared trace-action vocabulary.

  • Generates and consumes shared trace-export scopes.
  • Exports traces at run completion with timeout, lifecycle, and output-directory handling.
  • Adds trace-mode capture behavior and extensive export tests.
  • Maps Python Selenium protocol command names to shared trace actions.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
packages/selenium-devtools-py/src/selenium_devtools/init.py Adds trace-mode selection, serialized public export, successful-export latching, and teardown fallback behavior.
packages/selenium-devtools-py/src/selenium_devtools/trace_export.py Implements request-correlated backend export with timeout, error handling, and reader-thread response routing.
packages/selenium-devtools-py/src/selenium_devtools/lifecycle.py Routes trace-export responses and suppresses the interactive dashboard window in trace mode.
packages/selenium-devtools-py/src/selenium_devtools/instrumentation.py Records trace mode, exposes the resolved artifact directory, and skips unused screencast recording.
packages/selenium-devtools-py/src/selenium_devtools/pytest_plugin.py Requests the trace archive when the pytest run finishes.
packages/shared/src/trace-actions.ts Maps raw W3C Selenium commands into the shared trace-action vocabulary.
packages/selenium-devtools-py/tests/test_trace_export.py Covers request handling, fallback behavior, trace configuration, output placement, and export concurrency.

Sequence Diagram

sequenceDiagram
  participant Test as Python test
  participant Adapter as Selenium adapter
  participant Backend
  participant Reader as WebSocket reader
  Test->>Adapter: Finish run
  Adapter->>Backend: traceExport(requestId, outputDir, sessionId)
  Backend-->>Reader: traceExported(requestId, path)
  Reader->>Adapter: Resolve pending export
  Adapter-->>Test: Return archive path
Loading

Reviews (4): Last reviewed commit: "fix(selenium-devtools-py): never wait fo..." | Re-trigger Greptile

Comment thread packages/selenium-devtools-py/src/selenium_devtools/__init__.py Outdated
Comment thread packages/selenium-devtools-py/src/selenium_devtools/__init__.py Outdated
Comment thread packages/selenium-devtools-py/src/selenium_devtools/__init__.py Outdated
@vishnuv688
vishnuv688 merged commit c25ea78 into main Aug 31, 2026
11 checks passed
@vishnuv688 vishnuv688 linked an issue Aug 31, 2026 that may be closed by this pull request
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.

Decide where stream post-processing lives, then export a trace

1 participant