microsoft / microsoft/playwright

[CLI]: Generate an offline HTML report from a CLI session (trace + video + screenshot)

Open
#42,755 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
96.3k
Forks
6.5k
Avg merge
1d 6h
Merged PRs (30d)
180

Description

### 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/cli@0.1.20`):
- `playwright-cli --help` has `tracing-start` / `tracing-stop`, `video-start` / `video-stop`, and `show`
- There is no `html-report`, `show-report`, or similar
- `tracing-stop --help` and `video-stop --help` only stop recording; they do not emit a report
- `show --help` is 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 with `npx playwright show-trace` (Trace Viewer)
- https://playwright.dev/agent-cli/commands/video-recording — save a `.webm`
- https://playwright.dev/agent-cli/sessions — `playwright-cli show` is a live dashboard for running browsers
- https://playwright.dev/docs/test-reporters — HTML reporter / `npx playwright show-report` are 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):
1. `tracing-start` before navigating (CLI `video-start` letterboxes if tracing already owns the screencast)
2. Zip the whole traces dir, including `screencast/*.jpeg`
3. Rebuild `session.webm` from those JPEGs (Playwright ffmpeg often has no image2 glob demuxer)
4. Create a throwaway `@playwright/test` project, attach `trace.zip` / `session.webm` / screenshot on a dummy test, run it with the HTML reporter
5. `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 show` dashboard

### Version

@playwright/cli@0.1.20

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the CLI tracing-start/tracing-stop and video-start/video-stop command implementations, then compare them with the Playwright Test HTML reporter and show-report flow. Define how a CLI session should package its trace, video, and screenshot attachments into a self-contained offline report; done means the report can be opened after the browser and daemon are gone without a dummy test project.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.