Recipes & Presets
Production recipes, external configuration files, and ready-to-use presets for CI and local development.
Ready-to-use configuration patterns for common engineering environments and team setups.
Keeping Options in a Separate File
When your configuration options grow, you can move them into a dedicated zen.config.json file in the same directory as playwright.config.ts. The reporter auto-discovers and loads this file on startup:
{ "outputDir": "zen-report", "projectName": "Web App E2E", "testRunName": "CI Build #{N}", "singleSummaryFile": true, "history": { "mode": "remote", "serverUrl": "https://zen-reporter.internal", "apiKey": "secret-key", "projectId": "frontend-e2e" }}No changes to playwright.config.ts are required; you can keep only the options you wish to override inline:
export default defineConfig({ reporter: [['@zen-reports/zen-reporter-playwright', { theme: 'Oasis' }]],});Precedence Rules
- Field-by-field override: Inline options in the
playwright.config.tsreporter tuple take precedence overzen.config.json, which takes precedence over built-in defaults. - One directory only: Probed in the exact directory where
playwright.config.tslives. - Strict validation: A malformed
zen.config.jsonhalts execution with a descriptive error instead of being silently ignored.
TypeScript Config with Environment Variables
If you need dynamic environment variables or comments in your standalone config, create a zen.config.ts file and import it directly into playwright.config.ts:
export default { projectName: 'Web App E2E', history: { mode: 'remote', serverUrl: process.env.ZEN_SERVER_URL || 'https://zen-reporter.internal', apiKey: process.env.ZEN_REPORTER_API_KEY, projectId: 'frontend-e2e', },};import { defineConfig } from '@playwright/test';import zenOptions from './zen.config';
export default defineConfig({ reporter: [['@zen-reports/zen-reporter-playwright', zenOptions]],});Production Recipes
1. CI / GitHub Actions Pipeline
Optimized for automated build environments: non-interactive progress, no auto-open, and standalone summary enabled for CI job artifacts:
import { defineConfig } from '@playwright/test';
export default defineConfig({ reporter: [ [ '@zen-reports/zen-reporter-playwright', { outputDir: 'zen-report', projectName: 'Web App E2E', testRunName: `CI Build #${process.env.GITHUB_RUN_NUMBER || 'Local'}`, consoleProgress: 'dot', openAutomatically: 'never', singleSummaryFile: true, }, ], ],});2. Local Developer Ergonomics
Optimized for local test iteration: opens the browser automatically only when tests fail, displays a rich interactive progress bar, and follows system dark mode:
import { defineConfig } from '@playwright/test';
export default defineConfig({ reporter: [ [ '@zen-reports/zen-reporter-playwright', { projectName: 'Local Dev Suite', consoleProgress: 'line', openAutomatically: 'on-failure-only', theme: 'Bamboo', }, ], ],});3. Lightweight / Minimal Mode
For quick unit or smoke test runs where historical data and secondary analytics tabs are not needed:
import { defineConfig } from '@playwright/test';
export default defineConfig({ reporter: [ [ '@zen-reports/zen-reporter-playwright', { minimalReport: true, // Disables history and hides Trends/Insights tabs consoleProgress: 'line', }, ], ],});