Skip to content

ci: smoke-run each adapter's desktop example against a local fixture site - #463

Merged
vishnuv688 merged 7 commits into
mainfrom
ci/456-examples-smoke
Oct 27, 2026
Merged

vishnuv688 merged 7 commits into
mainfrom
ci/456-examples-smoke

Conversation

@vishnuv688

@vishnuv688 vishnuv688 commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

What & why

Closes #456

Stacked on #453 (base fix/selenium-rows-after-wait): the Selenium example's failed-wait check needs #453's wait row. Retarget to main once #453 merges.

CI never runs examples/: they need a real browser and they drive live third-party pages. When example.com stopped serving an <h1>, the Selenium mocha example's element wait timed out and the tests after it silently produced no rows; it went unnoticed for weeks and was first read as a capture regression (#453). This adds a CI job that runs each adapter's desktop example against a local copy of the pages and checks the trace it writes.

  • Fixture site (packages/conformance/smoke/fixture-site.ts): a dependency-free Node server copying the-internet's login flow (/, /login, the form POST, /secure, /logout) with the same selectors, titles and messages. Bound to 127.0.0.1, it serves no files.
  • Base URL switch: every desktop login example reads DEVTOOLS_EXAMPLE_BASE_URL and defaults to the public site, so manual runs are unchanged. The Selenium mocha example moves from example.com to the-internet like the others.
  • Trace checker (pnpm smoke:assert): reads every trace-*.zip an example wrote and checks it against a per-example expectation file (packages/conformance/smoke/expectations/). It checks:
    • the rows under each test's own group (or the whole run where the runner gives no per-test groups, as for Nightwatch BDD, with the reason stated in the file);
    • an error row on each deliberately failing test, and none on passing ones;
    • the run's exit code;
    • no wait timeout in stdout or the run log, in any runner's wording (selenium-webdriver, Nightwatch, WDIO, Python selenium); only a per-test entry can mark its own timeout as expected;
    • every row's call site points into the example's own files, never an adapter package or a dependency, and every row of a per-test entry carries one.
  • Selenium failed wait: the Selenium mocha example gains a test that waits 1 s for an element no page renders; its expectation asks for a Browser.waitForFunction row naming the condition and an error matching "Wait timed out".
  • examples-smoke job in ci.yml: builds, installs the Python adapter, starts the fixture site, runs WDIO mocha, Selenium mocha, Nightwatch BDD and Python pytest once each in trace mode with headless Chrome, checks each zip, and uploads the zips and logs on failure. Actions are pinned by SHA like the other jobs.

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)

The tooling lives in the private packages/conformance (under smoke/) so it is linted, typechecked and unit-tested; the rest is examples/, CI and docs. No published package changes, so no changeset.

Notes for reviewers

  • Draft until its first CI run. No example was run in a browser locally, so the expectation files (row labels, Nightwatch counts, the pytest group titles, exit codes) get their first real check here. Expect to tune one or two from that run; a mismatch prints the rows and group titles the trace actually had.
  • Checks: pnpm test 2902 passed (60 new tests for the fixture site and the checker, run against zips written by the real trace exporter), pnpm lint 0 errors, pnpm typecheck clean, actionlint and shellcheck clean, and the fixture site checked with curl.

Screenshots / recordings

n/a (no UI change)

🤖 Generated with Claude Code

…site

The examples drive live third-party pages, so a site change can silently stop
an example producing rows (example.com dropping its <h1> went unnoticed for
weeks). A new examples-smoke job serves a local copy of the-internet's login
flow, runs WDIO mocha, Selenium mocha, Nightwatch BDD and Python pytest in
trace mode with headless Chrome, and checks each trace zip against a per-example
expectation file: the rows under each test's own group (or the whole run where
the runner gives no per-test groups), an error row on each deliberately failing
test, the run's exit code, and no wait timeout in any runner's wording in
stdout or the run log.

Every desktop login example now reads DEVTOOLS_EXAMPLE_BASE_URL and defaults
to the public site, so manual runs are unchanged. The Selenium mocha example
moves from example.com to the-internet like the others. The fixture site and
the checker live in packages/conformance/smoke so they are linted, typechecked
and unit-tested.

Closes #456
… smoke job

The Selenium mocha example gains a test that waits 1 s for an element no page
renders, so the smoke run covers the failed `wait` row: its expectation asks
for a Browser.waitForFunction row naming the condition and an error matching
"Wait timed out". Only a test-scoped entry can mark its timeout as expected,
and only the lines of that test's own error rows are then exempt from the
run-wide timeout check; a run-scoped entry carrying the flag is rejected.

The checker also reads each row's call site from the trace's stack frame.
Every row of a test-scoped entry must carry one and a run-scoped entry needs
at least one, since a row losing its call site is the regression that matters,
and every call site must point into the example's own files (sourceFiles in
each expectation file), never into an adapter package or a dependency.

Refs #456
@vishnuv688
vishnuv688 force-pushed the ci/456-examples-smoke branch from 5457f24 to 5e2a7d9 Compare October 27, 2026 09:15
@vishnuv688
vishnuv688 changed the base branch from main to fix/selenium-rows-after-wait October 27, 2026 09:15
@vishnuv688
vishnuv688 marked this pull request as ready for review October 27, 2026 10:38
@greptile-apps

greptile-apps Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable defect was established.

Summary

Adds a CI smoke job that runs one desktop example per adapter against a local login site.

  • The smoke checker compares each example’s trace with its expected steps.
  • CI runs four desktop examples and checks the traces they write.
  • Desktop login examples can use the local fixture site.
  • The Selenium example records a failed wait for a missing page element.

No new actionable issues were found. Browser runs were not performed during this review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Fixture[Local fixture site] --> Examples[Four desktop examples]
  Examples --> Archives[Trace archives and run logs]
  Archives --> Checker[Per-example checks]
  Checker --> Result[CI pass or failure]
Loading

Reviews (4) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

…to ci/456-examples-smoke

# Conflicts:
#	CLAUDE.md
…per test

A retried test can now declare `attempts`: the checker requires that
many attempts and reads rows and errors from the last one only, so a
failing final attempt no longer passes on the strength of an earlier
one, as the Selenium flaky test could with a nonzero exit accepted.

The Nightwatch expectations are per test: the trace groups every row
under its own it(), so the run-scoped fallback checked less than the
trace allows.
@vishnuv688
vishnuv688 changed the base branch from fix/selenium-rows-after-wait to main October 27, 2026 19:20
@vishnuv688 vishnuv688 self-assigned this Oct 27, 2026
# Conflicts:
#	packages/conformance/package.json
#	pnpm-lock.yaml
@vishnuv688
vishnuv688 merged commit 96767ba into main Oct 27, 2026
12 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.

CI smoke job for the examples against locally served pages

1 participant