Skip to content

Playwright HTML Report Not Generating Fix

DodaTech Updated 2026-06-24 2 min read

In this tutorial, you'll learn about Playwright HTML Report Not Generating Fix. We cover key concepts, practical examples, and best practices.

After running tests, no HTML report is generated — you can't view the visual test results with screenshots and traces.

The Problem

# WRONG — running tests without report configuration
npx playwright test
Tests: 12 passed, 12 total
# No report generated

By default, Playwright uses the list reporter which only shows results in the terminal. The HTML reporter must be explicitly configured.

Step-by-Step Fix

1. Configure HTML reporter

// RIGHT — playwright.config.ts
import { defineConfig } from '@playwright/test';

export default defineConfig({
  reporter: 'html',
});

2. Use multiple reporters

// RIGHT — combine reporters
export default defineConfig({
  reporter: [
    ['html'],           // HTML report for viewing
    ['list'],           // Terminal output during run
    ['json', { outputFile: 'results.json' }], // JSON for CI
  ],
});

3. Configure report output

// RIGHT — report options
export default defineConfig({
  reporter: [
    ['html', {
      outputFolder: 'playwright-report',  // Default
      open: 'never',                       // Don't auto-open
      host: '0.0.0.0',                     // Host for viewer
      port: 9323,                          // Port for viewer
    }],
  ],
});

4. View the report

# RIGHT — view HTML report
npx playwright show-report

# Specify custom folder
npx playwright show-report playwright-report

# Or open manually
open playwright-report/index.html

5. CI integration

# RIGHT — generate report in CI
npx playwright test --reporter=html

# Serve report for debugging
npx playwright show-report --host=0.0.0.0 --port=9323

Expected output:

✓ 12 tests passed (2.5s)
To open last HTML report run:
  npx playwright show-report

The HTML report shows test results with pass/fail status, duration, and links to traces and videos.

Prevention Tips

  • Configure reporter: 'html' in <a href="/testing-qa/playwright/">playwright</a>.config.ts
  • Use multiple reporters for terminal + HTML output
  • Set open: 'never' in CI to avoid blocking
  • Serve the report on a port for remote viewing
  • Publish report artifacts in CI

Common Mistakes with report html

  1. Non-exhaustive pattern matches that compile with warnings then crash at runtime
  2. Misunderstanding that String is [Char] with poor performance for large text operations
  3. Using foldl instead of foldl' causing stack overflow on large lists

These mistakes appear frequently in real-world PLAYWRIGHT code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### Can I customize the HTML report?

Yes. Use the outputFolder, host, and port options. The report includes test names, durations, screenshots, traces, and video links. Custom CSS is not supported directly.

How do I share the HTML report with my team?

Serve it with npx <a href="/testing-qa/playwright/">playwright</a> show-report --host=0.0.0.0 or upload the <a href="/testing-qa/playwright/">playwright</a>-report folder to a static file server. The report is a self-contained set of HTML and JS files.

What's the difference between HTML and JSON reporters?

HTML reporter generates a visual, browsable report. JSON reporter generates machine-readable output for CI tools. Use both: HTML for human review, JSON for automated analysis.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro