Skip to content

feat(selenium-devtools-py): CDP push-mode screencast and performance capture - #328

Merged
vishnuv688 merged 9 commits into
mainfrom
vv/292-python-cdp-screencast
Aug 24, 2026
Merged

feat(selenium-devtools-py): CDP push-mode screencast and performance capture#328
vishnuv688 merged 9 commits into
mainfrom
vv/292-python-cdp-screencast

Conversation

@vishnuv688

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

@vishnuv688 vishnuv688 linked an issue Aug 24, 2026 that may be closed by this pull request
@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds CDP push-mode screencasting and navigation performance capture to the Python Selenium adapter, while fixing first-selection snapshot replay in the viewer.

  • Bounds pushed screencast memory through progressive decimation while preserving the beginning, middle coverage, and final frame.
  • Uses a dedicated CDP WebSocket with per-command screenshot fallback.
  • Enriches completed navigation command rows with performance and document data.
  • Waits for snapshot mode to render before replaying DOM mutations.

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/screencast.py Adds synchronized bounded-frame decimation and retains the latest skipped frame during finalization, resolving the previously reported stale video tail.
packages/selenium-devtools-py/src/selenium_devtools/cdp_screencast.py Implements best-effort push-mode Chrome screencasting over an independently owned CDP connection with frame acknowledgements and cleanup.
packages/selenium-devtools-py/src/selenium_devtools/instrumentation.py Integrates push-stream lifecycle and post-navigation performance enrichment into per-driver command capture.
packages/selenium-devtools-py/src/selenium_devtools/performance.py Captures browser navigation and resource timing data and shapes it for replacement command rows.
packages/app/src/components/browser/snapshot.ts Ensures snapshot mode and its iframe finish rendering before DOM replay begins.
packages/selenium-devtools-py/tests/test_screencast.py Covers bounded growth, middle-run retention, final-frame preservation, ordering, and idempotent shutdown.

Sequence Diagram

sequenceDiagram
    participant Browser
    participant CDP as Dedicated CDP socket
    participant Recorder as ScreencastRecorder
    participant Finalizer
    Browser->>CDP: screencastFrame
    CDP->>Recorder: add_frame(data)
    CDP->>Browser: screencastFrameAck
    Finalizer->>CDP: stop()
    Finalizer->>Recorder: finalize()
    Recorder->>Recorder: stop() and retain pending tail
    Recorder->>Recorder: encode retained frames
Loading

Reviews (2): Last reviewed commit: "fix(selenium-devtools-py): end the scree..." | Re-trigger Greptile

Comment thread packages/selenium-devtools-py/src/selenium_devtools/screencast.py
@vishnuv688
vishnuv688 merged commit 04d5ca2 into main Aug 24, 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.

CDP push-mode screencast and performance capture

1 participant