Quickstart — Kensho with Playwright
Goal: a self-contained HTML report in your browser within ~60 seconds.
Requirements
- Node.js 22 or newer
- A Playwright project (or any of the other supported runners)
- pnpm, npm, or yarn — examples use
pnpm
1. Install
pnpm add -D @kaizenreport/kensho-playwright @kaizenreport/kensho
The first package is the Playwright reporter. The second is the CLI you'll use to generate and open the report.
2. Wire the reporter
// playwright.config.ts
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [
['line'], // keep your existing console reporter
['@kaizenreport/kensho-playwright', {
output: 'kensho-results',
project: { name: 'Acme Web', slug: 'acme-web' },
severityFromTag: true, // @blocker / @critical / @normal / @minor / @trivial
}],
],
});
The reporter writes to kensho-results/ (you can change output):
run.json— manifest (project, env, totals, timing)cases/<stableId>.json— one per test caseattachments/<stableId>/…— screenshots, videos, traces
Stable IDs are hashed from fullName + filePath so the same test correlates across runs.
3. Run your tests
npx playwright test
When the run finishes, kensho-results/ is populated.
4. Generate the static report
npx kensho generate
# → kensho-report/
This emits a self-contained directory with HTML, CSS, JS bundles, and the gzipped data files.
5. Open it locally
npx kensho open
# serves at http://127.0.0.1:<auto>, opens your browser
Or just double-click kensho-report/index.html — Kensho works from file:// too.
Optional: badge for your README
npx kensho badge --type passrate --out badge.svg
# embed in README: 
Optional: ship to the Kaizen platform
npx kensho login # one-time browser-based auth
npx kensho push --workspace acme # pushes the latest run
Once pushed, you'll see history, flake rates, and triage in the Kaizen UI. See Upload runs for all the upload paths (CLI, GitHub Action, browser, VS Code).
Annotations → Kensho labels
test.info().annotations.push({ type: 'owner', description: '@mchen' });
test.info().annotations.push({ type: 'jira', description: 'ACME-1234' });
These show up as owner and labels.jira in the case JSON, and as filterable chips in the report.
Troubleshooting
- Empty
kensho-results/— confirm the reporter array is wired and you're not running with--reporter=...on the CLI (which overrides config). kensho generatesays "no run.json" — pass--input ./path/to/resultsif you renamedoutput.- Schema validation fails — run
npx kensho validate kensho-resultsto see exactly which key is wrong.
Next: explore every flag in CLI reference or wire a different framework via Adapters.