@sentinelqa/playwright-reporter 0.1.54 → 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 -130
- package/dist/localReport.js +453 -3
- package/dist/mode.d.ts +2 -0
- package/dist/mode.js +16 -0
- package/dist/quickDiagnosis.js +92 -161
- package/dist/reporter.d.ts +1 -0
- package/dist/reporter.js +56 -14
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,68 +1,38 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @sentinelqa/playwright-reporter
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
- a clear CLI diagnosis
|
|
6
|
-
- a shareable debugging link
|
|
7
|
-
- grouped failures by likely root cause
|
|
8
|
-
|
|
9
|
-
Sample run: https://app.sentinelqa.com/share/1f343d91-be17-4c14-b1b9-2d4e8ef448d2
|
|
3
|
+
Deterministic Playwright failure triage: CLI diagnosis, root-cause grouping, and a shareable debugging report.
|
|
10
4
|
|
|
11
5
|
[](https://www.npmjs.com/package/@sentinelqa/playwright-reporter)
|
|
12
6
|
[](https://www.npmjs.com/package/@sentinelqa/playwright-reporter)
|
|
13
7
|
[](./LICENSE)
|
|
14
8
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Works with no account and no API key.
|
|
18
|
-
|
|
19
|
-

|
|
20
|
-

|
|
21
|
-
|
|
22
|
-
## What It Does
|
|
23
|
-
|
|
24
|
-
Sentinel explains Playwright failures locally, groups them into real root causes, and gives you a shareable link to inspect the run.
|
|
25
|
-
|
|
26
|
-
The open-source reporter is focused on one job:
|
|
9
|
+
## What You Get
|
|
27
10
|
|
|
28
|
-
|
|
29
|
-
- show why it failed
|
|
30
|
-
- point to the likely root cause
|
|
31
|
-
- tell you what to check next
|
|
11
|
+
SAMPLE REPORT: https://sentinelqa.com/share/run/permanent-demo-playwright-report
|
|
32
12
|
|
|
33
|
-
|
|
13
|
+

|
|
34
14
|
|
|
35
|
-
|
|
36
|
-
- Deterministic CLI diagnosis after failed runs
|
|
37
|
-
- Failure grouping by likely root cause
|
|
38
|
-
- Shared run page with traces, screenshots, videos, and logs
|
|
39
|
-
- Failure pages that explain what broke, why, where, and what to do next
|
|
40
|
-
- Better timeout, actionability, assertion, navigation, and backend failure wording
|
|
41
|
-
- Public share links that are easy to paste into Slack, PRs, and issues
|
|
42
|
-
- Works with existing Playwright reporter setup
|
|
15
|
+
After a failed Playwright run, Sentinel prints:
|
|
43
16
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
- The CLI explains the failure immediately in CI
|
|
49
|
-
- Anyone on the team can open the same shared debugging link
|
|
50
|
-
- The hosted report keeps the explanation, artifacts, and grouped failures in one place
|
|
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)
|
|
51
21
|
|
|
52
22
|
## Requirements
|
|
53
23
|
|
|
54
24
|
- Node.js 18+
|
|
55
|
-
- `@playwright/test` 1.40+
|
|
56
|
-
|
|
57
|
-
## Quick Start
|
|
25
|
+
- `@playwright/test` 1.40+ (newer is recommended)
|
|
58
26
|
|
|
59
|
-
Install
|
|
27
|
+
## Install
|
|
60
28
|
|
|
61
29
|
```bash
|
|
62
30
|
npm install -D @sentinelqa/playwright-reporter
|
|
63
31
|
```
|
|
64
32
|
|
|
65
|
-
|
|
33
|
+
## Setup (Recommended)
|
|
34
|
+
|
|
35
|
+
Wrap your `playwright.config.ts`:
|
|
66
36
|
|
|
67
37
|
```ts
|
|
68
38
|
import { defineConfig } from "@playwright/test";
|
|
@@ -72,11 +42,6 @@ export default withSentinel(
|
|
|
72
42
|
defineConfig({
|
|
73
43
|
reporter: [["line"]],
|
|
74
44
|
outputDir: "test-results",
|
|
75
|
-
use: {
|
|
76
|
-
trace: "retain-on-failure",
|
|
77
|
-
screenshot: "only-on-failure",
|
|
78
|
-
video: "retain-on-failure",
|
|
79
|
-
},
|
|
80
45
|
}),
|
|
81
46
|
{
|
|
82
47
|
project: "my-app",
|
|
@@ -84,91 +49,144 @@ export default withSentinel(
|
|
|
84
49
|
);
|
|
85
50
|
```
|
|
86
51
|
|
|
87
|
-
Run
|
|
52
|
+
Run tests normally:
|
|
88
53
|
|
|
89
54
|
```bash
|
|
90
55
|
npx playwright test
|
|
91
56
|
```
|
|
92
57
|
|
|
93
|
-
|
|
58
|
+
## How It Works (High Level)
|
|
59
|
+
|
|
60
|
+
Sentinel is a Playwright reporter that:
|
|
61
|
+
|
|
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)
|
|
70
|
+
|
|
71
|
+
This project is intentionally heuristic-driven (not “AI guesses”) for root-cause grouping.
|
|
72
|
+
|
|
73
|
+
## Modes
|
|
74
|
+
|
|
75
|
+
Sentinel behavior is controlled by `SENTINEL_MODE`.
|
|
76
|
+
|
|
77
|
+
## Pricing Tiers (How This Maps)
|
|
78
|
+
|
|
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.
|
|
86
|
+
|
|
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.
|
|
93
|
+
|
|
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).
|
|
100
|
+
|
|
101
|
+
The reporter package works in all tiers; the difference is where reports live and how much history you get.
|
|
102
|
+
|
|
103
|
+
### Hosted Mode (Default)
|
|
104
|
+
|
|
105
|
+
Do nothing. Sentinel uploads and prints a share link when failures happen.
|
|
106
|
+
|
|
107
|
+
Environment:
|
|
108
|
+
|
|
109
|
+
- `SENTINEL_MODE` unset (or `SENTINEL_MODE=hosted`)
|
|
110
|
+
|
|
111
|
+
### Workspace Mode (Private History)
|
|
112
|
+
|
|
113
|
+
If you have a workspace token:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
SENTINEL_TOKEN=your_project_ingest_token npx playwright test
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Environment:
|
|
94
120
|
|
|
95
|
-
|
|
121
|
+
- `SENTINEL_MODE` unset (or `SENTINEL_MODE=hosted`)
|
|
122
|
+
- `SENTINEL_TOKEN=...`
|
|
96
123
|
|
|
97
|
-
|
|
124
|
+
### Offline Mode (No Uploads)
|
|
98
125
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
126
|
+
To keep everything local:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
SENTINEL_MODE=offline npx playwright test
|
|
130
|
+
```
|
|
103
131
|
|
|
104
|
-
|
|
132
|
+
Offline mode is strict:
|
|
105
133
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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)
|
|
109
137
|
|
|
110
|
-
|
|
138
|
+
If a hosted upload fails, Sentinel falls back to generating the local report automatically.
|
|
111
139
|
|
|
112
|
-
|
|
113
|
-
Collapsed into 2 real issues
|
|
140
|
+
### Local Workspace Uploads (When Not In CI)
|
|
114
141
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
Where: checkout.spec.ts:22; billing.spec.ts:41
|
|
118
|
-
Failing step: Click on getByRole('button', { name: 'Save' }) selector
|
|
119
|
-
Blocker: .modal-backdrop intercepting pointer events
|
|
120
|
-
Likely fix: dismiss or wait for .modal-backdrop to disappear before clicking Save
|
|
121
|
-
Impact: 3 tests failing with same root cause
|
|
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:
|
|
122
144
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
Where: app.spec.ts:68
|
|
126
|
-
Failing step: Expect text on getByTestId('metric-pass-rate') selector
|
|
127
|
-
Expected: 100%
|
|
128
|
-
Received: 88%
|
|
129
|
-
Likely fix: fix the UI state or data behind getByTestId('metric-pass-rate') so it shows "100%"
|
|
130
|
-
Impact: 1 test failing with this root cause
|
|
145
|
+
```bash
|
|
146
|
+
SENTINEL_UPLOAD_LOCAL=1 SENTINEL_TOKEN=your_project_ingest_token npx playwright test
|
|
131
147
|
```
|
|
132
148
|
|
|
133
|
-
|
|
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)
|
|
134
152
|
|
|
135
|
-
|
|
153
|
+
If you are not in CI and you did not set `SENTINEL_TOKEN`, Sentinel can still upload in public mode by enabling:
|
|
136
154
|
|
|
137
|
-
|
|
155
|
+
```bash
|
|
156
|
+
SENTINEL_UPLOAD_LOCAL=1 npx playwright test
|
|
157
|
+
```
|
|
138
158
|
|
|
139
|
-
|
|
159
|
+
### Share Links Are Optional (Open Source / Self-Hosted)
|
|
140
160
|
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
- affected tests
|
|
144
|
-
- artifacts
|
|
145
|
-
- recent history
|
|
161
|
+
- Hosted mode prints a share URL on failures.
|
|
162
|
+
- Offline mode skips uploads and produces only a local report.
|
|
146
163
|
|
|
147
|
-
|
|
164
|
+
Pick the behavior explicitly with `SENTINEL_MODE` (and `SENTINEL_UPLOAD_LOCAL` for local uploads).
|
|
148
165
|
|
|
149
|
-
|
|
150
|
-
- whether multiple failures appear related
|
|
151
|
-
- the best available explanation for each issue
|
|
152
|
-
- screenshots, traces, videos, and logs
|
|
153
|
-
- direct links you can share with the rest of the team
|
|
166
|
+
## Serving Local Reports
|
|
154
167
|
|
|
155
|
-
|
|
168
|
+
Local reports are static HTML + copied artifacts. You can open `index.html` directly, or run a tiny local server:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
cd sentinel-report
|
|
172
|
+
npx --yes serve -p 4173 .
|
|
173
|
+
```
|
|
156
174
|
|
|
157
|
-
|
|
175
|
+
Then open `http://localhost:4173`.
|
|
158
176
|
|
|
159
|
-
|
|
177
|
+
## Secrets Masking
|
|
160
178
|
|
|
161
|
-
|
|
162
|
-
- hosted run page
|
|
163
|
-
- grouped failures
|
|
164
|
-
- failure explanation
|
|
165
|
-
- public share links
|
|
179
|
+
Sentinel masks common secret patterns before data is shared. This includes:
|
|
166
180
|
|
|
167
|
-
|
|
181
|
+
- environment-variable looking strings
|
|
182
|
+
- common credential/token patterns
|
|
183
|
+
- internal URLs/hosts (where possible)
|
|
168
184
|
|
|
169
|
-
|
|
185
|
+
If you find something that should be masked but isn’t, file an issue with a minimal reproducible example (redact the secret).
|
|
170
186
|
|
|
171
|
-
|
|
187
|
+
## Optional: Richer Failure Evidence
|
|
188
|
+
|
|
189
|
+
`withSentinel()` is enough for most setups. If you want richer UI evidence for actionability/timeouts, you can attach the failure capture fixture:
|
|
172
190
|
|
|
173
191
|
```ts
|
|
174
192
|
// tests/test.ts
|
|
@@ -185,24 +203,7 @@ Then import from that file in your specs:
|
|
|
185
203
|
import { test, expect } from "./test";
|
|
186
204
|
```
|
|
187
205
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
- blocked action diagnosis
|
|
191
|
-
- assertion mismatch diagnosis
|
|
192
|
-
- timeout explanations
|
|
193
|
-
- DOM and state evidence in the report
|
|
194
|
-
|
|
195
|
-
## What `withSentinel()` Does
|
|
196
|
-
|
|
197
|
-
- Preserves your existing reporter configuration
|
|
198
|
-
- Injects a Playwright JSON reporter if one is missing
|
|
199
|
-
- Sets sensible artifact defaults:
|
|
200
|
-
- trace: `retain-on-failure`
|
|
201
|
-
- screenshot: `only-on-failure`
|
|
202
|
-
- video: `retain-on-failure`
|
|
203
|
-
- Uploads the run to Sentinel at the end of the test run
|
|
204
|
-
|
|
205
|
-
## Options
|
|
206
|
+
## Configuration Options
|
|
206
207
|
|
|
207
208
|
```ts
|
|
208
209
|
withSentinel(config, {
|
|
@@ -215,12 +216,23 @@ withSentinel(config, {
|
|
|
215
216
|
});
|
|
216
217
|
```
|
|
217
218
|
|
|
218
|
-
##
|
|
219
|
+
## Troubleshooting
|
|
219
220
|
|
|
220
|
-
|
|
221
|
+
### “POST /api/runs failed …”
|
|
221
222
|
|
|
222
|
-
|
|
223
|
-
SENTINEL_TOKEN
|
|
224
|
-
|
|
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`)
|
|
233
|
+
|
|
234
|
+
Then rerun with `SENTINEL_MODE=offline` to force local generation.
|
|
235
|
+
|
|
236
|
+
## License
|
|
225
237
|
|
|
226
|
-
|
|
238
|
+
See [LICENSE](./LICENSE).
|