Repository navigation
feat(conformance): generate the adapter capability matrix from one declared source - #448
Merged
Merged
Conversation
…clared source Three hand-maintained tables disagreed and two had no Python column, because a markdown table cannot notice that a fourth adapter exists. Capabilities are now declared once with a cell per adapter id, a required reason for every partial or unsupported cell, and conformance rules behind every cell marked tested. Every user-facing option of the four adapters, Python's DEVTOOLS_* variables included, and every conformance rule must map to a capability row or say why it is not one, so a new option, rule or adapter cannot skip the matrix. The README tables render from it and a test fails when they are stale.
Contributor
[Medium impact] The PR appears safe to merge; the latest Nightwatch lookup change fixes the remaining reported failure. SummaryThe PR generates adapter capability tables from one feature list and preserves the original selection for Run all.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Dashboard rerun or Run all] --> B{Existing binary override?}
B -->|Yes| C[Use override]
B -->|No| D[Search config directory and parents]
D --> E{Nightwatch found?}
E -->|Yes| F[Use found binary]
E -->|No| G[Search launch directory and parents]
G --> H{Nightwatch found?}
H -->|Yes| F
H -->|No| I[Report missing binary]
C --> J[Spawn from launch directory]
F --> J
Reviews (9) · Last reviewed commit: "fix(backend): fall back to the launch di..." · Reviewed by Greptile |
Their rules check a precondition (metadata ahead of the first command, a command behind every offered run control), not the tab's content or that Run, Rerun and Run all work, so a tested mark promised more than the suite proves.
…checked evidence Contributors look for the feature list at the repo root, so the declaration moves to features.ts and the conformance package keeps the helpers, loading, validation and rendering. Every supported cell names how it is known to hold: conformance rules, a test file in that adapter's or a shared package's tests, or how to check it by hand. Per-adapter checks against the code corrected cells that overstated support (WDIO hybrid webview, Selenium run controls, Nightwatch assertions) and reasons that were wrong (Nightwatch Run all and per-test slicing, Python trace format), and test links that did not assert their feature now name one that does or a manual check. `pnpm docs:capabilities --parity` lists every feature some adapter lacks, with its reason.
…ackage At the repo root it needed a .gitignore exception, a lint script reaching outside its package and ../../../ imports both ways; beside its helpers, types and validators it needs none, and CONTRIBUTING.md and the PR template still point contributors at it.
path.normalize turns repo-relative evidence paths into backslashes on Windows, so none matched the forward-slash test folders and every test-file cell was rejected there.
…was launched with The adapter and shared defaults refused Run all although the backend already relaunches a Nightwatch config. The run that starts the backend records its CLI selection, parsed as Nightwatch's minimist does so flag values are never rewritten as paths, or clears a stale one; the backend replays it through runAllFilters. The run-controls gap and its machinery leave the conformance suite.
…npx fallback A rerun's process is launched with a name filter, so deriving Run all from its own argv replayed that filter; it now inherits the parent's command. npx and pnpm exec report npm_command=exec, so they fall back to argv, which is now shell-quoted so a path or filter with a space survives the backend's parse.
…ark the Cucumber step rerun limit The notice and legend now point website readers at the devtools repo, the mobile rows render on the mobile pages only, and Run all's shared Cucumber step limit shows on each adapter that runs Cucumber.
4 of 16 tasks
…h was launched in The backend spawns a Nightwatch rerun from the config's folder, so a relative path inside a flag (`--test tests/a.js`) resolved against the wrong directory; the run that starts the backend now records its launch directory, which the backend already honours. The explorer component tests take an explicit no-Run-all runner, since Nightwatch now has one.
…rom the launch directory Spawning from the launch directory also moved the binary search there, so a Nightwatch installed beside a nested config (e2e/node_modules) was never found and reruns failed; the search starts beside the config again.
…twatch Searching only from the config's folder missed a Nightwatch installed below a shared config (launched from /repo/e2e with --config ../nightwatch.conf.js); the search now tries the config's folder, then the launch directory.
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
Closes #402
The adapter capability tables were maintained by hand in three places (the README,
CrossFrameworkSupport.mdandMobileTesting.mdon the docs site). They disagreed with each other, and two of them had no Python column, because a markdown table cannot notice that a fourth adapter exists.The matrix is now an output.
packages/conformance/src/features.tslists every user-facing feature once, with a cell for each of the four adapters (WebdriverIO, Selenium, Nightwatch, Python), andpnpm docs:capabilitiesrenders the tables from it. The conformance package holds the helpers, validation and rendering.CLAUDE.md.enable()keywords, pytest options andDEVTOOLS_*variables (checked by a test that parses the source with Python'sast).pnpm docs:capabilities --paritylists every feature some adapter lacks, with the reason, and counts cells by evidence kind.pnpm docs:capabilitiesrewrites the content between<!-- capability-matrix:<table>:start -->and:end -->markers. The README now holds three generated tables: trace mode, live dashboard and mobile.--checkwrites nothing and exits 1 when anything is stale, and a test runs it against the README.--website <checkout>also rewrites the two docs-site pages; it checks every target first and writes nothing when a page is missing its markers.The list has 33 features. Each adapter's cells were checked against its code by a separate pass, and every test link was audited; links that did not assert their feature now name one that does or a manual check. Today: 18 of 33 features are not supported by every adapter; of 132 cells, 12 are conformance-tested, 57 unit-tested, 22 checked by hand and 41 partial or unsupported. Correcting the old tables along the way:
expect()produce no rows), Seleniumheadlessis Chrome only, and Selenium Run all can narrow to a rerun's filter.canRunAll: false(the backend already supports it, so the conformance gap's reason is corrected too); only Cucumber gets per-test slices; theexpectAPI is not captured.switchContext('WEBVIEW_...'). Screencast push is Chromium only for every adapter.The PR template gains a feature-list checkbox, CONTRIBUTING.md an "Adding a feature" section, and
CLAUDE.mddocuments the command and both coverage checks. Two comment-only fixes ride along in published packages (Selenium'sheadlessdocstring, the service's Cucumber nesting comment), so no changeset.Run all for Nightwatch and Selenium
The per-adapter checks found Run all broken in two adapters, fixed here because the matrix would otherwise declare the gap rather than close it:
canRunAll: falsealthough the backend already relaunches a Nightwatch config. Run all is now on and replays the selection the run was launched with (spec paths made absolute, flag values such as--tag smokekept as typed, a stale selection cleared). The value is recorded by the run that starts the backend, encoded once inshared, and replayed byrunAllFiltersinframework-filters.ts. A rerun child attaches to that backend and cannot narrow it. The conformance suite's Nightwatch run-controls gap, and the gap machinery only it used, are removed.npxandpnpm exec(npm_command=exec) it no longer publishesnpm run npx, and the argv fallback is shell-quoted so a path or filter with a space survives.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)selenium-devtools-py(Selenium Python adapter)backend(server)app(UI)script(page-injected runtime)trace(Trace mode)The code lives in
packages/conformance, which is private and test-only, beside the adapter ids and rules it uses. It imports only the adapters' option types. Changesets: patch for@wdio/nightwatch-devtools,@wdio/devtools-backendand@wdio/devtools-app(Nightwatch Run all), and for@wdio/selenium-devtools(launch command).Notes for reviewers
packages/conformance/src:features.ts(the list alone), cell builders and the one "tested" predicate incapability-helpers.ts, validation incapability-validation.ts, option maps incapability-options.ts, rendering inrender-capabilities.ts, the CLI incapability-matrix.ts.adapters-agree-*comparisons, which judge adapters against each other rather than any one adapter.DevToolsOptionsfailedpnpm typecheck, and adding a keyword to Python'senable()failed the coverage test. Both were reverted.CrossFrameworkSupport.mdthat says Python is not in the table. Dry-run against a copy of the docs, the generator renders all 33 rows on that page and the 6 mobile rows onMobileTesting.md.sendUpstreaminstead of a replace); a stale Python docstring.npx nightwatch -c ../../examples/nightwatch/nightwatch.conf.cjs ../../examples/nightwatch/bdd/smoke-test.jsfrompackages/nightwatch-devtools),pnpm demo:nightwatch, the Nightwatch Cucumber example,pnpm --filter @wdio/selenium-devtools example:mochawith a rerun then Run all, and Selenium undernpx mocha.pnpm test: 2867 passed.pnpm lint: 0 errors and no new warnings.pnpm typecheck,pnpm buildandpnpm docs:capabilities --checkare clean.Screenshots / recordings
n/a (no UI change)
🤖 Generated with Claude Code