@sentinelqa/playwright-reporter 0.1.19 → 0.1.20
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/LICENSE +1 -1
- package/README.md +94 -58
- package/dist/reporter.js +12 -12
- package/package.json +10 -2
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,26 +1,48 @@
|
|
|
1
1
|
# Sentinel Playwright Reporter
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
A Playwright reporter that aggregates traces, screenshots, videos, and logs
|
|
8
|
+
into a single debugging report for failed tests.
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
Works locally out of the box with no account required.
|
|
8
11
|
|
|
9
|
-
|
|
12
|
+
Optionally upload runs to Sentinel Cloud for CI history and AI failure analysis.
|
|
13
|
+
|
|
14
|
+

|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
|
|
18
|
+
- Aggregates Playwright traces, screenshots, videos, and logs
|
|
19
|
+
- Generates a local HTML debugging report
|
|
20
|
+
- Works with existing Playwright reporter setup
|
|
21
|
+
- Optional Sentinel Cloud integration
|
|
22
|
+
- CI run history and AI debugging summaries in cloud mode
|
|
23
|
+
|
|
24
|
+
## Why this exists
|
|
25
|
+
|
|
26
|
+
Debugging Playwright CI failures often means downloading traces,
|
|
27
|
+
screenshots, and videos separately.
|
|
28
|
+
|
|
29
|
+
Sentinel Reporter aggregates everything into one debugging report
|
|
30
|
+
so you can quickly understand what failed.
|
|
31
|
+
|
|
32
|
+
## Requirements
|
|
33
|
+
|
|
34
|
+
- Node.js 18+
|
|
35
|
+
- `@playwright/test` 1.40+
|
|
36
|
+
|
|
37
|
+
## Quick Start
|
|
38
|
+
|
|
39
|
+
Install:
|
|
10
40
|
|
|
11
41
|
```bash
|
|
12
42
|
npm install -D @sentinelqa/playwright-reporter
|
|
13
43
|
```
|
|
14
44
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
✔ Collects traces
|
|
18
|
-
✔ Captures screenshots on failure
|
|
19
|
-
✔ Captures videos
|
|
20
|
-
✔ Aggregates logs
|
|
21
|
-
✔ Creates a debugging report
|
|
22
|
-
|
|
23
|
-
## Usage
|
|
45
|
+
Add Sentinel to your Playwright config:
|
|
24
46
|
|
|
25
47
|
```ts
|
|
26
48
|
import { defineConfig } from "@playwright/test";
|
|
@@ -33,80 +55,94 @@ export default withSentinel(
|
|
|
33
55
|
use: {
|
|
34
56
|
trace: "retain-on-failure",
|
|
35
57
|
screenshot: "only-on-failure",
|
|
36
|
-
video: "retain-on-failure"
|
|
37
|
-
}
|
|
58
|
+
video: "retain-on-failure",
|
|
59
|
+
},
|
|
38
60
|
}),
|
|
39
61
|
{
|
|
40
|
-
project: "my-app"
|
|
41
|
-
}
|
|
62
|
+
project: "my-app",
|
|
63
|
+
},
|
|
42
64
|
);
|
|
43
65
|
```
|
|
44
66
|
|
|
45
|
-
|
|
67
|
+
## Example
|
|
68
|
+
|
|
69
|
+
Run your Playwright tests:
|
|
46
70
|
|
|
47
71
|
```bash
|
|
48
72
|
npx playwright test
|
|
49
73
|
```
|
|
50
74
|
|
|
51
|
-
|
|
75
|
+
If tests fail and `SENTINEL_TOKEN` is not set, Sentinel generates:
|
|
52
76
|
|
|
53
|
-
-
|
|
54
|
-
-
|
|
77
|
+
- `sentinel-report/index.html`
|
|
78
|
+
- `sentinel-debug.html`
|
|
55
79
|
|
|
56
|
-
|
|
80
|
+
Open the report to inspect:
|
|
57
81
|
|
|
58
|
-
|
|
82
|
+
- failed tests
|
|
83
|
+
- screenshots
|
|
84
|
+
- videos
|
|
85
|
+
- trace files
|
|
86
|
+
- logs
|
|
59
87
|
|
|
60
|
-
|
|
88
|
+
## Modes
|
|
61
89
|
|
|
62
|
-
|
|
90
|
+
### Local mode
|
|
63
91
|
|
|
64
|
-
|
|
92
|
+
If `SENTINEL_TOKEN` is not set, the reporter generates a local HTML debugging report.
|
|
65
93
|
|
|
66
|
-
|
|
94
|
+
### Cloud mode
|
|
67
95
|
|
|
68
|
-
If `SENTINEL_TOKEN` is set, the reporter uploads to Sentinel instead of generating the local HTML report.
|
|
96
|
+
If `SENTINEL_TOKEN` is set, the reporter uploads the run to Sentinel instead of generating the local HTML report.
|
|
69
97
|
|
|
70
98
|
```bash
|
|
71
|
-
SENTINEL_TOKEN=your_project_ingest_token
|
|
99
|
+
SENTINEL_TOKEN=your_project_ingest_token npx playwright test
|
|
72
100
|
```
|
|
73
101
|
|
|
74
|
-
|
|
102
|
+
For intentional uploads outside CI, also set `SENTINEL_UPLOAD_LOCAL=1` and provide the usual commit and run metadata expected by the uploader.
|
|
75
103
|
|
|
76
|
-
|
|
77
|
-
Playwright CI
|
|
78
|
-
↓
|
|
79
|
-
Sentinel Reporter
|
|
80
|
-
↓
|
|
81
|
-
Artifacts Collected
|
|
82
|
-
↓
|
|
83
|
-
Local Debug Page OR Sentinel Cloud
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
## Optional: Sentinel Cloud
|
|
104
|
+
## What `withSentinel()` does
|
|
87
105
|
|
|
88
|
-
|
|
89
|
-
|
|
106
|
+
- Preserves your existing reporter configuration
|
|
107
|
+
- Injects a Playwright JSON reporter if one is missing
|
|
108
|
+
- Reuses your existing Playwright HTML reporter path when configured
|
|
109
|
+
- Sets sensible artifact defaults:
|
|
110
|
+
- trace: `retain-on-failure`
|
|
111
|
+
- screenshot: `only-on-failure`
|
|
112
|
+
- video: `retain-on-failure`
|
|
90
113
|
|
|
91
|
-
|
|
114
|
+
## Options
|
|
92
115
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
116
|
+
```ts
|
|
117
|
+
withSentinel(config, {
|
|
118
|
+
project: "my-app",
|
|
119
|
+
playwrightJsonPath: "playwright-report/report.json",
|
|
120
|
+
playwrightReportDir: "playwright-report",
|
|
121
|
+
testResultsDir: "test-results",
|
|
122
|
+
artifactDirs: ["tmp/extra-artifacts"],
|
|
123
|
+
verbose: true,
|
|
124
|
+
localReportDir: "sentinel-report",
|
|
125
|
+
localReportFileName: "index.html",
|
|
126
|
+
localRedirectFileName: "sentinel-debug.html",
|
|
127
|
+
});
|
|
128
|
+
```
|
|
98
129
|
|
|
99
|
-
|
|
130
|
+
## Sentinel Cloud (optional)
|
|
100
131
|
|
|
101
|
-
|
|
132
|
+
Sentinel Cloud adds:
|
|
102
133
|
|
|
103
|
-
-
|
|
104
|
-
-
|
|
134
|
+
- hosted debugging dashboards
|
|
135
|
+
- CI run history
|
|
136
|
+
- AI-generated failure summaries
|
|
137
|
+
- flaky test detection
|
|
138
|
+
- shareable run links
|
|
105
139
|
|
|
106
|
-
|
|
140
|
+
Free for up to 100 CI runs per month.
|
|
141
|
+
Create an account at [sentinelqa.com](https://sentinelqa.com).
|
|
107
142
|
|
|
108
|
-
##
|
|
143
|
+
## Publish Checklist
|
|
109
144
|
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
145
|
+
- Confirm `repository`, `homepage`, and `bugs` point at this repo
|
|
146
|
+
- Run `npm run build`
|
|
147
|
+
- Run `npm pack --dry-run`
|
|
148
|
+
- Verify `dist/` is included in the published tarball
|
package/dist/reporter.js
CHANGED
|
@@ -86,9 +86,7 @@ class SentinelReporter {
|
|
|
86
86
|
}
|
|
87
87
|
async onEnd() {
|
|
88
88
|
const hasSentinelToken = Boolean(process.env.SENTINEL_TOKEN);
|
|
89
|
-
|
|
90
|
-
const localUploadEnabled = (0, node_1.isLocalUploadEnabled)(process.env);
|
|
91
|
-
if (!hasSentinelToken || (!hasCiEnv && !localUploadEnabled)) {
|
|
89
|
+
if (!hasSentinelToken) {
|
|
92
90
|
const localReport = (0, localReport_1.generateLocalDebugReport)({
|
|
93
91
|
playwrightJsonPath: this.options.playwrightJsonPath,
|
|
94
92
|
playwrightReportDir: this.options.playwrightReportDir,
|
|
@@ -100,11 +98,16 @@ class SentinelReporter {
|
|
|
100
98
|
});
|
|
101
99
|
this.printLocalReport(localReport.htmlPath);
|
|
102
100
|
console.log("");
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const hasCiEnv = (0, node_1.hasSupportedCiEnv)(process.env);
|
|
104
|
+
const localUploadEnabled = (0, node_1.isLocalUploadEnabled)(process.env);
|
|
105
|
+
console.log("");
|
|
106
|
+
console.log("Uploading failure artifacts to Sentinel...");
|
|
107
|
+
console.log("");
|
|
108
|
+
if (!hasCiEnv && !localUploadEnabled) {
|
|
109
|
+
console.log("Local upload mode detected.");
|
|
110
|
+
console.log("If this run is outside CI, set SENTINEL_UPLOAD_LOCAL=1 and provide the required CI metadata.");
|
|
108
111
|
console.log("");
|
|
109
112
|
console.log("Typical local upload environment variables:");
|
|
110
113
|
console.log("• SENTINEL_UPLOAD_LOCAL=1");
|
|
@@ -112,11 +115,8 @@ class SentinelReporter {
|
|
|
112
115
|
console.log("• CI_COMMIT_REF_NAME or GITHUB_REF_NAME");
|
|
113
116
|
console.log("• CI_JOB_URL or a matching run URL");
|
|
114
117
|
console.log("• CI_PIPELINE_ID or GITHUB_RUN_ID");
|
|
115
|
-
|
|
118
|
+
console.log("");
|
|
116
119
|
}
|
|
117
|
-
console.log("");
|
|
118
|
-
console.log("Uploading failure artifacts to Sentinel...");
|
|
119
|
-
console.log("");
|
|
120
120
|
const exitCode = await (0, node_1.runSentinelUpload)({
|
|
121
121
|
playwrightJsonPath: this.options.playwrightJsonPath,
|
|
122
122
|
playwrightReportDir: this.options.playwrightReportDir,
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentinelqa/playwright-reporter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Playwright reporter for CI debugging with optional Sentinel cloud dashboards",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/sentinelqa/
|
|
9
|
+
"url": "https://github.com/sentinelqa/playwright-reporter.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/sentinelqa/playwright-reporter#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/sentinelqa/playwright-reporter/issues"
|
|
10
14
|
},
|
|
11
15
|
"keywords": [
|
|
12
16
|
"sentinelqa",
|
|
@@ -36,6 +40,10 @@
|
|
|
36
40
|
"dependencies": {
|
|
37
41
|
"@sentinelqa/uploader": "^0.1.23"
|
|
38
42
|
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/node": "^20.19.32",
|
|
45
|
+
"typescript": "^5.9.3"
|
|
46
|
+
},
|
|
39
47
|
"scripts": {
|
|
40
48
|
"build": "tsc -p tsconfig.json",
|
|
41
49
|
"prepublishOnly": "npm run build",
|