Playwright Test Report Not Generating: Causes, Fixes, and Troubleshooting Guide

Introduction: What Does “Playwright Test Report Not Generating” Mean?

The playwright test report not generating problem occurs when you run Playwright tests but cannot find the expected HTML report, playwright-report folder, test-results directory, screenshots, videos, or trace files.

A normal Playwright test might be executed with:

npx playwright test

and then the report can be opened with:

npx playwright show-report

If the report is missing, empty, or cannot be opened, the problem may involve reporter configuration, test execution, output paths, CI/CD artifacts, Docker volumes, or the way the test was executed.

For beginners, an important distinction is:

These are related, but they are not the same thing.

This playwright test report not generating tutorial explains how to diagnose and fix missing reports in local, Docker, and CI/CD environments.


How Playwright Test Reporting Works

Playwright Test uses reporters to display and store test results.

A simple configuration is:

import { defineConfig } from ‘@playwright/test’;

export default defineConfig({

  reporter: ‘html’

});

After running:

npx playwright test

Playwright can generate an HTML report.

You can open it using:

npx playwright show-report

The report provides information such as:

  • Passed tests
  • Failed tests
  • Skipped tests
  • Test duration
  • Error messages
  • Attachments
  • Screenshots
  • Videos
  • Trace links when available

Understanding the HTML Report and Test Results Directory

Two folders are commonly confused:

playwright-report/

test-results/

playwright-report

This contains the generated HTML report.

For example:

playwright-report/

├── index.html

├── data/

└── trace/

test-results

This generally contains artifacts generated during test execution.

For example:

test-results/

├── test-1/

│   ├── screenshot.png

│   └── trace.zip

└── test-2/

    └── video.webm

Therefore, having no test-results folder does not automatically mean the HTML reporter is broken.


Configuring Playwright Reporters in playwright.config.ts

A complete configuration can look like:

import { defineConfig } from ‘@playwright/test’;

export default defineConfig({

  testDir: ‘./tests’,

  reporter: [

    [‘html’, {

      outputFolder: ‘playwright-report’,

      open: ‘never’

    }],

    [‘list’]

  ],

  use: {

    screenshot: ‘only-on-failure’,

    video: ‘retain-on-failure’,

    trace: ‘retain-on-failure’

  }

});

This configuration provides:

The important point is that screenshots, videos, and traces are configured separately from the HTML reporter.


Running Tests and Generating an HTML Report

Create a simple test:

import { test, expect } from ‘@playwright/test’;

