Deterministic Playwright failure triage: CLI diagnosis, root-cause grouping, and a shareable debugging report.
SAMPLE REPORT: https://sentinelqa.com/share/run/permanent-demo-playwright-report
After a failed Playwright run, Sentinel prints:
- a deterministic CLI diagnosis (1–3 root causes)
- how many tests are affected per root cause
- what to inspect first (usually trace)
- a report link (hosted by default, local in offline mode)
- Node.js 18+
@playwright/test1.40+ (newer is recommended)
npm install -D @sentinelqa/playwright-reporterWrap your playwright.config.ts:
import { defineConfig } from "@playwright/test";
import { withSentinel } from "@sentinelqa/playwright-reporter";
export default withSentinel(
defineConfig({
reporter: [["line"]],
outputDir: "test-results",
}),
{
project: "my-app",
},
);Run tests normally:
npx playwright testSentinel is a Playwright reporter that:
- Ensures a Playwright JSON report exists (adds a JSON reporter if needed).
- Collects the artifacts Playwright already produces (
trace.zip, screenshots, video, logs, report.json). - Builds a deterministic failure summary:
- groups repeated failures into 1–3 canonical root causes
- extracts normalized evidence (where, blocker, target state, expected/received)
- Publishes a report:
- default: a hosted share link
- offline: a local HTML report folder (no upload)
This project is intentionally heuristic-driven (not “AI guesses”) for root-cause grouping.
Sentinel behavior is controlled by SENTINEL_MODE.
Do nothing. Sentinel uploads and prints a share link when failures happen.
Environment:
SENTINEL_MODEunset (orSENTINEL_MODE=hosted)
If you have a workspace token:
SENTINEL_TOKEN=your_project_ingest_token npx playwright testEnvironment:
SENTINEL_MODEunset (orSENTINEL_MODE=hosted)SENTINEL_TOKEN=...
To keep everything local:
SENTINEL_MODE=offline npx playwright testOffline mode is strict:
- uploads are skipped
- a local report is generated (default
./sentinel-report/index.html) - the CLI prints a local
file://link (or a relative path)
If a hosted upload fails, Sentinel falls back to generating the local report automatically.
If you set SENTINEL_TOKEN locally, Sentinel will not upload by default (to avoid accidental data egress).
To allow a local upload to your workspace, set:
SENTINEL_UPLOAD_LOCAL=1 SENTINEL_TOKEN=your_project_ingest_token npx playwright testThis is useful for quickly generating a private run history entry from your laptop.
If you are not in CI and you did not set SENTINEL_TOKEN, Sentinel can still upload in public mode by enabling:
SENTINEL_UPLOAD_LOCAL=1 npx playwright test- Hosted mode prints a share URL on failures.
- Offline mode skips uploads and produces only a local report.
Pick the behavior explicitly with SENTINEL_MODE (and SENTINEL_UPLOAD_LOCAL for local uploads).
Local reports are static HTML + copied artifacts. You can open index.html directly, or run a tiny local server:
cd sentinel-report
npx --yes serve -p 4173 .Then open http://localhost:4173.
Sentinel masks common secret patterns before data is shared. This includes:
- environment-variable looking strings
- common credential/token patterns
- internal URLs/hosts (where possible)
If you find something that should be masked but isn’t, file an issue with a minimal reproducible example (redact the secret).
withSentinel() is enough for most setups. If you want richer UI evidence for actionability/timeouts, you can attach the failure capture fixture:
// tests/test.ts
import { test as base, expect } from "@playwright/test";
import { attachSentinelFailureCapture } from "@sentinelqa/playwright-reporter/fixtures";
export const test = attachSentinelFailureCapture(base);
export { expect };Then import from that file in your specs:
import { test, expect } from "./test";withSentinel(config, {
project: "my-app",
playwrightJsonPath: "playwright-report/report.json",
playwrightReportDir: "playwright-report",
testResultsDir: "test-results",
artifactDirs: ["tmp/extra-artifacts"],
verbose: true,
});- Check
SENTINEL_MODE(offline skips uploads). - If using a workspace token, confirm
SENTINEL_TOKENis correct. - If a server schema changed, upgrade the reporter/uploader and/or run DB migrations for self-hosted deployments.
Make sure Playwright produced:
playwright-report/report.jsontest-results/(or your configuredoutputDir)
Then rerun with SENTINEL_MODE=offline to force local generation.
See LICENSE.
