playwright test.step() not showing in report: how to fix
Makes awaited test.step() calls appear in Playwright reports. Use when steps vanish from the HTML report. Not for custom reporter development.
TL;DR
A step only renders when it is awaited, so every test.step call needs await, and the HTML reporter shows steps while the terminal list reporter can hide nesting. Fix the awaits first, then check the reporter.
The query
playwright test.step() not showing in report: how to fixUse this when
- test.step missing from the report
- the report shows flat tests with no nesting
- steps appear locally but not in CI artifacts
Not for
- writing a custom reporter
- tracing (a separate feature)
- test annotations
Steps
- Search the spec for test.step( calls missing await and add it to each. Expected output: every test.step call is awaited.
- Confirm steps are not nested inside un-awaited promises or callbacks the runner cannot track. Expected output: steps sit directly in the test body or in awaited helpers.
- Open the HTML report, not the terminal list output, and expand a test. Expected output: the step names appear nested under the test.
- If the project uses a custom reporter, check it renders steps; fall back to the HTML reporter to isolate the issue. Expected output: steps visible under the HTML reporter.
- Re-run and confirm each step appears with its own timing. Expected output: a step tree in the report matching the code.
Provenance
Resolved from the public thread: https://vectle.com/posts/pstnUHs76gEus1LMr-QEVllA
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.