
A11y Journey Evidence
Experimental v0.1.0 tooling for reviewable keyboard and focus evidence in native Playwright Test journeys, with bounded observations, failure captures, and portable Markdown bundles.
Type: Experiment
Status: In progress
Date: 11/4/2026
- TypeScript
- Node.js
- Playwright Test
Overview
A11y Journey Evidence adds reviewable keyboard and focus evidence to native Playwright Test journeys. Published on npm as a11y-journey-evidence, experimental v0.1.0 combines an opt-in fixture and reporter with runnable synthetic examples.
It is intended for developers and test authors who already use Playwright and want to review what happened during an explicitly tested keyboard interaction. Developers continue to choose their actions, assertions and expected behavior. The package records observations around those tests and presents them alongside native diagnostics; it does not decide the correct focus policy or establish accessibility conformance.
Motivation
A failed focus assertion identifies an unmet expectation, but reviewing the path to that failure can require moving between the test, attachments and trace. For a dialog, that path might include opening it, moving between controls, reaching a containment boundary and returning focus after dismissal. A form adds error associations, invalid-submit focus and correction.
Playwright already provides keyboard actions, focus assertions, reporters, screenshots and traces. The question behind this project is how an explicit observed focus sequence and a portable text report can support review alongside those facilities. Keeping the original test vocabulary matters: the evidence should remain connected to the behavior the developer actually checked, with limitations visible when recording or capture is incomplete.
Approach
The TypeScript and Node.js implementation integrates through a test fixture and a reporter. Existing fixtures compose with Playwright's native mergeTests; the evidence reporter sits beside native reporters. After page setup, a selected test calls journey.start({ root }) once with a native Locator declaring the ARIA snapshot scope.
The journey then uses ordinary page.keyboard actions, locators, test.step and expect. There is no replacement action language to learn or separate assertion policy inferred from the observations. Tests that do not request the fixture keep their native reporting without journey observations. A requested fixture that never starts is disclosed as not started.
The declared snapshot root may mount later, but an ambiguous locator is never silently reduced to its first match. A missing root does not broaden capture to the whole document. This keeps capture scope explicit, while unavailable captures remain reportable outcomes.
The integration guide explains composition and reporter configuration. The published npm distribution provides the compiled package; GitHub's automatic source archives are repository snapshots rather than that distribution.
Key Features
- Bounded observations: Records selected keyboard events and focus descriptors in observed browser order. Limits and clipping are disclosed. Descriptors use local references and bounded attributes, not a continuously synchronized model of accessible names or DOM state.
- Native test context: Retains executed named steps and assertions, actual and expected status, and distinct attempts, retries and repeats. A later passing retry does not erase an earlier failed attempt. Browser observations and native step starts have separate sequences; they do not establish a shared clock, total order or causation.
- Failure captures: Independently configurable screenshots and scoped ARIA snapshots are attempted at fixture teardown when available. They are not guaranteed snapshots of the instant an assertion failed. An already hidden dialog can produce an empty snapshot; missing roots, closed pages and capture failures remain explicit.
- Portable Markdown bundles: A
report.mdentry point links relative assets and existing native traces when available. The package does not start another trace session. Share the whole run directory, includingassets, so those links remain usable. - Visible completeness: A passing test can have incomplete evidence. Unavailable artifacts, truncated observations and recording issues stay separate from native test outcomes. Handoff, artifact-copy and report-write failures are surfaced rather than silently producing an apparently successful evidence run.
The bundle-reading guide explains these distinctions before readers interpret a report.
Dialog and Form Examples
The dialog recipe declares a concrete policy: keyboard activation opens Preferences, initial focus reaches Continue, Tab and Shift+Tab wrap at both boundaries, Escape dismisses the dialog, and focus returns to the opener. Its correct case exercises that policy. Two intentional regressions independently omit containment or restoration, exposing focus escaping beyond the dialog or failing to return after dismissal.
The form recipe uses a synthetic Team request form with submit-only validation. Keyboard submission reveals inline errors, marks invalid fields, associates each error through aria-describedby and focuses the first invalid field. Correction and resubmission clear stale states and references, then expose success. Broken variants omit an error association or the focus movement. Native accessible-description assertions inspect the chosen DOM association; they do not establish that a screen reader announces the error.
The regressions use Playwright's expected-failure mechanism. Their demonstration commands can exit successfully while the intended assertions actually fail; an unexpected pass fails the run. A hard assertion failure stops subsequent checks, so earlier passing checks do not supply results for the unexecuted remainder. These are explicit example policies, not general certification of dialogs or forms.
Comparison with Stock Playwright
The author's comparison runs equivalent synthetic variants with the same native actions, locators, named steps and assertions. The stock baseline uses Playwright's reporters and traces plus an application-owned failure hook attaching current focus, a screenshot, scoped ARIA and timing. It can already answer the review questions demonstrated by those examples.
The package contributes a bounded observed focus sequence and a portable Markdown entry point alongside native diagnostics. It also adds a dependency, exact-version integration, maintenance and data-handling obligations. Stock retains ownership of a small capture helper and its configuration; native HTML reports and traces may suit some investigations better. Long text reports and repeated diagnostics also have review costs. This is an author assessment: no independent preference, endorsement or measured time saving has been established.
Current Limits and Validation
The verified package scope is Chromium, one page/main document, ordinary light DOM and the explicit journey under test. Frames, additional pages, shadow traversal, navigation or document replacement, nested dialogs, other patterns and other browsers are outside that scope. Identifiable unsupported boundaries are disclosed; exhaustive detection is not promised. Custom matcher internals are not interpreted.
The documented local baseline uses Node 24.21.0, npm 11.19.0, TypeScript 7.0.2, Playwright Test 1.64.1, Chromium 156.0.8078.4 and macOS 27.0.1 arm64. Node and the Playwright peer are declared at those exact versions. Other hosts, runtimes, browsers and package CI compatibility remain unverified. These are published project records, not package checks rerun for this portfolio page; documentation-site checks do not broaden package compatibility.
Printable-input filtering is not general sanitization. Attributes, diagnostics, screenshots, ARIA snapshots and traces can contain application data. Use synthetic data and inspect the whole bundle before sharing. The full limitations also explain why DOM focus, ARIA structure and captures do not establish screen-reader announcements, focus-indicator quality, inclusive usability, complete keyboard coverage or accessibility conformance.