Skip to main content

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

OptionTypeDefaultDescription
outputFilestring'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).
licenseKeystringenv RF_LICENSE_KEYSubscription key (format RFSU-…). Falls back to the RF_LICENSE_KEY environment variable. PDF generation is skipped when absent or invalid.
logostringPath to a logo image (PNG, JPG, or SVG) to embed in the report header. Supports absolute and relative paths.
primaryColorstring'#CC785C'Primary brand colour (3-, 6-, or 8-digit hex). Used for headers and accent bars.
accentColorstring'#3F7D58'Accent brand colour (hex). Used for highlights and badges.
watermarkstringText to render as a diagonal watermark overlay on every page — e.g. 'CONFIDENTIAL', 'DRAFT'.
pdfPasswordstringPassword-protect the generated PDF. Requires qpdf installed on the system.
reportTitlestring'Playwright Test Report'Custom title for the report cover page and running header.
projectNamestringfrom package.jsonProject or application name. Inferred from the package.json name field if absent.
openbooleanfalseOpen the generated PDF automatically after generation. For local use only — ignored in CI.
puppeteerExecutablePathstringauto-detectFull path to a Chrome or Chromium binary. Falls back to PUPPETEER_EXECUTABLE_PATH env, then system Chrome discovery.
serverUrlstring'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.
includeScreenshotsbooleantrueEmbed Playwright screenshots in the PDF. Set to false to omit images — useful for exec-audience reports or reducing file size.
maxInlineFailuresnumberderived from compressionLevelCap on failure entries rendered inline in the PDF. Overflow is written to a sibling {basename}-failures.json sidecar file.
maxFileSizeMbnumber8Soft cap on the final PDF size in MB. If exceeded, the report is re-rendered once with the 'max' compression preset.
shardResultsstring | string[]Glob or path array of Playwright JSON shard report files to merge into one PDF. See the Shard Merging docs.
notifyobjectNotification channels: slack, teams, discord (each { url, enabled, on }), email ({ to, enabled, on, attachPdf }). See the Notifications docs.
historyFilestring~/.reportforge/{key}/history.jsonPath to the history JSON file. Relative paths resolve from cwd. Enables pass-rate trending charts in the detailed template.
historySizenumber10Maximum number of test runs to keep in the history file (integer ≥ 2). Older runs are pruned on append.
showTrendbooleantrueShow the pass-rate sparkline and delta badge in the detailed template. Set to false to disable history tracking entirely.
flakinessTopNnumber5Maximum flaky tests to show in the flakiness table (detailed template). Set to 0 to disable the table entirely.
templatePathstring | 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.

TokenExpands 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' },});