test(‘homepage test’, async ({ page }) => {

  await page.goto(‘https://example.com’);

  await expect(

    page.getByRole(‘heading’, {

      name: ‘Example Domain’

    })

  ).toBeVisible();

});

Run:

npx playwright test

Then:

npx playwright show-report

If the report does not appear, check whether the test actually ran and whether the configured reporter is being loaded.


Playwright Test Report Not Generating: Common Reasons

Here are the most common causes:

ProblemPossible Cause
No playwright-reportHTML reporter not configured or report path changed
Empty reportNo tests executed
No test-resultsNo artifact-generating configuration
Report disappears in CIWorkspace/artifacts not preserved
HTML report cannot openReport not copied from container
Screenshots missingScreenshot capture disabled
Videos missingVideo capture disabled
Traces missingTrace capture disabled
Wrong report locationCustom outputFolder
CI report unavailableArtifact upload failure

The correct playwright test report not generating fix depends on which part of the reporting pipeline is failing.


Test Failures, Configuration, and Reporter Issues

Problem → Cause → Diagnostic Step → Fix → Verification → Best Practice

Problem

You run:

npx playwright test

but cannot find playwright-report.

Cause

The project may use a different reporter.

Check:

npx playwright test –reporter=list

If you explicitly override the reporter, your configured HTML reporter may not be used.

Fix

Configure:

export default defineConfig({

  reporter: [[‘html’, { open: ‘never’ }]]

});

Verification

Run:

npx playwright test

Then:

npx playwright show-report

Best Practice

Keep reporter configuration in version-controlled playwright.config.ts.


Why the test-results Folder Is Not Generated

A common misunderstanding is expecting:

test-results/

after every test run.

Artifacts such as screenshots, videos, and traces are only generated according to their configured policies.

For example:

use: {

  screenshot: ‘only-on-failure’,

  video: ‘retain-on-failure’,

  trace: ‘retain-on-failure’

}

If all tests pass, you may not see failure artifacts.

For debugging, you can temporarily use:

use: {

  screenshot: ‘on’,

  video: ‘on’,

  trace: ‘on’

}

Do this selectively because it can produce much larger output.


Screenshots, Videos, and Traces Not Appearing

Screenshot

Configure:

use: {

  screenshot: ‘only-on-failure’

}

Video

use: {

  video: ‘retain-on-failure’

}

Trace

use: {

  trace: ‘retain-on-failure’

}

For retry debugging:

use: {

  trace: ‘on-first-retry’

}

This is especially useful when combined with:

retries: 2

You can then investigate the failed attempt without recording every successful test.


Multiple Playwright Reporters

You can use multiple reporters:

import { defineConfig } from ‘@playwright/test’;

export default defineConfig({

  reporter: [

    [‘list’],

    [‘html’, {

      outputFolder: ‘playwright-report’,

      open: ‘never’

    }]

  ]

});

The console provides immediate feedback while the HTML reporter provides detailed post-run results.

This is useful for both local development and CI/CD.


Playwright Report Not Generating in CI/CD

A frequent situation is:

The report exists locally but disappears after the CI job finishes.

The report may have been created correctly but not uploaded as an artifact.

For GitHub Actions:

name: Playwright Tests

on:

  push:

  pull_request:

jobs:

  test:

    runs-on: ubuntu-latest

    steps:

      – uses: actions/checkout@v4

      – uses: actions/setup-node@v4

        with:

          node-version: 22

      – run: npm ci

      – run: npx playwright install –with-deps

      – run: npx playwright test

      – name: Upload Playwright report

        if: always()

        uses: actions/upload-artifact@v4

        with:

          name: playwright-report

          path: playwright-report/

          retention-days: 14

      – name: Upload test results

        if: always()

        uses: actions/upload-artifact@v4

        with:

          name: playwright-test-results

          path: test-results/

          retention-days: 14

Why if: always() matters

If the test command fails, subsequent steps may be skipped unless explicitly configured to run.

Without artifact upload, you may lose the evidence you need to investigate the failure.


Handling Playwright Reports in Docker

Docker introduces another reporting problem.

Suppose the container creates:

/app/playwright-report

When the container exits, that filesystem disappears unless the output is copied or mounted.

Run the container with a volume:

docker run –rm \

  -v “$(pwd)/playwright-report:/app/playwright-report” \

  playwright-tests

For test results:

docker run –rm \

  -v “$(pwd)/test-results:/app/test-results” \

  playwright-tests

Then inspect the folders on the host.

This is an important part of fixing playwright test report not generating problems in Docker.


Debugging Missing Reports and Artifacts

Use this checklist.

Step 1: Confirm tests execute

npx playwright test

Step 2: Check the reporter

npx playwright test –reporter=list

Step 3: Check configured paths

Look for:

outputFolder: ‘playwright-report’

Step 4: Check the filesystem

ls -la playwright-report

ls -la test-results

On Windows PowerShell:

Get-ChildItem playwright-report

Get-ChildItem test-results

Step 5: Verify artifact policies

Check:

screenshot: ‘only-on-failure’

video: ‘retain-on-failure’

trace: ‘retain-on-failure’

Step 6: Check CI artifact upload

Make sure the path matches the actual generated directory.


Real-World Playwright Reporting Troubleshooting Examples

Example 1: HTML Report Missing

Problem: npx playwright show-report says the report directory does not exist.

Cause: HTML reporter is not configured or the output folder was customized.

Diagnostic:

Inspect:

reporter: ‘html’

Fix:

reporter: [

  [‘html’, {

    outputFolder: ‘playwright-report’,

    open: ‘never’

  }]

]

Verification:

npx playwright test

npx playwright show-report

Best Practice: Keep the report output path predictable.


Example 2: Test Results Folder Missing

Problem: No test-results directory appears.

Cause: No screenshot, video, or trace artifact was configured/generated.

Fix:

use: {

  screenshot: ‘only-on-failure’,

  video: ‘retain-on-failure’,

  trace: ‘retain-on-failure’

}

Verification: Run a deliberately failing test and inspect the generated artifacts.

Best Practice: Understand that the HTML report and test artifacts have different purposes.


Example 3: CI Report Missing

Problem: Report works locally but cannot be downloaded from GitHub Actions.

Cause: Report was generated inside the runner but never uploaded.

Fix:

– name: Upload report

  if: always()

  uses: actions/upload-artifact@v4

  with:

    name: playwright-report

    path: playwright-report/

Verification: Check the workflow’s artifact section after execution.

Best Practice: Upload reports even when tests fail.


Common Mistakes and Solutions

MistakeSolution
Assuming HTML report equals test-resultsTreat them separately
Forgetting HTML reporterConfigure reporter: ‘html’
Using wrong output pathCheck outputFolder
Expecting screenshots on passing testsConfigure screenshot capture appropriately
Losing reports after Docker exitsMount/copy report directories
Not uploading CI reportsUse artifact upload
Uploading only on successUse if: always()
Debugging without artifactsEnable trace/screenshots
Using excessive video/trace recordingEnable selectively

Playwright Reporting Best Practices

For reliable Playwright Reporting:

  • Configure an HTML reporter explicitly.
  • Use open: ‘never’ in CI.
  • Keep playwright-report predictable.
  • Keep test-results separate.
  • Capture screenshots on failure.
  • Capture videos only when useful.
  • Capture traces for retries/failures.
  • Upload reports in CI.
  • Use if: always() for artifact collection.
  • Mount report directories in Docker.
  • Avoid accidentally overriding reporters through CLI options.
  • Verify generated paths before troubleshooting CI.
  • Keep artifacts for an appropriate retention period.

A strong reporting strategy turns a failed test from a simple red status into useful debugging evidence.


Playwright Reporting Interview Questions With Answers

Why is the Playwright report not generating?

Check whether the HTML reporter is configured, whether tests actually ran, whether the output directory was changed, and whether CI/Docker is preserving the generated files.

How do you generate an HTML report in Playwright?

Configure:

reporter: ‘html’

then run:

npx playwright test

and open it with:

npx playwright show-report

What is the difference between playwright-report and test-results?

playwright-report contains the HTML reporting interface. test-results generally contains test-specific artifacts such as screenshots, videos, and traces.

Why are screenshots missing from the Playwright report?

Screenshot capture may not be enabled, or the configured policy may capture screenshots only when tests fail.

How do you preserve Playwright reports in CI?

Upload the playwright-report and test-results directories as CI artifacts after the test step, preferably using if: always().

Why does the Playwright report work locally but not in Docker?

The report may be generated inside the container but lost when the container exits. Mount or copy the report directory outside the container.


FAQs

Why is Playwright report not generating?

The most common causes are missing HTML reporter configuration, incorrect output paths, tests not executing, reporter overrides, or reports being generated inside an environment where they are not preserved.

How do I fix Playwright test report not generating?

Configure the HTML reporter, run the tests, verify the playwright-report directory, and use npx playwright show-report to open it.

Why is the Playwright HTML report not opening?

Check that the report directory exists and contains the generated report. Also make sure you are running npx playwright show-report from the correct project directory.

Why is the Playwright report missing in CI?

The report may exist inside the CI runner but not be uploaded. Configure an artifact upload step with the correct report path.

Why is the Playwright test-results folder not generated?

It may contain only artifacts generated according to your screenshot, video, and trace configuration. If no artifact was requested or required, the folder may not contain anything useful.

Can Playwright generate multiple reports?

Yes. Playwright supports multiple reporters, allowing you to combine console output with HTML or other supported reporting formats.

Leave a Comment

Your email address will not be published. Required fields are marked *