Skip to main content

Playwright Reporter

@testplanit/playwright-reporter is an official Playwright reporter that automatically sends test results to your TestPlanIt instance. It supports linking tests to existing test cases, automatic test case creation, attachment uploads (screenshots, videos, traces), and more.

It's the Playwright counterpart to the WebdriverIO Reporter. Because Playwright runs reporters in a single main process — and forwards events from every worker to it — there is no separate launcher service to configure and no worker-coordination option. One reporter instance sees every result and reports it to a single test run.

Installation

npm install --save-dev @testplanit/playwright-reporter
# or
pnpm add -D @testplanit/playwright-reporter
# or
yarn add -D @testplanit/playwright-reporter

Quick Start

Add the reporter to your Playwright configuration. Playwright supports multiple reporters at once, so you can keep list, html, or junit alongside it:

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

export default defineConfig({
reporter: [
['list'],
['@testplanit/playwright-reporter', {
domain: 'https://testplanit.example.com',
apiToken: process.env.TESTPLANIT_API_TOKEN,
projectId: 1,
}],
],
});

Run your tests:

npx playwright test

After your tests complete, you'll see a summary:

[TestPlanIt] Results Summary
[TestPlanIt] ═══════════════════════════════════════════════════════
[TestPlanIt] Test Run ID: 123
[TestPlanIt] Duration: 45.2s
[TestPlanIt]
[TestPlanIt] Test Results:
[TestPlanIt] ✓ Passed: 15
[TestPlanIt] ✗ Failed: 2
[TestPlanIt] ○ Skipped: 1
[TestPlanIt] Total: 18
[TestPlanIt]
[TestPlanIt] View results: https://testplanit.example.com/projects/runs/1/123
[TestPlanIt] ═══════════════════════════════════════════════════════

When autoCreateTestCases is enabled, additional stats are shown:

[TestPlanIt]   Test Cases:
[TestPlanIt] Found (existing): 12
[TestPlanIt] Created (new): 6

Attachment upload stats appear when attachments are uploaded:

[TestPlanIt]   Attachments:
[TestPlanIt] Uploaded: 2

How It Differs From the WebdriverIO Reporter

The two reporters share the same option surface and behavior, with a few Playwright-specific differences:

AspectPlaywright ReporterWebdriverIO Reporter
Process modelSingle main process sees all workersOne reporter per worker process
Launcher serviceNot needed — folded into the reporterSeparate TestPlanItService for one run across specs
Worker coordinationNone (oneReport doesn't exist)oneReport + file-based state
AttachmentsAll Playwright attachments (uploadAttachments + attachmentTypes)Intercepted screenshots (uploadScreenshots)
Default testRunTypeJUNITAuto-detected (MOCHA / CUCUMBER / REGULAR)

Because there's a single reporter instance and a single test run by default, no extra setup is required to consolidate results — every spec, project, and worker lands in the same run.

Next Steps