Repository navigation
test(conformance): run each adapter's scenario through its own test runner - #465
Merged
Merged
Conversation
…unner The scenario was one short login in a single test, and Selenium and Python ran it as a plain script, so element waits, failing tests, test boundaries and hook registration under a runner were never exercised. Each adapter now runs five tests through its real runner (WDIO, the Nightwatch CLI, mocha with --require, pytest): a login that waits for a late-rendered element and asserts on its text; a test that waits on a condition reading two elements and on a helper repeating the test's own read; a failing assertion; a wait that times out; and the refused navigation. Each runner must exit with its own code for two failed tests, and tests-end-as-designed checks every test's reported state. The comparison aligns steps within each test by their longest common sequence, reports a step shown at a different place as one move, and reads a failed row through shared's commandFailure, the rule the trace exporter uses. Gaps are scoped by a message matcher that names the holder's own side; a declared lack goes stale once the adapter shows any step in its place or nothing it is compared with shows the step, and a gap matched against an adapter that did not run is not judged. replace-targets-a-sent-row locates a row the way the dashboard does, and the report reads a run that exits as designed as passing. New gaps record what the scenario exposed, each with a Known debt entry: Nightwatch moving an awaited wait (#457), overwriting a same-millisecond row (#458) and reporting passing tests without assertions skipped (#459); Python's invisible waits (#461) and untargeted assertions (#462); and the waits the adapters show differently (#464). Closes #455
Contributor
[Medium impact] The PR appears safe to merge with the verified fixes in dependent PR #466. SummaryRuns each adapter’s five-test scenario through its own test runner.
The previous moved-step finding is fixed in the current code. This assessment depends on PR #466 for the missing Nightwatch wait-order gaps and additional checks that failed tests contain failed action rows. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
Harness[Conformance harness] --> Runner[Adapter test runner]
Runner --> Fake[Fake WebDriver]
Runner --> Frames[Recorded frames]
Frames --> States[Check test states]
Frames --> Normalize[Group steps by test]
Normalize --> Compare[Compare aligned and moved steps]
States --> Gaps[Apply scoped known gaps]
Compare --> Gaps
Gaps --> Report[Conformance report]
Reviews (4) · Last reviewed commit: "test(conformance): drop the Nightwatch w..." · Reviewed by Greptile |
…c-scenarios Main gave Nightwatch Run all, so the Nightwatch run-controls gap and the lacksRunControls field that existed only to scope it are gone. The capability matrix's coverage check now requires every rule to back a feature or be internal; tests-end-as-designed is internal, a precondition of every per-test view rather than a feature.
4 of 18 tasks
A step both adapters show at different places was taken out of the alignment as a move and only its position was reported, so a moved step that failed, replayed the wrong page or typed different text went unchecked, and a gap scoped to the move hid it. Keep each move's two steps paired and compare them like any aligned pair, so a move excuses where the step stands and nothing else.
An awaited Nightwatch wait ran after the commands that followed it because the plugin's performance read, a queued browser.execute fired from a timer, became a child of the running command and resolved its await early. With that read off the queue the wait keeps its place in every run and the login test passes, so both gaps went stale. The tests that used the gap to exercise a move scoped to one place now build that gap themselves.
2 of 17 tasks
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 #455
Stacked on #453 (base
fix/selenium-rows-after-wait): the Selenium scenario relies on #453's mocha root hooks and failed-wait row. Retarget tomainonce #453 merges.The conformance scenario was one short login in a single test, and Selenium and Python ran it as a plain script. Element waits, failing tests, test boundaries and hook registration under a real runner were never exercised, which is where the bugs fixed in #453 lived. Each adapter now runs five equivalent tests through its own runner:
--require @wdio/selenium-devtools--devtoolsChecks that come with it
tests-end-as-designedrule checks every test's reported state, so a crash, a usage error or a should-pass test failing breaks the suite.shared/src/command-failure.ts(moved from the trace exporter, behaviour unchanged) is used by both the trace exporter and the comparison.known-debt.test.tsenforces it.replace-targets-a-sent-rowlocates a row the way the dashboard does (sharedreplaceCommandIndex).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
shared/tracechange only moves the failed-row predicate (commandFailure) intoshared; the trace exporter's behaviour is unchanged and both packages are private and inlined, so no changeset. The rest ispackages/conformance(private), CI (selenium-devtools-py[test]for pytest) and docs.Notes for reviewers
Adapter bugs the scenarios exposed (recorded as narrowly scoped gaps with Known debt entries, not fixed here):
waitForElementPresentreturns before the wait runs when the plugin is loaded (15 of 15 runs).WebDriverWaitleaves no row. Python: assertion rows carry no element target #462 Python: assertion rows carry no element target.Proof that the suite guards #453: with #453's latest commit reverse-applied, the Selenium scenario reports the merged condition-wait reads as an unexplained divergence. The full run with all of #453 reverted is posted below once #454 is stacked.
Two gaps are timing-dependent (Nightwatch's "logs in" reported failed under #457, and the #458 overwrite), so they are never reported stale and must be removed by hand when those issues are fixed; docs say so.
Checks:
pnpm test2884 passed, the conformance file passed 3 of 3 runs,pnpm typecheckclean,pnpm lint0 errors.Screenshots / recordings
n/a (no UI change)
🤖 Generated with Claude Code