@sentinelqa/playwright-reporter 0.1.53 → 0.1.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +142 -165
- package/dist/localReport.js +812 -34
- package/dist/mode.d.ts +2 -0
- package/dist/mode.js +16 -0
- package/dist/quickDiagnosis.d.ts +42 -2
- package/dist/quickDiagnosis.js +1243 -98
- package/dist/reporter.d.ts +1 -0
- package/dist/reporter.js +102 -25
- package/dist/runHistory.d.ts +3 -0
- package/dist/runHistory.js +11 -1
- package/dist/terminalSummary.js +44 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,210 +1,192 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @sentinelqa/playwright-reporter
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Sample run: https://app.sentinelqa.com/share/1f343d91-be17-4c14-b1b9-2d4e8ef448d2
|
|
6
|
-
|
|
7
|
-
Open it to inspect failures instantly or share it in Slack, PRs, or GitHub issues.
|
|
3
|
+
Deterministic Playwright failure triage: CLI diagnosis, root-cause grouping, and a shareable debugging report.
|
|
8
4
|
|
|
9
5
|
[](https://www.npmjs.com/package/@sentinelqa/playwright-reporter)
|
|
10
6
|
[](https://www.npmjs.com/package/@sentinelqa/playwright-reporter)
|
|
11
7
|
[](./LICENSE)
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
Get a shareable Playwright debugging link with traces, screenshots, and failure context — no setup required.
|
|
9
|
+
## What You Get
|
|
15
10
|
|
|
16
|
-
|
|
11
|
+
SAMPLE REPORT: https://sentinelqa.com/share/run/permanent-demo-playwright-report
|
|
17
12
|
|
|
18
|
-
|
|
13
|
+

|
|
19
14
|
|
|
20
|
-
|
|
21
|
-

|
|
15
|
+
After a failed Playwright run, Sentinel prints:
|
|
22
16
|
|
|
23
|
-
|
|
17
|
+
- a deterministic CLI diagnosis (1–3 root causes)
|
|
18
|
+
- how many tests are affected per root cause
|
|
19
|
+
- what to inspect first (usually trace)
|
|
20
|
+
- a report link (hosted by default, local in offline mode)
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
- Public run page that opens on unified failures across the run
|
|
27
|
-
- Within-run failure grouping so repeated failures collapse into one issue
|
|
28
|
-
- Public failure pages with screenshots, evidence, parsed errors and light summaries
|
|
29
|
-
- Copyable share actions for Slack, PRs, and debugging handoff
|
|
30
|
-
- Deterministic quick diagnosis in the terminal after failed runs
|
|
31
|
-
- Playwright traces, screenshots, videos and logs uploaded automatically
|
|
32
|
-
- 48-hour public share links on the free hosted flow
|
|
33
|
-
- Works with existing Playwright reporter setup
|
|
34
|
-
- Optional live failure capture for richer Sentinel Cloud analysis
|
|
35
|
-
- CI run history, retention, and deeper AI debugging in Sentinel Cloud
|
|
22
|
+
## Requirements
|
|
36
23
|
|
|
37
|
-
|
|
24
|
+
- Node.js 18+
|
|
25
|
+
- `@playwright/test` 1.40+ (newer is recommended)
|
|
38
26
|
|
|
39
|
-
|
|
27
|
+
## Install
|
|
40
28
|
|
|
41
|
-
|
|
29
|
+
```bash
|
|
30
|
+
npm install -D @sentinelqa/playwright-reporter
|
|
31
|
+
```
|
|
42
32
|
|
|
43
|
-
##
|
|
33
|
+
## Setup (Recommended)
|
|
44
34
|
|
|
45
|
-
|
|
35
|
+
Wrap your `playwright.config.ts`:
|
|
46
36
|
|
|
47
|
-
|
|
37
|
+
```ts
|
|
38
|
+
import { defineConfig } from "@playwright/test";
|
|
39
|
+
import { withSentinel } from "@sentinelqa/playwright-reporter";
|
|
48
40
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
41
|
+
export default withSentinel(
|
|
42
|
+
defineConfig({
|
|
43
|
+
reporter: [["line"]],
|
|
44
|
+
outputDir: "test-results",
|
|
45
|
+
}),
|
|
46
|
+
{
|
|
47
|
+
project: "my-app",
|
|
48
|
+
},
|
|
49
|
+
);
|
|
50
|
+
```
|
|
54
51
|
|
|
55
|
-
|
|
52
|
+
Run tests normally:
|
|
56
53
|
|
|
57
|
-
|
|
54
|
+
```bash
|
|
55
|
+
npx playwright test
|
|
56
|
+
```
|
|
58
57
|
|
|
59
|
-
|
|
58
|
+
## How It Works (High Level)
|
|
60
59
|
|
|
61
|
-
|
|
62
|
-
Sentinel diagnosis
|
|
63
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
60
|
+
Sentinel is a Playwright reporter that:
|
|
64
61
|
|
|
65
|
-
|
|
62
|
+
1. Ensures a Playwright JSON report exists (adds a JSON reporter if needed).
|
|
63
|
+
2. Collects the artifacts Playwright already produces (`trace.zip`, screenshots, video, logs, report.json).
|
|
64
|
+
3. Builds a **deterministic** failure summary:
|
|
65
|
+
- groups repeated failures into 1–3 canonical root causes
|
|
66
|
+
- extracts normalized evidence (where, blocker, target state, expected/received)
|
|
67
|
+
4. Publishes a report:
|
|
68
|
+
- default: a hosted share link
|
|
69
|
+
- offline: a local HTML report folder (no upload)
|
|
66
70
|
|
|
67
|
-
|
|
68
|
-
Why: collapsed into 2 real issues
|
|
71
|
+
This project is intentionally heuristic-driven (not “AI guesses”) for root-cause grouping.
|
|
69
72
|
|
|
70
|
-
|
|
71
|
-
Why: getByTestId('metric-pass-rate') showed "82%" instead of "88%"
|
|
72
|
-
Where: app.spec.ts:43, app.spec.ts:69
|
|
73
|
-
Expected: 88%
|
|
74
|
-
Received: 82%
|
|
75
|
-
What changed: "update analytics cards"
|
|
76
|
-
Next: verify getByTestId('metric-pass-rate')
|
|
77
|
-
Impact: 6 tests failing with same root cause
|
|
78
|
-
Clears: fixing this likely clears 6 of 10 failures
|
|
79
|
-
```
|
|
73
|
+
## Modes
|
|
80
74
|
|
|
81
|
-
|
|
75
|
+
Sentinel behavior is controlled by `SENTINEL_MODE`.
|
|
82
76
|
|
|
83
|
-
##
|
|
77
|
+
## Pricing Tiers (How This Maps)
|
|
84
78
|
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
79
|
+
- **Community (Open Source)**
|
|
80
|
+
- “Everything local”: generate the same report UI fully offline, no upload required.
|
|
81
|
+
- “Bring your own storage + DB”: artifacts and metadata stay in your VPC (S3/GCS + Postgres).
|
|
82
|
+
- “Deterministic root-cause clustering”: same grouping logic as the hosted product, no AI guessing.
|
|
83
|
+
- “No limits”: unlimited runs because you own infra.
|
|
84
|
+
- “Security posture”: secrets masking happens before anything leaves your environment (and in offline, nothing leaves).
|
|
85
|
+
- Share links are optional: run in hosted mode when you want a public URL, or offline mode for zero egress.
|
|
90
86
|
|
|
91
|
-
|
|
87
|
+
- **Personal ($0)**
|
|
88
|
+
- “Zero setup”: install + run, auto-upload on failures.
|
|
89
|
+
- “Share links for PRs”: reviewers open a read-only report without reproducing locally.
|
|
90
|
+
- “Retention”: keep enough history to see patterns (200 runs / 14 days).
|
|
91
|
+
- “Safe-by-default”: automatic secret masking before upload.
|
|
92
|
+
- “Works with shards”: parallel jobs still collapse into root-cause clusters.
|
|
92
93
|
|
|
93
|
-
-
|
|
94
|
-
-
|
|
94
|
+
- **Pro ($50/mo)**
|
|
95
|
+
- “Stop repeating fixes”: recurring failure tracking across commits (first seen, frequency, impact).
|
|
96
|
+
- “Compare runs”: last known good vs now, isolate what changed.
|
|
97
|
+
- “Team workflow”: shared workspace, multiple projects, roles.
|
|
98
|
+
- “High volume”: 10,000 run history and longer retention.
|
|
99
|
+
- “Faster decision making”: regressions vs flakes becomes obvious (trend + history).
|
|
95
100
|
|
|
96
|
-
|
|
101
|
+
The reporter package works in all tiers; the difference is where reports live and how much history you get.
|
|
97
102
|
|
|
98
|
-
|
|
103
|
+
### Hosted Mode (Default)
|
|
99
104
|
|
|
100
|
-
|
|
101
|
-
- zero-friction setup
|
|
102
|
-
- hosted Sentinel report link is generated automatically
|
|
103
|
-
- no `SENTINEL_TOKEN` required
|
|
104
|
-
- AI summaries use trace and reporter evidence, but are less precise than live page capture
|
|
105
|
+
Do nothing. Sentinel uploads and prints a share link when failures happen.
|
|
105
106
|
|
|
106
|
-
|
|
107
|
+
Environment:
|
|
107
108
|
|
|
108
|
-
|
|
109
|
-
npm install -D @sentinelqa/playwright-reporter
|
|
110
|
-
```
|
|
109
|
+
- `SENTINEL_MODE` unset (or `SENTINEL_MODE=hosted`)
|
|
111
110
|
|
|
112
|
-
|
|
111
|
+
### Workspace Mode (Private History)
|
|
113
112
|
|
|
114
|
-
|
|
115
|
-
import { defineConfig } from "@playwright/test";
|
|
116
|
-
import { withSentinel } from "@sentinelqa/playwright-reporter";
|
|
113
|
+
If you have a workspace token:
|
|
117
114
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
reporter: [["line"]],
|
|
121
|
-
outputDir: "test-results",
|
|
122
|
-
use: {
|
|
123
|
-
trace: "retain-on-failure",
|
|
124
|
-
screenshot: "only-on-failure",
|
|
125
|
-
video: "retain-on-failure",
|
|
126
|
-
},
|
|
127
|
-
}),
|
|
128
|
-
{
|
|
129
|
-
project: "my-app",
|
|
130
|
-
},
|
|
131
|
-
);
|
|
115
|
+
```bash
|
|
116
|
+
SENTINEL_TOKEN=your_project_ingest_token npx playwright test
|
|
132
117
|
```
|
|
133
118
|
|
|
134
|
-
|
|
119
|
+
Environment:
|
|
120
|
+
|
|
121
|
+
- `SENTINEL_MODE` unset (or `SENTINEL_MODE=hosted`)
|
|
122
|
+
- `SENTINEL_TOKEN=...`
|
|
135
123
|
|
|
136
|
-
|
|
124
|
+
### Offline Mode (No Uploads)
|
|
125
|
+
|
|
126
|
+
To keep everything local:
|
|
137
127
|
|
|
138
128
|
```bash
|
|
139
|
-
npx playwright test
|
|
129
|
+
SENTINEL_MODE=offline npx playwright test
|
|
140
130
|
```
|
|
141
131
|
|
|
142
|
-
|
|
132
|
+
Offline mode is strict:
|
|
143
133
|
|
|
144
|
-
|
|
134
|
+
- uploads are skipped
|
|
135
|
+
- a local report is generated (default `./sentinel-report/index.html`)
|
|
136
|
+
- the CLI prints a local `file://` link (or a relative path)
|
|
145
137
|
|
|
146
|
-
|
|
147
|
-
- within-run grouped failures
|
|
148
|
-
- screenshots and videos
|
|
149
|
-
- trace links
|
|
150
|
-
- parsed failure details
|
|
151
|
-
- light summaries
|
|
152
|
-
- shareable public debugging page
|
|
138
|
+
If a hosted upload fails, Sentinel falls back to generating the local report automatically.
|
|
153
139
|
|
|
154
|
-
|
|
140
|
+
### Local Workspace Uploads (When Not In CI)
|
|
155
141
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
- fast enough to use in CI comments and Slack threads
|
|
159
|
-
- clear upgrade path into a full Sentinel workspace when teams want history, retention, and deeper analysis
|
|
142
|
+
If you set `SENTINEL_TOKEN` locally, Sentinel will _not_ upload by default (to avoid accidental data egress).
|
|
143
|
+
To allow a local upload to your workspace, set:
|
|
160
144
|
|
|
161
|
-
|
|
145
|
+
```bash
|
|
146
|
+
SENTINEL_UPLOAD_LOCAL=1 SENTINEL_TOKEN=your_project_ingest_token npx playwright test
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
This is useful for quickly generating a private run history entry from your laptop.
|
|
150
|
+
|
|
151
|
+
### Implicit Local Public Upload (No Token, Not In CI)
|
|
152
|
+
|
|
153
|
+
If you are not in CI and you did not set `SENTINEL_TOKEN`, Sentinel can still upload in public mode by enabling:
|
|
162
154
|
|
|
163
|
-
|
|
155
|
+
```bash
|
|
156
|
+
SENTINEL_UPLOAD_LOCAL=1 npx playwright test
|
|
157
|
+
```
|
|
164
158
|
|
|
165
|
-
|
|
159
|
+
### Share Links Are Optional (Open Source / Self-Hosted)
|
|
166
160
|
|
|
167
|
-
|
|
161
|
+
- Hosted mode prints a share URL on failures.
|
|
162
|
+
- Offline mode skips uploads and produces only a local report.
|
|
168
163
|
|
|
169
|
-
|
|
170
|
-
- hosted failure pages
|
|
171
|
-
- grouped failures inside the run
|
|
172
|
-
- light summaries
|
|
173
|
-
- copy/share actions
|
|
174
|
-
- 48-hour share links
|
|
164
|
+
Pick the behavior explicitly with `SENTINEL_MODE` (and `SENTINEL_UPLOAD_LOCAL` for local uploads).
|
|
175
165
|
|
|
176
|
-
|
|
166
|
+
## Serving Local Reports
|
|
177
167
|
|
|
178
|
-
|
|
168
|
+
Local reports are static HTML + copied artifacts. You can open `index.html` directly, or run a tiny local server:
|
|
179
169
|
|
|
180
170
|
```bash
|
|
181
|
-
|
|
171
|
+
cd sentinel-report
|
|
172
|
+
npx --yes serve -p 4173 .
|
|
182
173
|
```
|
|
183
174
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
## What `withSentinel()` does
|
|
175
|
+
Then open `http://localhost:4173`.
|
|
187
176
|
|
|
188
|
-
|
|
189
|
-
- Injects a Playwright JSON reporter if one is missing
|
|
190
|
-
- Sets sensible artifact defaults:
|
|
191
|
-
- trace: `retain-on-failure`
|
|
192
|
-
- screenshot: `only-on-failure`
|
|
193
|
-
- video: `retain-on-failure`
|
|
194
|
-
- Uploads the run to hosted Sentinel at the end of the test run
|
|
177
|
+
## Secrets Masking
|
|
195
178
|
|
|
196
|
-
|
|
179
|
+
Sentinel masks common secret patterns before data is shared. This includes:
|
|
197
180
|
|
|
198
|
-
|
|
181
|
+
- environment-variable looking strings
|
|
182
|
+
- common credential/token patterns
|
|
183
|
+
- internal URLs/hosts (where possible)
|
|
199
184
|
|
|
200
|
-
|
|
185
|
+
If you find something that should be masked but isn’t, file an issue with a minimal reproducible example (redact the secret).
|
|
201
186
|
|
|
202
|
-
|
|
203
|
-
- a Playwright reporter does not get the live `page` fixture
|
|
204
|
-
- the live capture fixture lets Sentinel collect richer DOM and code context at the exact failure moment
|
|
205
|
-
- this is required for the highest-quality DOM-aware patches
|
|
187
|
+
## Optional: Richer Failure Evidence
|
|
206
188
|
|
|
207
|
-
|
|
189
|
+
`withSentinel()` is enough for most setups. If you want richer UI evidence for actionability/timeouts, you can attach the failure capture fixture:
|
|
208
190
|
|
|
209
191
|
```ts
|
|
210
192
|
// tests/test.ts
|
|
@@ -215,22 +197,13 @@ export const test = attachSentinelFailureCapture(base);
|
|
|
215
197
|
export { expect };
|
|
216
198
|
```
|
|
217
199
|
|
|
218
|
-
Then import from that file in your specs
|
|
200
|
+
Then import from that file in your specs:
|
|
219
201
|
|
|
220
202
|
```ts
|
|
221
203
|
import { test, expect } from "./test";
|
|
222
204
|
```
|
|
223
205
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
- best AI summaries
|
|
227
|
-
- best fix suggestions
|
|
228
|
-
- richer DOM-aware diagnosis
|
|
229
|
-
- more reliable code patches grounded in real page state
|
|
230
|
-
|
|
231
|
-
Free and local-only users do not need this. The standard `withSentinel()` setup remains the simplest path and will upload a hosted Sentinel report automatically.
|
|
232
|
-
|
|
233
|
-
## Options
|
|
206
|
+
## Configuration Options
|
|
234
207
|
|
|
235
208
|
```ts
|
|
236
209
|
withSentinel(config, {
|
|
@@ -243,19 +216,23 @@ withSentinel(config, {
|
|
|
243
216
|
});
|
|
244
217
|
```
|
|
245
218
|
|
|
246
|
-
##
|
|
219
|
+
## Troubleshooting
|
|
220
|
+
|
|
221
|
+
### “POST /api/runs failed …”
|
|
222
|
+
|
|
223
|
+
- Check `SENTINEL_MODE` (offline skips uploads).
|
|
224
|
+
- If using a workspace token, confirm `SENTINEL_TOKEN` is correct.
|
|
225
|
+
- If a server schema changed, upgrade the reporter/uploader and/or run DB migrations for self-hosted deployments.
|
|
226
|
+
|
|
227
|
+
### “Local report generation failed …”
|
|
228
|
+
|
|
229
|
+
Make sure Playwright produced:
|
|
230
|
+
|
|
231
|
+
- `playwright-report/report.json`
|
|
232
|
+
- `test-results/` (or your configured `outputDir`)
|
|
247
233
|
|
|
248
|
-
|
|
234
|
+
Then rerun with `SENTINEL_MODE=offline` to force local generation.
|
|
249
235
|
|
|
250
|
-
|
|
251
|
-
- CI run history
|
|
252
|
-
- AI-generated failure summaries
|
|
253
|
-
- flaky test detection
|
|
254
|
-
- shareable run links
|
|
255
|
-
- longer retention
|
|
256
|
-
- compare against previous runs
|
|
257
|
-
- recurring failure history
|
|
258
|
-
- richer fix suggestions and team workflows
|
|
236
|
+
## License
|
|
259
237
|
|
|
260
|
-
|
|
261
|
-
Create an account at [sentinelqa.com](https://sentinelqa.com).
|
|
238
|
+
See [LICENSE](./LICENSE).
|