Playwright

A guide for generating JUnit test reports for Playwright tests

1. Generate JUnit

Configure Playwright to generate JUnit:

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

export default defineConfig({
  reporter: [
    ['junit', 
      { outputFile: 'junit.xml' }
    ]
  ],
});

2. Output Location

The JUnit file will be written to the outputFile specified in the configuration. In the example above, the results will be written to junit.xml.

Next Step

JUnit files generated with Playwright are compatible with Trunk Flaky Tests. See CI Providers for a guide on how to upload test results to Trunk.

Last updated