Advanced Usage

Full Configuration

The reporter can be configured with the following options in your playwright.config.ts:
Option Type Default Description
outputDir string 'pulse-report' The directory where all report assets will be saved.

✨ New in v0.3.0: All CLI scripts now automatically read this value - no need to pass -o manually!
outputFile string 'playwright-pulse-report.json' The name of the main JSON data file.
resetOnEachRun boolean true If false, the reporter will merge results from sequential runs in the same job.

CI/CD Workflow (Non Sharding)

# .github/workflows/playwright.yml
name: Playwright Tests
on:
  push:
    branches: [ main, master ]
  pull_request:
    branches: [ main, master ]
jobs:
  test:
    timeout-minutes: 60
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - uses: actions/setup-node@v4
      with:
        node-version: lts/*
    - name: Install dependencies
      run: npm ci
    - name: Install Playwright Browsers
      run: npx playwright install --with-deps
    - name: Run Playwright tests
      run: npm run test
    - uses: actions/upload-artifact@v4
      if: always()
      with:
        name: playwright-report
        path: playwright-report/
        retention-days: 30

Handling Sequential Test Runs

By default, the reporter will overwrite the `playwright-pulse-report.json` file on each new test run. This is usually what we want. However, if we run tests sequentially in the same job, like this:
npx playwright test test1.spec.ts && npx playwright test test2.spec.ts
By default, In this above scenario, the report from test1 will be lost. To solve this, you can use the resetOnEachRun option.
# playwright.config.ts


import { defineConfig } from "@playwright/test";
import * as path from "path";
              
// Define where the final report JSON and HTML should go
const PULSE_REPORT_DIR = path.resolve(__dirname, "pulse-report"); // Example: a directory in your project root
              
export default defineConfig({
  reporter: [
    ["list"],
    [
      "@arghajit/playwright-pulse-report",
      {
        outputDir: PULSE_REPORT_DIR,
        // Add this option
        resetOnEachRun: false, // Default is true
      },
    ],
  ],
  // ...
});
How it works when resetOnEachRun: false:

- On the first run, it saves report-1.json to a pulse-report/pulse-results directory and creates the main playwright-pulse-report.json from it.
- On the second run, it saves report-2.json to the same directory.
- It then automatically reads both report-1.json and report-2.json, merges them, and updates the main playwright-pulse-report.json with the combined results.

This ensures your final report is always a complete summary of all sequential test runs.