Skip to content

fix(nightwatch): open the dashboard over WebDriver, not the devtools protocol - #423

Merged
vishnuv688 merged 1 commit into
mainfrom
fix/nightwatch-dashboard-without-devtools-protocol
Oct 7, 2026
Merged

vishnuv688 merged 1 commit into
mainfrom
fix/nightwatch-dashboard-without-devtools-protocol

Conversation

@vishnuv688

Copy link
Copy Markdown
Member

What & why

Same fix as #422, for the Nightwatch adapter.

The plugin opened the live-mode dashboard window with remote({ automationProtocol: 'devtools' }). That protocol is implemented by the devtools package, so @wdio/nightwatch-devtools declared devtools ^8.42.0 as a peer, and npm installed it together with puppeteer-core@21 into every Nightwatch project. When it was not installed, the dashboard failed to open (Couldn't find automation protocol "devtools") and the plugin fell back to logging "Please manually open" the URL.

The dashboard now opens over WebDriver, through the same chromedriver the test sessions already use, and devtools is no longer a peer:

  • run-lifecycle.ts: drop automationProtocol: 'devtools'; hide the "controlled by automated test software" bar with chromedriver's excludeSwitches: ['enable-automation'] instead of the Puppeteer-only wdio:devtoolsOptions.ignoreDefaultArgs (which also removes the capability-type assertion that existed only for it); quiet and restore the webdriver logger instead of devtools while waiting for the window to close.
  • package.json: remove the devtools peer. The lockfile change is only that importer entry.
  • tests/runLifecycle.test.ts: new. Nothing covered the dashboard launch before. One test asserts the launch options (no automationProtocol, excludeSwitches set, per-run --user-data-dir kept); the other asserts a launch failure leaves the run going. The first fails against main.
  • Changeset: patch for @wdio/nightwatch-devtools.

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)
  • selenium-devtools-py (Selenium Python adapter)
  • backend (server)
  • app (UI)
  • script (page-injected runtime)
  • trace (Trace mode)

Notes for reviewers

  • Why not in core: the two adapters' launches differ in their capabilities (Nightwatch keeps a per-run --user-data-dir and its own close-wait loop with signal handling), and the shared part is now a single remote({ capabilities }) call. Each PR touches one adapter.
  • Verified manually, which CI cannot do (it needs a real browser): DEVTOOLS_MODE=live pnpm demo:nightwatch opens the dashboard with no automation bar, no devtools:puppeteer lines are logged, and closing the window ends the run. The example runs in trace mode by default, which never opens the dashboard, so DEVTOOLS_MODE=live is needed to exercise this path.
  • Lockfile: as in fix(service): open the dashboard over WebDriver, not the devtools protocol #422, only the three-line devtools entry under packages/nightwatch-devtools is removed rather than letting pnpm re-resolve unrelated peers. pnpm install --frozen-lockfile passes. The devtools@8.42.0 package entries stay until both PRs are merged; a plain pnpm install afterwards prunes them.

pnpm build, pnpm test (2501 passed), pnpm typecheck and pnpm lint (0 errors) are green locally.

Screenshots / recordings

Not a UI change. The dashboard window looks the same as before; only how it is launched changed.

…protocol

automationProtocol 'devtools' needs the devtools package, so the plugin
declared devtools ^8.42.0 as a peer and npm installed it, plus an old
Puppeteer, into every project; without it the dashboard window failed
to open. chromedriver is already resolved for the test sessions, so the
dashboard uses it too. Same change as the WDIO service launcher.
@greptile-apps

greptile-apps Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Changes how the devtools dashboard window opens.

The PR appears safe to merge; no actionable issues were found.

Summary

The Nightwatch adapter now opens the live dashboard over WebDriver instead of the devtools protocol.

  • Keeps the separate Chrome profile and hides the automation bar through excludeSwitches.
  • Removes the devtools peer and its lockfile importer entry.
  • Adds tests for launch options and launch failure.
  • No actionable issues were found.

Diagram

sequenceDiagram
  participant Plugin as Nightwatch plugin
  participant WDIO as WebdriverIO
  participant Chrome as Dashboard browser
  Plugin->>WDIO: remote with Chrome capabilities
  WDIO->>Chrome: Open WebDriver session
  Plugin->>Chrome: Navigate to dashboard URL
  loop Until window closes
    Plugin->>Chrome: getTitle
  end
  Plugin->>WDIO: deleteSession
  Plugin->>Plugin: Stop backend and exit
Loading

Reviews (1) · Last reviewed commit: "fix(nightwatch): open the dashboard over..." · Reviewed by Greptile

@vishnuv688
vishnuv688 merged commit 2468160 into main Oct 7, 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.

1 participant