Skip to content

Selenium and Nightwatch Trace Parity - #273

Open
vishnuv688 wants to merge 31 commits into
mainfrom
vv/selenium-nightwatch-parity
Open

Selenium and Nightwatch Trace Parity#273
vishnuv688 wants to merge 31 commits into
mainfrom
vv/selenium-nightwatch-parity

Conversation

@vishnuv688

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

Notes for reviewers

Screenshots / recordings

@vishnuv688

Copy link
Copy Markdown
Member Author

@greptile-apps

@greptile-apps

greptile-apps Bot commented Aug 7, 2026

Copy link
Copy Markdown

Greptile Summary

This PR expands Selenium and Nightwatch trace parity by improving command timing, DOM collection, action snapshots, assertions, locator portability, and replay presentation.

  • Adds shared runner-aware locator generation and XPath support across capture and UI replay.
  • Improves Nightwatch command interception, raw WebDriver collection, assertion capture, navigation anchoring, and screencast coordination.
  • Aligns Selenium action snapshots, assertion targets, command metadata, and element locator tracking.
  • Updates trace export, mutation attribution, snapshot association, backend metadata parsing, documentation, examples, and regression coverage.

Confidence Score: 5/5

The PR appears safe to merge because no concrete, unacknowledged changed-code failure was established.

The revised capture, locator, timing, metadata, and replay paths are supported by focused tests, while the remaining plausible limitations are either explicitly documented or contradicted by the implementation.

Important Files Changed

Filename Overview
packages/nightwatch-devtools/src/helpers/browserProxy.ts Reworks command interception, navigation injection, failure extraction, ordering, assertions, and input-dispatch coordination; no unacknowledged concrete defect was established.
packages/nightwatch-devtools/src/session.ts Adds raw-transport collection, destination-page anchoring, command-timestamped snapshots, and pending capture tracking.
packages/core/src/action-snapshot.ts Timeout-guards every driver probe, binds captures to command timestamps, and generates runner-specific web locators.
packages/core/src/element-scripts.ts Consolidates visibility and locator generation while adding portable XPath and runner-specific WebdriverIO text locators.
packages/core/src/trace-frame-snapshots.ts Makes snapshot claims reusable and provides a latest-prior fallback for actions without a fresh capture.
packages/shared/src/locator-dialect.ts Defines runner locator dialects and cross-dialect matching helpers with focused edge-case tests.
packages/selenium-devtools/src/driverPatcher.ts Aligns command completion timing, snapshot capture, locator tracking, and input-dispatch gating with shared trace semantics.
packages/app/src/components/browser/element-overlay.ts Adds safe XPath resolution in replayed iframe documents while retaining CSS and WebdriverIO text-selector support.
packages/backend/src/trace-reader-utils.ts Safely narrows and propagates runner metadata from standalone trace context events.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Test framework command] --> B[Adapter interception]
  B --> C[Core command and snapshot capture]
  C --> D[Page collector and DOM mutations]
  C --> E[Trace exporter]
  D --> E
  E --> F[Backend trace reader]
  F --> G[Replay UI]
  G --> H[DOM, accessibility tree, overlays, and locator hints]
Loading

Reviews (1): Last reviewed commit: "docs: correct the click-activation attri..." | Re-trigger Greptile

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.

1 participant