Reference
Templates
Three pre-compiled templates ship with ReportForge. Choose one via the template option. You can also generate multiple PDFs in one run.
Every report leads with a ship/hold release gate verdict (a run that executed zero tests gets a neutral NO TESTS RAN card instead of an approval), counts timed-out tests as a first-class status (their own KPI and chart segment), and lists failures most-severe first. Pages pack compactly: large sections flow and break between rows rather than each starting on a fresh page, and the Suite Results chart breaks a single-file run down by describe block. Every suite gets its own bar: on large runs the chart switches to full-width canvases that continue across pages, so per-suite coverage and failures stay visible even at 100+ suites. Requirements coverage bars are coloured by threshold (red / amber / green).
minimal
A single-page summary: pass/fail counts, duration, and a list of failed tests with their error message. No screenshots, no per-test detail. Useful for dashboards and Slack attachments where file size matters.
reporter: [['@reportforge/playwright-pdf', { template: 'minimal' }]]- Always fits on one page regardless of suite size
- No screenshot embedding; smallest file size
- Shows: project name, run date, total / passed / failed / skipped, duration, failed test list
detailed
The default template. One row per test with status, file path, duration, and, for failures, the error message and Playwright screenshot. Designed for developer and QA handoffs.
reporter: [['@reportforge/playwright-pdf', { template: 'detailed' }]]- Summary header + pass-rate chart + per-test table
- Failure sections include error message, stack excerpt, and screenshot
- File size scales with screenshot count; capped by maxFileSizeMb
- Requires use: { screenshot: 'only-on-failure' } to embed screenshots
executive
A stakeholder-friendly report that leads with a plain-language brief (trend and root causes in one sentence) and a single hero pass-rate number, followed by a prominent trend chart and a condensed test table. No stack traces or screenshots. Optional requirements traceability column.
reporter: [['@reportforge/playwright-pdf', { template: 'executive' }]]- Suitable for email attachments to non-technical stakeholders
- Shows: plain-language brief, hero pass-rate stat, trend chart, test-count by file/feature, requirement coverage table
- No error messages or stack traces
Multiple templates in one run
Add the reporter twice with different configs to generate two PDFs from the same run without running tests twice.
reporter: [ ['list'], ['@reportforge/playwright-pdf', { template: 'detailed', outputFile: 'reports/{date}-detailed.pdf' }], ['@reportforge/playwright-pdf', { template: 'executive', outputFile: 'reports/{date}-executive.pdf' }],]Both reporters receive the same test results. Chrome is launched once and reused across both renders.
Requirements traceability
The detailed template builds a requirements matrix from test tags. Tags matching requirementTagPattern (by default ticket-shaped IDs such as @REQ-101 or @ODP-5328) each get a matrix row with test count, pass/fail counts, and a pass-rate bar, sorted by ID. Category tags (@smoke, @regression) collapse into a compact tag summary below the matrix instead of repeating one near-identical row per tag.
test('user can login', { tag: ['@REQ-101', '@smoke'] }, async ({ page }) => { // ...});// Custom ID shape, e.g. underscores:reporter: [['@reportforge/playwright-pdf', { template: 'detailed', requirementTagPattern: '^@?REQ_\\d+$',}]]Set requirementTagPattern: '' to disable the split and list every tag in the matrix. The section can be enabled on other templates via the sections option (requirementsMatrix key).