@sentinelqa/playwright-reporter 0.1.53 → 0.1.54
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 +111 -146
- package/dist/localReport.js +360 -32
- package/dist/quickDiagnosis.d.ts +42 -2
- package/dist/quickDiagnosis.js +1326 -112
- package/dist/reporter.js +60 -25
- package/dist/runHistory.d.ts +3 -0
- package/dist/runHistory.js +11 -1
- package/dist/terminalSummary.js +44 -12
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,92 +1,53 @@
|
|
|
1
1
|
# Playwright Reporter
|
|
2
2
|
|
|
3
|
-
After every failed run,
|
|
3
|
+
After every failed Playwright run, Sentinel gives you:
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- a clear CLI diagnosis
|
|
6
|
+
- a shareable debugging link
|
|
7
|
+
- grouped failures by likely root cause
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
Sample run: https://app.sentinelqa.com/share/1f343d91-be17-4c14-b1b9-2d4e8ef448d2
|
|
8
10
|
|
|
9
11
|
[](https://www.npmjs.com/package/@sentinelqa/playwright-reporter)
|
|
10
12
|
[](https://www.npmjs.com/package/@sentinelqa/playwright-reporter)
|
|
11
13
|
[](./LICENSE)
|
|
12
14
|
|
|
13
|
-
From failed CI run
|
|
14
|
-
Get a shareable Playwright debugging link with traces, screenshots, and failure context — no setup required.
|
|
15
|
+
From failed CI run to root cause in seconds.
|
|
15
16
|
|
|
16
|
-
Works with no account
|
|
17
|
-
|
|
18
|
-
Use it to get a shareable hosted run link from CI or local development, then upgrade to Sentinel Cloud for richer history and intelligence.
|
|
17
|
+
Works with no account and no API key.
|
|
19
18
|
|
|
20
19
|

|
|
21
|
-

|
|
48
21
|
|
|
49
|
-
|
|
50
|
-
2. why it broke
|
|
51
|
-
3. where to look
|
|
52
|
-
4. what changed
|
|
53
|
-
5. what to do next
|
|
22
|
+
## What It Does
|
|
54
23
|
|
|
55
|
-
|
|
24
|
+
Sentinel explains Playwright failures locally, groups them into real root causes, and gives you a shareable link to inspect the run.
|
|
56
25
|
|
|
57
|
-
|
|
26
|
+
The open-source reporter is focused on one job:
|
|
58
27
|
|
|
59
|
-
|
|
28
|
+
- tell you what broke
|
|
29
|
+
- show why it failed
|
|
30
|
+
- point to the likely root cause
|
|
31
|
+
- tell you what to check next
|
|
60
32
|
|
|
61
|
-
|
|
62
|
-
Sentinel diagnosis
|
|
63
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
64
|
-
|
|
65
|
-
NEW FAILURE after 8 passing runs
|
|
66
|
-
|
|
67
|
-
What broke: 10 tests failed
|
|
68
|
-
Why: collapsed into 2 real issues
|
|
69
|
-
|
|
70
|
-
Issue 1: UI assertion mismatch (6 tests)
|
|
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
|
-
```
|
|
33
|
+
## Features
|
|
80
34
|
|
|
81
|
-
|
|
35
|
+
- Free hosted debugging links by default
|
|
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
|
|
82
43
|
|
|
83
|
-
## Why
|
|
44
|
+
## Why Teams Use It
|
|
84
45
|
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
46
|
+
- You do not need to open raw logs first
|
|
47
|
+
- Repeated failures collapse into a smaller number of real issues
|
|
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
|
|
90
51
|
|
|
91
52
|
## Requirements
|
|
92
53
|
|
|
@@ -95,14 +56,6 @@ On passed runs, Sentinel stays short and only prints a warning if there is a str
|
|
|
95
56
|
|
|
96
57
|
## Quick Start
|
|
97
58
|
|
|
98
|
-
`withSentinel()` is the default setup for everyone:
|
|
99
|
-
|
|
100
|
-
- best for free and local users
|
|
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
|
-
|
|
106
59
|
Install:
|
|
107
60
|
|
|
108
61
|
```bash
|
|
@@ -131,80 +84,91 @@ export default withSentinel(
|
|
|
131
84
|
);
|
|
132
85
|
```
|
|
133
86
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
Run your Playwright tests:
|
|
87
|
+
Run your tests:
|
|
137
88
|
|
|
138
89
|
```bash
|
|
139
90
|
npx playwright test
|
|
140
91
|
```
|
|
141
92
|
|
|
142
|
-
If tests fail, Sentinel uploads
|
|
93
|
+
If tests fail, Sentinel uploads the run and prints a shareable link in the terminal.
|
|
143
94
|
|
|
144
|
-
|
|
95
|
+
## CLI Output
|
|
145
96
|
|
|
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
|
|
97
|
+
On failed runs, Sentinel prints a compact diagnosis that answers:
|
|
153
98
|
|
|
154
|
-
|
|
99
|
+
1. What failed?
|
|
100
|
+
2. What caused it?
|
|
101
|
+
3. Where is it?
|
|
102
|
+
4. What should I check next?
|
|
155
103
|
|
|
156
|
-
|
|
157
|
-
- public read-only pages
|
|
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
|
|
104
|
+
Typical output:
|
|
160
105
|
|
|
161
|
-
|
|
106
|
+
```text
|
|
107
|
+
Sentinel diagnosis
|
|
108
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
162
109
|
|
|
163
|
-
|
|
110
|
+
RECURRING FAILURE (12 previous runs)
|
|
111
|
+
|
|
112
|
+
❌ 4 failures (grouped)
|
|
113
|
+
Collapsed into 2 real issues
|
|
114
|
+
|
|
115
|
+
Issue 1: Blocked click on getByRole('button', { name: 'Save' }) (3 tests)
|
|
116
|
+
Cause: .modal-backdrop intercepted pointer events before the click completed
|
|
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
|
|
122
|
+
|
|
123
|
+
Issue 2: Assertion mismatch (getByTestId('metric-pass-rate')) (1 test)
|
|
124
|
+
Cause: getByTestId('metric-pass-rate') showed "88%" instead of "100%"
|
|
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
|
|
131
|
+
```
|
|
164
132
|
|
|
165
|
-
|
|
133
|
+
On passed runs, Sentinel stays quiet unless there is a strong risk signal worth surfacing.
|
|
166
134
|
|
|
167
|
-
|
|
135
|
+
## What The Shared Report Shows
|
|
168
136
|
|
|
169
|
-
|
|
170
|
-
- hosted failure pages
|
|
171
|
-
- grouped failures inside the run
|
|
172
|
-
- light summaries
|
|
173
|
-
- copy/share actions
|
|
174
|
-
- 48-hour share links
|
|
137
|
+
The hosted report is simple on purpose.
|
|
175
138
|
|
|
176
|
-
|
|
139
|
+
It focuses on:
|
|
177
140
|
|
|
178
|
-
|
|
141
|
+
- grouped failures
|
|
142
|
+
- explanation of why each issue failed
|
|
143
|
+
- affected tests
|
|
144
|
+
- artifacts
|
|
145
|
+
- recent history
|
|
179
146
|
|
|
180
|
-
|
|
181
|
-
SENTINEL_TOKEN=your_project_ingest_token npx playwright test
|
|
182
|
-
```
|
|
147
|
+
Open the link to inspect:
|
|
183
148
|
|
|
184
|
-
|
|
149
|
+
- failures grouped by likely root cause
|
|
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
|
|
185
154
|
|
|
186
|
-
##
|
|
155
|
+
## Free Hosted Mode
|
|
187
156
|
|
|
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
|
|
157
|
+
If `SENTINEL_TOKEN` is not set, the reporter uploads the run to a free hosted Sentinel report and prints the public share URL.
|
|
195
158
|
|
|
196
|
-
|
|
159
|
+
This free flow includes:
|
|
197
160
|
|
|
198
|
-
|
|
161
|
+
- CLI diagnosis
|
|
162
|
+
- hosted run page
|
|
163
|
+
- grouped failures
|
|
164
|
+
- failure explanation
|
|
165
|
+
- public share links
|
|
199
166
|
|
|
200
|
-
|
|
167
|
+
## Optional Richer Capture
|
|
201
168
|
|
|
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
|
|
169
|
+
`withSentinel()` works on its own and is the simplest setup.
|
|
206
170
|
|
|
207
|
-
|
|
171
|
+
If you want richer failure evidence, you can also attach the failure capture fixture:
|
|
208
172
|
|
|
209
173
|
```ts
|
|
210
174
|
// tests/test.ts
|
|
@@ -215,20 +179,28 @@ export const test = attachSentinelFailureCapture(base);
|
|
|
215
179
|
export { expect };
|
|
216
180
|
```
|
|
217
181
|
|
|
218
|
-
Then import from that file in your specs
|
|
182
|
+
Then import from that file in your specs:
|
|
219
183
|
|
|
220
184
|
```ts
|
|
221
185
|
import { test, expect } from "./test";
|
|
222
186
|
```
|
|
223
187
|
|
|
224
|
-
|
|
188
|
+
This improves the quality of:
|
|
189
|
+
|
|
190
|
+
- blocked action diagnosis
|
|
191
|
+
- assertion mismatch diagnosis
|
|
192
|
+
- timeout explanations
|
|
193
|
+
- DOM and state evidence in the report
|
|
225
194
|
|
|
226
|
-
|
|
227
|
-
- best fix suggestions
|
|
228
|
-
- richer DOM-aware diagnosis
|
|
229
|
-
- more reliable code patches grounded in real page state
|
|
195
|
+
## What `withSentinel()` Does
|
|
230
196
|
|
|
231
|
-
|
|
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
|
|
232
204
|
|
|
233
205
|
## Options
|
|
234
206
|
|
|
@@ -243,19 +215,12 @@ withSentinel(config, {
|
|
|
243
215
|
});
|
|
244
216
|
```
|
|
245
217
|
|
|
246
|
-
##
|
|
218
|
+
## Workspace
|
|
247
219
|
|
|
248
|
-
Sentinel
|
|
220
|
+
If you want private run history, recurring issue tracking, and team access, sign up for a Sentinel workspace and set `SENTINEL_TOKEN`.
|
|
249
221
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
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
|
|
222
|
+
```bash
|
|
223
|
+
SENTINEL_TOKEN=your_project_ingest_token npx playwright test
|
|
224
|
+
```
|
|
259
225
|
|
|
260
|
-
|
|
261
|
-
Create an account at [sentinelqa.com](https://sentinelqa.com).
|
|
226
|
+
Create a workspace at [sentinelqa.com/register](https://sentinelqa.com/register).
|