šŸŽÆBlog # 24: Playwright Reporters Demystified: Know What Your Tests Are Saying

Published on May 19, 2025

Whether you're running a handful of tests or scaling up to hundreds, knowing what happened, where it failed, and how to debug it fast is crucial. That’s where Playwright reporters become your best friends.

In this blog, I’ll take you on a tour of Playwright’s built-in reporters, show you sample test scripts, and (yes!) include screenshots of each report in action so you can see the difference.

🧠 What Are Reporters?

Reporters are like your test suite's storytellers. After executing your tests, they summarize the results—either in your terminal or in beautiful visual formats. Think of them as:

  • Terminal dashboards 
  • Structured outputs for CI/CD
  • Visual tools for debugging
  • Data sources for analytics

🧪 Sample Test File

Here’s the test script I’m using for this blog. Each test is designed to showcase one type of reporter:

const { test, expect } = require('@playwright/test');

test('List reporter example (updated)', async ({ page }) => {
    await page.goto('https://www.iana.org');
    await expect(page).toHaveTitle(/Internet Assigned Numbers Authority/);
});

test('Dot reporter example', async ({ page }) => {
    await page.goto('https://playwright.dev');
    await expect(page).toHaveTitle(/Playwright/);
});

test('HTML reporter example', async ({ page }) => {
    await page.goto('https://github.com');
    await expect(page).toHaveTitle(/GitHub/);
});

test('JSON reporter example', async ({ page }) => {
    await page.goto('https://www.wikipedia.org');
    await expect(page).toHaveTitle(/Wikipedia/);
});

Let’s explore how each reporter works—and what the output looks like šŸ‘‡

šŸ“œ 1. List Reporter

npx playwright test --reporter=list

🧾 Output: A clean list of each test with its status and time taken.




āœ… Great for local debugging and readable summaries.

⚫ 2. Dot Reporter

Each dot represents a test, and failed tests show as F.

npx playwright test --reporter=dot


⚔ Fast, minimal, perfect for CI terminals or massive test suites.

šŸ“ˆ 3. Line Reporter

npx playwright test --reporter=line

It shows real-time updates of tests as they run—visually pleasing and useful in CI logs.

🌐 4. HTML Reporter

npx playwright test --reporter=html

npx playwright show-report

šŸ“Š A beautiful, clickable HTML report showing:

  • Test names, status, duration
  • Ability to view traces and errors
  • Great for debugging failed tests

šŸŽÆ Ideal for team collaboration or sharing detailed results with stakeholders.

🧾 5. JSON Reporter

npx playwright test --reporter=json

šŸ“„ Output: A structured json file with full test metadata.

šŸ“Œ To specify file location, use config like:

reporter: [['json', { outputFile: 'results/report.json' }]]

šŸ’” Use this to:

  • Build custom dashboards
  • Feed test data into analytics tools
  • Automate monitoring/reporting

🧪 6. JUnit Reporter

npx playwright test --reporter=junit

šŸ—‚ļø Produces an XML file compatible with tools like Jenkins, CircleCI, and GitLab CI.

šŸ“Œ To specify output file:

reporter: [['junit', { outputFile: 'results/junit-results.xml' }]]

āœ… Best for CI/CD integrations that expect standardized XML format.

āš™ļø Configuring Reporters in playwright.config.js

Instead of passing reporters via CLI each time, you can configure them once in your playwright.config.js file:

import { defineConfig } from '@playwright/test';
export default defineConfig({
  reporter: [
    ['list'],
    ['html'],
    ['json', { outputFile: 'results/report.json' }],
    ['junit', { outputFile: 'results/junit-results.xml' }]
  ]
});

Now just run:

npx playwright test

šŸ’” Your test run will generate all configured reports in one go!

āœ… Final Thoughts

Choosing the right reporter isn’t just about pretty output—it’s about clarity, debuggability, and team collaboration.

  • šŸš€ Start with html for local devs
  • āš™ļø Use junit or json in CI
  • šŸ” Combine reporters for the best of all worlds


Let me know which reporter is your favorite—or if you’ve used these in creative ways.

Thanks for reading and happy testing with Playwright! šŸ’œšŸŽ­