Skip to content

Dialog failure walkthrough ​

The escaping-focus synthetic dialog disables containment while preserving opening and initial focus. The native Forward containment boundary step fails when Tab moves from Cancel to the After dialog button instead of Continue.

Reproduce in the quickstart project:

sh
npm test -- --grep "dialog escaping-focus"

The attempt's actual status is failed; expected status is failed because the demonstration uses test.fail(). The command may exit 0. The repository verifier additionally rejects unrelated failures or an unexpected pass.

Native diagnostic ​

This excerpt retains the native expected/received meaning. ANSI formatting, repeated call log, source excerpt and machine-local stack paths were omitted. It is an edited excerpt, not the complete report.

txt
Error: Forward containment: focus returns to Continue

expect(locator).toBeFocused() failed

Locator:  getByRole('button', { name: 'Continue', exact: true })
Expected: focused
Received: inactive
Timeout:  1000ms

The source is the Forward containment boundary assertion in dialog.ts. Activation, semantics, initial focus and the first movement to Cancel passed. Backward containment, Escape and restoration were not executed after the hard failure.

Observed focus ​

All observations from this attempt are transcribed below using the report's sequence notation. The final record identifies button#after. Transient body focus records remain visible; browser order is separate from native step order and does not prove causation.

txt
1 focus e1 body {}
2 key Tab e1 body {}
3 focus e2 button {"id":"opener"}
4 key Enter e2 button {"id":"opener"}
5 focus e3 button {"id":"continue"}
6 key Tab e3 button {"id":"continue"}
7 focus e1 body {}
8 focus e4 button {"id":"cancel"}
9 key Tab e4 button {"id":"cancel"}
10 focus e1 body {}
11 focus e5 button {"id":"after"}

Failure artifacts ​

Synthetic Preferences dialog remains open at teardown, with Continue and Cancel over the page and the After dialog button outside it.

The screenshot shows teardown state, not necessarily the exact assertion instant. The scoped ARIA snapshot contains the declared dialog; it excludes the outside button even though the observer saw focus there. Neither screenshot nor snapshot alone establishes containment.

txt
- dialog "Preferences":
  - heading "Preferences" [level=1]
  - paragraph: Synthetic settings; no personal data.
  - button "Continue"
  - button "Cancel"
txt
actual: failed
expected: failed
phase: fixture-teardown
observation complete within supported scope: true
truncated: false
screenshot: captured
  start: 2026-11-02T23:52:36.561Z
  finish: 2026-11-02T23:52:36.576Z
ariaSnapshot: captured
  start: 2026-11-02T23:52:36.576Z
  finish: 2026-11-02T23:52:36.585Z

These captures were taken during fixture-teardown, after the assertion failed. The screenshot and ARIA text are unmodified synthetic artifacts. Capture metadata omits internal file paths. “Complete” applies only to the supported observed scope; it does not mean the journey passed or all possible checks ran.

Provenance and next step ​

Generated on 2026-11-02 UTC (2026-11-03 in the author's local timezone) against npm 0.1.0, Node 24.21.0, Playwright 1.64.1 and Chromium 156.0.8078.4 on macOS arm64. The fixture/journey derive from released v0.1.0 sources. Local author verification; external validation pending.

Fix the application's containment policy, then rerun the native journey. Review a newly generated whole bundle for current evidence. Read evidence limitations before interpreting or sharing it.

Experimental v0.1.0 · External validation pending