@arghajit/dummy 0.1.3 → 0.3.1
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 +43 -3
- package/dist/reporter/playwright-pulse-reporter.js +5 -4
- package/dist/types/index.d.ts +9 -0
- package/package.json +3 -2
- package/scripts/generate-email-report.mjs +12 -1
- package/scripts/generate-report.mjs +423 -193
- package/scripts/generate-static-report.mjs +258 -51
- package/scripts/generate-trend.mjs +12 -1
- package/scripts/merge-pulse-report.js +10 -1
- package/scripts/sendReport.mjs +16 -6
package/README.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# Playwright Pluse Report
|
|
2
2
|
|
|
3
|
-
](https://www.npmjs.com/package/@arghajit/playwright-pulse-report)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://www.npmjs.com/package/@arghajit/playwright-pulse-report)
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
4
9
|
_The ultimate Playwright reporter — Interactive dashboard with historical trend analytics, CI/CD-ready standalone HTML reports, and sharding support for scalable test execution._
|
|
5
10
|
|
|
6
11
|
## [Live Demo](https://pulse-report.netlify.app/)
|
|
@@ -79,6 +84,42 @@ npx generate-pulse-report # Generates static HTML
|
|
|
79
84
|
npx send-email # Sends email report
|
|
80
85
|
```
|
|
81
86
|
|
|
87
|
+
### 4. Custom Output Directory (Optional)
|
|
88
|
+
|
|
89
|
+
All CLI scripts now support custom output directories, giving you full flexibility over where reports are generated:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Using custom directory
|
|
93
|
+
npx generate-pulse-report --outputDir my-reports
|
|
94
|
+
npx generate-report -o test-results/e2e
|
|
95
|
+
npx send-email --outputDir custom-pulse-reports
|
|
96
|
+
|
|
97
|
+
# Using nested paths
|
|
98
|
+
npx generate-pulse-report --outputDir reports/integration
|
|
99
|
+
npx merge-pulse-report --outputDir my-test-reports
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Important:** Make sure your `playwright.config.ts` custom directory matches the CLI script:
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
import { defineConfig } from "@playwright/test";
|
|
106
|
+
import * as path from "path";
|
|
107
|
+
|
|
108
|
+
const CUSTOM_REPORT_DIR = path.resolve(__dirname, "my-reports");
|
|
109
|
+
|
|
110
|
+
export default defineConfig({
|
|
111
|
+
reporter: [
|
|
112
|
+
["list"],
|
|
113
|
+
[
|
|
114
|
+
"@arghajit/playwright-pulse-report",
|
|
115
|
+
{
|
|
116
|
+
outputDir: CUSTOM_REPORT_DIR, // Must match CLI --outputDir
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
],
|
|
120
|
+
});
|
|
121
|
+
```
|
|
122
|
+
|
|
82
123
|
## 📊 Report Options
|
|
83
124
|
|
|
84
125
|
### Option 1: Static HTML Report (Embedded Attachments)
|
|
@@ -272,8 +313,7 @@ export default defineConfig({
|
|
|
272
313
|
|
|
273
314
|
---
|
|
274
315
|
|
|
275
|
-
|
|
276
|
-
<h2>Pulse Dashboard</h2>
|
|
316
|
+

|
|
277
317
|
|
|
278
318
|
**Real-time Playwright Test Monitoring & Analysis**
|
|
279
319
|
|
|
@@ -197,7 +197,7 @@ class PlaywrightPulseReporter {
|
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
199
|
async onTestEnd(test, result) {
|
|
200
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
200
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
201
201
|
const project = (_a = test.parent) === null || _a === void 0 ? void 0 : _a.project();
|
|
202
202
|
const browserDetails = this.getBrowserDetails(test);
|
|
203
203
|
const testStatus = convertStatus(result.status, test);
|
|
@@ -261,6 +261,7 @@ class PlaywrightPulseReporter {
|
|
|
261
261
|
attachments: [],
|
|
262
262
|
stdout: stdoutMessages.length > 0 ? stdoutMessages : undefined,
|
|
263
263
|
stderr: stderrMessages.length > 0 ? stderrMessages : undefined,
|
|
264
|
+
annotations: ((_k = test.annotations) === null || _k === void 0 ? void 0 : _k.length) > 0 ? test.annotations : undefined,
|
|
264
265
|
...testSpecificData,
|
|
265
266
|
};
|
|
266
267
|
for (const [index, attachment] of result.attachments.entries()) {
|
|
@@ -277,16 +278,16 @@ class PlaywrightPulseReporter {
|
|
|
277
278
|
await this._ensureDirExists(path.dirname(absoluteDestPath));
|
|
278
279
|
await fs.copyFile(attachment.path, absoluteDestPath);
|
|
279
280
|
if (attachment.contentType.startsWith("image/")) {
|
|
280
|
-
(
|
|
281
|
+
(_l = pulseResult.screenshots) === null || _l === void 0 ? void 0 : _l.push(relativeDestPath);
|
|
281
282
|
}
|
|
282
283
|
else if (attachment.contentType.startsWith("video/")) {
|
|
283
|
-
(
|
|
284
|
+
(_m = pulseResult.videoPath) === null || _m === void 0 ? void 0 : _m.push(relativeDestPath);
|
|
284
285
|
}
|
|
285
286
|
else if (attachment.name === "trace") {
|
|
286
287
|
pulseResult.tracePath = relativeDestPath;
|
|
287
288
|
}
|
|
288
289
|
else {
|
|
289
|
-
(
|
|
290
|
+
(_o = pulseResult.attachments) === null || _o === void 0 ? void 0 : _o.push({
|
|
290
291
|
name: attachment.name,
|
|
291
292
|
path: relativeDestPath,
|
|
292
293
|
contentType: attachment.contentType,
|
package/dist/types/index.d.ts
CHANGED
|
@@ -46,6 +46,15 @@ export interface TestResult {
|
|
|
46
46
|
totalWorkers?: number;
|
|
47
47
|
configFile?: string;
|
|
48
48
|
metadata?: string;
|
|
49
|
+
annotations?: {
|
|
50
|
+
type: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
location?: {
|
|
53
|
+
file: string;
|
|
54
|
+
line: number;
|
|
55
|
+
column: number;
|
|
56
|
+
};
|
|
57
|
+
}[];
|
|
49
58
|
}
|
|
50
59
|
export interface TestRun {
|
|
51
60
|
id: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arghajit/dummy",
|
|
3
3
|
"author": "Arghajit Singha",
|
|
4
|
-
"version": "0.1
|
|
4
|
+
"version": "0.3.1",
|
|
5
5
|
"description": "A Playwright reporter and dashboard for visualizing test results.",
|
|
6
6
|
"homepage": "https://playwright-pulse-report.netlify.app/",
|
|
7
7
|
"keywords": [
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"send-report",
|
|
19
19
|
"email",
|
|
20
20
|
"playwright-report",
|
|
21
|
-
"pulse"
|
|
21
|
+
"pulse",
|
|
22
|
+
"ai-failure-analysis"
|
|
22
23
|
],
|
|
23
24
|
"main": "dist/reporter/index.js",
|
|
24
25
|
"types": "dist/reporter/index.d.ts",
|
|
@@ -23,6 +23,15 @@ const DEFAULT_OUTPUT_DIR = "pulse-report";
|
|
|
23
23
|
const DEFAULT_JSON_FILE = "playwright-pulse-report.json";
|
|
24
24
|
const MINIFIED_HTML_FILE = "pulse-email-summary.html"; // New minified report
|
|
25
25
|
|
|
26
|
+
const args = process.argv.slice(2);
|
|
27
|
+
let customOutputDir = null;
|
|
28
|
+
for (let i = 0; i < args.length; i++) {
|
|
29
|
+
if (args[i] === "--outputDir" || args[i] === "-o") {
|
|
30
|
+
customOutputDir = args[i + 1];
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
26
35
|
function sanitizeHTML(str) {
|
|
27
36
|
if (str === null || str === undefined) return "";
|
|
28
37
|
return String(str).replace(/[&<>"']/g, (match) => {
|
|
@@ -652,7 +661,9 @@ function generateMinifiedHTML(reportData) {
|
|
|
652
661
|
`;
|
|
653
662
|
}
|
|
654
663
|
async function main() {
|
|
655
|
-
const outputDir =
|
|
664
|
+
const outputDir = customOutputDir
|
|
665
|
+
? path.resolve(process.cwd(), customOutputDir)
|
|
666
|
+
: path.resolve(process.cwd(), DEFAULT_OUTPUT_DIR);
|
|
656
667
|
const reportJsonPath = path.resolve(outputDir, DEFAULT_JSON_FILE);
|
|
657
668
|
const minifiedReportHtmlPath = path.resolve(outputDir, MINIFIED_HTML_FILE); // Path for the new minified HTML
|
|
658
669
|
|