> ## Documentation Index
> Fetch the complete documentation index at: https://e2e.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# HTML report

> Add the e2e HTML reporter to get one page per run with every test's error, steps, screenshots, and video, and share it from CI.

The HTML report is one page that shows a whole run: every test by file,
with its attempts, error, steps, screenshots, and video. It opens from disk
with no server, so you can keep it as a CI artifact and open it later.

![The run page of an e2e HTML report: five tests grouped by file, three passed, one flaky, and one failed.](https://e2e.com/docs/images/html-report/run.png)

## Add the reporter

Install `@e2e-dev/html-reporter`:

<CodeGroup>
```bash npm
npm install --save-dev @e2e-dev/html-reporter
```

```bash pnpm
pnpm add -D @e2e-dev/html-reporter
```

```bash bun
bun add -d @e2e-dev/html-reporter
```
</CodeGroup>

Add it to `reporters` beside `list`, and record a video of each failed test
so the report can play it back:

```ts title="e2e.config.ts"

export default {
  targets: [{ engine: web(), app: { url: 'http://localhost:3000' } }],
  reporters: ['list', htmlReporter()],
  video: 'retain-on-failure',
} satisfies E2EConfig;
```

Without `video`, or on an engine that can't record, the report still shows
the error, the steps, and a screenshot at the failure when the engine takes
one. See [`video`](https://e2e.com/docs/reference/config#video) for the other recording modes.

## Open the report

Once a run writes its report, e2e writes `.e2e/report.html` beside it and
prints its path under the summary:

```text
      Tests  1 failed | 3 passed | 1 flaky (5)
HTML report  .e2e/report.html
```

Open the file in a browser, or run `e2e report` to open the last one:

<CodeGroup>
```bash npm
npx e2e report
```

```bash pnpm
pnpm exec e2e report
```

```bash bun
bunx e2e report
```
</CodeGroup>

The run page lists the tests by file, worst first. Use the status tabs and
the search box to narrow the list. Search matches test titles, files, and
tags. A run on several targets also gets a tab per target.

## Read a failed test

Select a test to open its page.

![A failed test in the e2e HTML report: the expected and received text, and the video paused at the failing step.](https://e2e.com/docs/images/html-report/failed-test.png)

- **Attempts.** A retried test has a tab per attempt, so a flaky test keeps
  the failed attempt's evidence.
- **Error.** The failure with what was expected and what the app showed.
  **copy prompt** copies it for a coding agent, with the steps and the paths
  of whichever of the trace page, screenshot, and video exist.
- **Video.** Each step links to its moment in the recording.
- **Steps.** Expand a step to see the test code around it.
- **At failure.** The screenshot and the screen tree the failed step saw.

By default, a failed or flaky test also gets a Markdown
[trace page](https://e2e.com/docs/debugging#open-the-trace-page) with the same evidence, for an
agent to read.

## Share it from CI

By default the page links screenshots and videos from `.e2e/results/`.
Upload the report and that directory as one artifact so the links keep
working:

```yaml title=".github/workflows/e2e.yml"
- name: Upload HTML report
  if: ${{ !cancelled() }}
  uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
  with:
    name: e2e-html-report
    path: |
      .e2e/report.html
      .e2e/results
    retention-days: 7
```

Download the artifact, unzip it, and open `report.html`.

<Warning>
Videos mask nothing, so a typed password shows in plain view. Check them
before you share the artifact or an embedded page. See
[What can still leak](https://e2e.com/docs/security#what-can-still-leak).
</Warning>

To share one file instead, set `htmlReporter({ media: 'embed' })`. The page
then holds the screenshots and videos itself, so it grows with every
recording. A video a hosted browser or device service keeps stays a link. `media: 'none'` leaves them out for a small, text-only page.
[`htmlReporter()`](https://e2e.com/docs/reference/reporters#htmlreporter) lists every option.

## Next

<CardGroup cols={2}>
  <Card title="Debugging a run" icon="bug" href="/debugging">
    Trace pages, headed reruns, and stepping through a test.
  </Card>
  <Card title="GitHub Actions" icon="/images/integrations/github-actions.svg" href="/ci/github-actions">
    The full workflow that runs the tests and uploads the results.
  </Card>
</CardGroup>
