feat(selenium-devtools-py): export a trace archive through the backend - #340
Merged
Conversation
Greptile SummaryThe PR adds backend-assisted trace archive export for the Python Selenium adapter and aligns raw WebDriver commands with the shared trace-action vocabulary.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| 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
Reviews (4): Last reviewed commit: "fix(selenium-devtools-py): never wait fo..." | 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-pyNotes for reviewers
Screenshots / recordings