ScreenshotNeo

BlogHow-to

How to Run the Playwright Show Report Command

Run, configure, and troubleshoot Playwright’s show-report command, including custom folders, ports, hosts, ZIP archives, CI, and report settings.

By the ScreenshotNeo team1 October 20266 min read

How to Run the Playwright Show Report Command

Run this command from your Playwright project directory:

npx playwright show-report

It starts a local web server for the HTML report from the default playwright-report directory and opens the report in your browser. The command syntax is:

npx playwright show-report [report] [options]

Use a directory or ZIP file when your report is stored somewhere else, and use --host or --port when the defaults do not fit your environment.

Run the command step by step

  1. Open a terminal in the directory that contains your Playwright project.
  2. Run your tests with the HTML reporter enabled. A normal Playwright setup writes the report to playwright-report.
  3. Start the report server:
npx playwright show-report

The default server binds to localhost and port 9323. Your browser should open automatically. If it does not, open http://localhost:9323 manually.

The show-report command serves an HTML report that a previous Playwright test run generated.
The show-report command serves an HTML report that a previous Playwright test run generated.

Use another package manager

# Yarn
yarn playwright show-report

# pnpm
pnpm exec playwright show-report

These forms run the same Playwright CLI command through the package manager documented for your project.

Generate a report before serving it

show-report serves an existing HTML report; it does not create a report from raw test results. Run your tests first:

npx playwright test

Then serve the generated report:

npx playwright show-report

If your configuration uses the HTML reporter, the report is normally written to playwright-report. The report contains filters for browser and test status, including passed, failed, skipped, and flaky tests. You can search for tests, inspect errors and steps, and open trace details when traces were captured.

Serve a report from a custom directory

Pass the report directory as the first argument:

npx playwright show-report my-report

For example, if your CI artifact was extracted to artifacts/e2e-report:

npx playwright show-report artifacts/e2e-report

The directory must contain the generated HTML report, including its index.html entry point.

Change the host and port

Use --port when port 9323 is already occupied or when a team convention requires a different port:

npx playwright show-report --port 8080

Use --host to choose the interface to bind:

npx playwright show-report --host 127.0.0.1 --port 8080
Option Default Use
[report] playwright-report Directory or supported ZIP report to serve
--host <host> localhost Network interface or host name for the server
--port <port> 9323 TCP port for the local report server

Binding to a non-loopback interface can make the report reachable from other machines. Use that only when your network controls and report contents allow it.

Open a report ZIP archive

Playwright can serve a report ZIP directly when index.html is at the archive’s top level:

npx playwright show-report playwright-report.zip

If you downloaded a CI artifact and extracted it, pass the extracted directory instead:

unzip playwright-report.zip -d downloaded-report
npx playwright show-report downloaded-report

A ZIP with an extra parent directory may not work as expected. Repackage it so that index.html is at the archive root, or extract it and pass the directory containing that file.

Configure where Playwright writes the report

Set the HTML reporter’s output directory in playwright.config.ts:

import { defineConfig } from '@playwright/test';

export default defineConfig({
  reporter: [['html', { outputFolder: 'artifacts/playwright-report' }]],
});

Then serve that configured location:

npx playwright show-report artifacts/playwright-report

The output directory can also be controlled with the PLAYWRIGHT_HTML_OUTPUT_DIR environment variable. Keep the value used during test execution and the path supplied to show-report consistent.

Control automatic opening

Playwright’s HTML reporter opens automatically by default after a failed run. The documented open values are:

  • always: open the report after every run.
  • never: generate the report without opening a browser.
  • on-failure: open it only when tests fail; this is the default.

Configure it in playwright.config.ts:

import { defineConfig } from '@playwright/test';

export default defineConfig({
  reporter: [['html', {
    outputFolder: 'playwright-report',
    open: 'never',
  }]],
});

You can also set the behavior with PLAYWRIGHT_HTML_OPEN. In CI, never is usually the practical setting; upload the report as an artifact and inspect it locally with show-report.

Inspect traces from the report

When a test has a captured trace, the HTML report displays a trace icon. Open the report, locate the test, and select the trace icon to inspect actions, screenshots, network activity, and timing. Trace inspection is a separate workflow from starting the report server, so a report can open successfully even when no trace was recorded.

Troubleshooting

“No report found” or an empty report

Cause: tests have not run, the HTML reporter is not enabled, or the report was written to another folder.

ScreenshotNeo removes common consent banners and overlays before capturing a page.
ScreenshotNeo removes common consent banners and overlays before capturing a page.

Fix: run npx playwright test, check the reporter configuration, and pass the actual output path:

npx playwright show-report path/to/report

Port 9323 is already in use

Cause: another report server or process is listening on the default port.

Fix: choose another port:

npx playwright show-report --port 8080

The browser does not open

Cause: automatic opening is disabled, the command is running in a headless CI environment, or the browser launcher cannot access a desktop session.

Fix: copy the URL printed by the command and open it manually. In CI, download the report artifact and run show-report on your workstation.

A custom folder is rejected

Cause: the path is wrong or does not contain index.html.

Fix: inspect the directory, then pass the folder that directly contains the report entry point:

ls path/to/report
npx playwright show-report path/to/report

A ZIP archive will not open

Cause: index.html is nested below a top-level directory in the archive.

Fix: extract the archive and pass the extracted directory, or create a ZIP whose root contains index.html.

The report works locally but not in CI

Cause: CI commonly has no graphical browser session, and the report directory may not be persisted after the job.

Fix: set open: 'never', archive the report directory, download it after the job, and run npx playwright show-report locally.

Performance, reliability, and cost considerations

  • Performance: serving a static HTML report is usually fast; the main cost is generating and transferring large artifacts containing screenshots, videos, or traces.
  • Reliability: preserve the complete report directory when moving it between machines. Missing assets can make the report appear incomplete even when index.html exists.
  • Repeatability: record the report output path in your Playwright configuration and CI artifact definition so every run can be opened with the same command.
  • Security: reports may contain URLs, error messages, screenshots, trace data, and test credentials. Treat downloaded artifacts as sensitive and avoid exposing a report server publicly.
  • Cost: show-report is a local Playwright workflow. Costs come from your CI storage, artifact retention, and bandwidth policies rather than from the command itself.

Or skip the browser setup

If your goal is a clean image or PDF of a page rather than an interactive Playwright test report, ScreenshotNeo provides a single HTTP request. Its API accepts capture options for full pages, CSS-selected elements, devices, dark mode, PDFs, custom CSS and JavaScript, waits, request blocking, headers, cookies, geolocation, caching, and more. Read the ScreenshotNeo API documentation for the complete parameter list.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

Cookie banners, newsletter popups, and chat widgets are removed before the shot. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and response headers identify the page verdict and billing result. An MCP server lets Claude, Cursor, and other MCP clients call take_screenshot, get_page_info, and capture_pdf. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.

Create a free ScreenshotNeo account to get started.

FAQ

Does show-report rerun my tests?

No. It serves an already generated HTML report. Run npx playwright test when you need a new report.

Can I use a report from another machine?

Yes. Transfer the complete report directory or a compatible ZIP, then pass its local path to show-report.

Which URL should I share with a teammate?

The server URL is local by default. For a teammate on the same network, bind to an appropriate host and port only after checking that the report contains no sensitive data.

Why are traces missing?

Trace viewing requires traces to have been captured during the test run. Starting the report server does not create traces retroactively.

Official references