Reference
Configuration
All options are passed to the reporter in playwright.config.ts. Every option is optional; the defaults work without a license key (PDF is skipped).
Options reference
| Option | Type | Default | Description |
|---|---|---|---|
| outputFile | string | 'playwright-report/{date}-report.pdf' | Output path. Supports tokens: {date}, {datetime}, {branch}, {status}, {total}, {passed}, {failed}, {project}. Directory is created if absent. |
| template | 'minimal' | 'detailed' | 'executive' or array | 'minimal' | Template(s) to generate. Pass an array to produce one PDF per template in one run — the template name is appended to each output filename automatically (e.g. report-detailed.pdf). |
| licenseKey | string | env RF_LICENSE_KEY | Subscription key (format RFSU-…). Falls back to the RF_LICENSE_KEY environment variable. PDF generation is skipped when absent or invalid. |
| logo | string | — | Path to a logo image (PNG, JPG, or SVG) to embed in the report header. Supports absolute and relative paths. |
| primaryColor | string | '#CC785C' | Primary brand colour (3-, 6-, or 8-digit hex). Used for headers and accent bars. |
| accentColor | string | '#3F7D58' | Accent brand colour (hex). Used for highlights and badges. |
| watermark | string | — | Text to render as a diagonal watermark overlay on every page — e.g. 'CONFIDENTIAL', 'DRAFT'. |
| pdfPassword | string | — | Password-protect the generated PDF. Requires qpdf installed on the system. |
| reportTitle | string | 'Playwright Test Report' | Custom title for the report cover page and running header. |
| projectName | string | from package.json | Project or application name. Inferred from the package.json name field if absent. |
| open | boolean | false | Open the generated PDF automatically after generation. For local use only — ignored in CI. |
| puppeteerExecutablePath | string | auto-detect | Full path to a Chrome or Chromium binary. Falls back to PUPPETEER_EXECUTABLE_PATH env, then system Chrome discovery. |
| serverUrl | string | 'https://reportforge.org' | Base URL for the ReportForge licensing server. Override only for self-hosting or local development. |
| compressionLevel | 'auto' | 'none' | 'balanced' | 'max' | 'auto' | Screenshot JPEG quality preset. 'auto' picks based on failure volume; 'none' keeps original PNGs; 'balanced' uses JPEG q85; 'max' uses JPEG q70. |
| includeScreenshots | boolean | true | Embed Playwright screenshots in the PDF. Set to false to omit images — useful for exec-audience reports or reducing file size. |
| maxInlineFailures | number | derived from compressionLevel | Cap on failure entries rendered inline in the PDF. Overflow is written to a sibling {basename}-failures.json sidecar file. |
| maxFileSizeMb | number | 8 | Soft cap on the final PDF size in MB. If exceeded, the report is re-rendered once with the 'max' compression preset. |
| shardResults | string | string[] | — | Glob or path array of Playwright JSON shard report files to merge into one PDF. See the Shard Merging docs. |
| notify | object | — | Notification channels: slack, teams, discord (each { url, enabled, on }), email ({ to, enabled, on, attachPdf }). See the Notifications docs. |
| historyFile | string | ~/.reportforge/{key}/history.json | Path to the history JSON file. Relative paths resolve from cwd. Enables pass-rate trending charts in the detailed template. |
| historySize | number | 10 | Maximum number of test runs to keep in the history file (integer ≥ 2). Older runs are pruned on append. |
| showTrend | boolean | true | Show the pass-rate sparkline and delta badge in the detailed template. Set to false to disable history tracking entirely. |
| flakinessTopN | number | 5 | Maximum flaky tests to show in the flakiness table (detailed template). Set to 0 to disable the table entirely. |
| templatePath | string | string[] | — | Path to a custom Handlebars (.hbs) template file. Takes precedence over template. Pass an array to generate one PDF per custom template. See the Custom Templates docs. |
Filename tokens
Token expansion runs at write time. All tokens are safe to use in CI; unknown tokens are left as-is.
| Token | Expands to |
|---|---|
| {date} | YYYY-MM-DD in local time (e.g. 2026-04-27) |
| {datetime} | YYYY-MM-DD-HHmmss |
| {branch} | Current git branch (or unknown if not in a repo) |
| {status} | passed or failed |
| {total} | Total test count |
| {passed} | Passed test count |
| {failed} | Failed test count |
| {project} | Value of projectName option (slugified) |
Full example
// playwright.config.tsimport { defineConfig } from '@playwright/test';import { defineReporterConfig } from '@reportforge/playwright-pdf';export default defineConfig({ reporter: [ ['list'], ['@reportforge/playwright-pdf', defineReporterConfig({ licenseKey: process.env.RF_LICENSE_KEY, template: 'detailed', outputFile: 'reports/{date}-{branch}-{status}.pdf', projectName: 'Acme E2E Suite', logo: './assets/logo.png', puppeteerExecutablePath: process.env.PUPPETEER_EXECUTABLE_PATH, maxFileSizeMb: 12, includeScreenshots: true, historyFile: '.rf-history/history.json', notify: { slack: { url: process.env.SLACK_WEBHOOK_URL, enabled: true, on: 'failure' }, }, })], ], use: { screenshot: 'only-on-failure' },});