feat(selenium-devtools-py): per-test trace archives and tracePolicy - #362
Merged
Conversation
Greptile SummaryThe PR adds policy-controlled session and per-test trace archives for the Python Selenium adapter.
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| packages/selenium-devtools-py/src/selenium_devtools/init.py | Resolves trace mode, retention policy, and granularity consistently while explicitly warning when ambient environment settings are ignored. |
| packages/selenium-devtools-py/src/selenium_devtools/pytest_plugin.py | Adds pytest CLI and ini configuration, opts in explicit policy or granularity settings, and attributes commands to the active test. |
| packages/backend/src/trace-export.ts | Applies shared retention decisions and exports retained per-test slices with collision-resistant filenames. |
| packages/backend/src/trace-slice.ts | Slices commands by test UID and timestamped evidence by each test’s execution window. |
| packages/shared/src/trace-export.ts | Extends the worker-to-backend trace export contract for retention policy, granularity, multiple paths, and policy declines. |
| packages/trace/src/trace-retention.ts | Centralizes retention-policy behavior for backend and in-process trace exporters. |
Sequence Diagram
sequenceDiagram
participant P as Pytest or Python script
participant A as Python adapter
participant B as Backend
participant R as Retention logic
participant Z as Trace writer
P->>A: Configure trace mode, policy, granularity
A->>B: Stream commands, test states, and evidence
A->>B: Request trace export
alt Per-test granularity
B->>B: Slice accumulated run by test
loop Each test slice
B->>R: Evaluate retention policy
R-->>B: Retain or decline
B->>Z: Write retained slice
end
else Session granularity
B->>R: Evaluate run retention policy
R-->>B: Retain or decline
B->>Z: Write retained run
end
B-->>A: Paths or policy decline
Reviews (3): Last reviewed commit: "docs(selenium-devtools-py): document gra..." | Re-trigger Greptile
This was
linked to
issues
Sep 3, 2026
Closed
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