[CLI]: Generate an offline HTML report from a CLI session (trace + video + screenshot)
What's going on?
Feature request: Playwright CLI can record traces and video, but it has no command to wrap a session into a self-contained offline HTML report (the Playwright Test HTML reporter UI with Trace / Videos / screenshot attachments).
What we ran (@playwright/[email protected]):
playwright-cli --helphastracing-start/tracing-stop,video-start/video-stop, andshow- There is no
html-report,show-report, or similar tracing-stop --helpandvideo-stop --helponly stop recording; they do not emit a reportshow --helpis the live session dashboard (--port/--host/--annotate), not an offline report
What the docs point to:
- https://playwright.dev/agent-cli/commands/tracing — after
tracing-stop, view withnpx playwright show-trace(Trace Viewer) - https://playwright.dev/agent-cli/commands/video-recording — save a
.webm - https://playwright.dev/agent-cli/sessions —
playwright-cli showis a live dashboard for running browsers - https://playwright.dev/docs/test-reporters — HTML reporter /
npx playwright show-reportare Playwright Test, not agent-cli
What we expected:
Something like playwright-cli report (or tracing-stop --html) that writes a Test-style HTML report from the current CLI session: trace zip (including screencast JPEGs), video, screenshot, then a local show-report page we can keep after the browser/daemon is gone.
What we do today (workaround):
tracing-startbefore navigating (CLIvideo-startletterboxes if tracing already owns the screencast)- Zip the whole traces dir, including
screencast/*.jpeg - Rebuild
session.webmfrom those JPEGs (Playwright ffmpeg often has no image2 glob demuxer) - Create a throwaway
@playwright/testproject, attachtrace.zip/session.webm/ screenshot on a dummy test, run it with the HTML reporter npx playwright show-report
That works, but it is a Test-runner hack for a CLI session. Coding agents want one offline page to hand a human after a verify, without spinning up a dummy test project or keeping the CLI daemon alive.
Not requesting:
- Replacing Trace Viewer (
show-trace) - Changing the live
playwright-cli showdashboard
Version
@playwright/[email protected]
Source: microsoft/playwright