@arghajit/dummy 0.1.0-beta-12 → 0.1.0-beta-14
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 +32 -18
- package/dist/reporter/playwright-pulse-reporter.d.ts +1 -0
- package/dist/reporter/playwright-pulse-reporter.js +35 -0
- package/dist/types/index.d.ts +17 -0
- package/package.json +10 -7
- package/scripts/generate-email-report.mjs +576 -0
- package/scripts/generate-static-report.mjs +603 -991
- package/scripts/{sendReport.js → sendReport.mjs} +138 -71
package/README.md
CHANGED
|
@@ -11,27 +11,49 @@
|
|
|
11
11
|
|
|
12
12
|
### 🖥️ Desktop View
|
|
13
13
|
|
|
14
|
-
<div align="center" style="display: flex; gap: 20px; justify-content: center; flex-wrap: wrap;">
|
|
14
|
+
<div align="center" style="display: flex; gap: 20px; justify-content: center; flex-wrap: wrap;">
|
|
15
|
+
<a href="https://ocpaxmghzmfbuhxzxzae.supabase.co/storage/v1/object/public/images//playwright-pulse-static-report-desktop.html.png" target="_blank"> <img src="https://ocpaxmghzmfbuhxzxzae.supabase.co/storage/v1/object/public/images//playwright-pulse-static-report-desktop.html.png" alt="Dashboard Overview" width="300"/>
|
|
16
|
+
<p align="center"><strong>Dashboard Overview</strong></p>
|
|
17
|
+
</a>
|
|
18
|
+
<a href="https://ocpaxmghzmfbuhxzxzae.supabase.co/storage/v1/object/public/images//Test-run-desktop.png" target="_blank"> <img src="https://ocpaxmghzmfbuhxzxzae.supabase.co/storage/v1/object/public/images//Test-run-desktop.png" alt="Test Details" width="300"/>
|
|
19
|
+
<p align="center"><strong>Test Details</strong>
|
|
20
|
+
</p>
|
|
21
|
+
</a>
|
|
22
|
+
<a href="https://ocpaxmghzmfbuhxzxzae.supabase.co/storage/v1/object/public/images//Test-error-desktop.png" target="_blank"> <img src="https://ocpaxmghzmfbuhxzxzae.supabase.co/storage/v1/object/public/images//Test-run-desktop.png" alt="Test Failure Details" width="300"/>
|
|
23
|
+
<p align="center"><strong>Test Failure Details</strong>
|
|
24
|
+
</p>
|
|
25
|
+
</a>
|
|
26
|
+
<a href="https://ocpaxmghzmfbuhxzxzae.supabase.co/storage/v1/object/public/images//Test-trends-desktop.png" target="_blank"> <img src="https://ocpaxmghzmfbuhxzxzae.supabase.co/storage/v1/object/public/images//Test-trends-desktop.png" alt="Filter View" width="300"/>
|
|
27
|
+
<p align="center"><strong>Test Trends</strong></p>
|
|
28
|
+
</a>
|
|
29
|
+
</div>
|
|
15
30
|
|
|
16
31
|
### 📱 Mobile View
|
|
17
32
|
|
|
18
33
|
<div align="center" style="display: flex; gap: 20px; justify-content: center; flex-wrap: wrap;">
|
|
19
34
|
|
|
20
35
|
<a href="https://postimg.cc/CzJBLR5N" target="_blank">
|
|
21
|
-
<img src="https://ocpaxmghzmfbuhxzxzae.supabase.co/storage/v1/object/public/images
|
|
36
|
+
<img src="https://ocpaxmghzmfbuhxzxzae.supabase.co/storage/v1/object/public/images//playwright-pulse-static-report-Dashboard.html.png" alt="Mobile Dashboard Overview" width="300"/>
|
|
22
37
|
<p align="center"><strong>Dashboard Overview</strong></p>
|
|
23
38
|
</a>
|
|
24
39
|
|
|
25
40
|
<a href="https://postimg.cc/G8YTczT8" target="_blank">
|
|
26
|
-
<img src="https://ocpaxmghzmfbuhxzxzae.supabase.co/storage/v1/object/public/images
|
|
41
|
+
<img src="https://ocpaxmghzmfbuhxzxzae.supabase.co/storage/v1/object/public/images//playwright-pulse-static-report_Test-results.html.png" alt="Test Details" width="300"/>
|
|
27
42
|
<p align="center"><strong>Test Details</strong></p>
|
|
28
43
|
</a>
|
|
29
44
|
|
|
45
|
+
<a href="https://postimg.cc/G8YTczT8" target="_blank">
|
|
46
|
+
<img src="https://ocpaxmghzmfbuhxzxzae.supabase.co/storage/v1/object/public/images//playwright-pulse-static-report-Trends.html.png" alt="Test Trends" width="300"/>
|
|
47
|
+
<p align="center"><strong>Test Trends</strong></p>
|
|
48
|
+
</a>
|
|
49
|
+
|
|
30
50
|
</div>
|
|
31
51
|
|
|
32
52
|
### Email Report Example
|
|
33
53
|
|
|
34
|
-
[](https://ocpaxmghzmfbuhxzxzae.supabase.co/storage/v1/object/public/images//Email-report-mobile-template.jpeg)
|
|
55
|
+
|
|
56
|
+
[](https://ocpaxmghzmfbuhxzxzae.supabase.co/storage/v1/object/public/images//pulse-email-summary.html.png)
|
|
35
57
|
|
|
36
58
|
## 🛠️ How It Works
|
|
37
59
|
|
|
@@ -51,11 +73,11 @@
|
|
|
51
73
|
### 1. Installation
|
|
52
74
|
|
|
53
75
|
```bash
|
|
54
|
-
npm install @arghajit/playwright-pulse-
|
|
76
|
+
npm install @arghajit/playwright-pulse-report@latest --save-dev
|
|
55
77
|
# or
|
|
56
|
-
yarn add @arghajit/playwright-pulse-
|
|
78
|
+
yarn add @arghajit/playwright-pulse-report@latest --dev
|
|
57
79
|
# or
|
|
58
|
-
pnpm add @arghajit/playwright-pulse-
|
|
80
|
+
pnpm add @arghajit/playwright-pulse-report@latest --save-dev
|
|
59
81
|
```
|
|
60
82
|
|
|
61
83
|
### 2. Configure Playwright
|
|
@@ -71,7 +93,7 @@ const PULSE_REPORT_DIR = path.resolve(__dirname, 'pulse-report');
|
|
|
71
93
|
export default defineConfig({
|
|
72
94
|
reporter: [
|
|
73
95
|
['list'],
|
|
74
|
-
['@arghajit/playwright-pulse-
|
|
96
|
+
['@arghajit/playwright-pulse-report', {
|
|
75
97
|
outputDir: PULSE_REPORT_DIR
|
|
76
98
|
}]
|
|
77
99
|
],
|
|
@@ -116,6 +138,8 @@ npx generate-pulse-report
|
|
|
116
138
|
npx send-email
|
|
117
139
|
```
|
|
118
140
|
|
|
141
|
+
NOTE: The email will be send with a light-weight html file, which can be opened in mail preview application.
|
|
142
|
+
|
|
119
143
|
## 🤖 AI Analysis
|
|
120
144
|
|
|
121
145
|
The dashboard includes AI-powered test analysis that provides:
|
|
@@ -211,16 +235,6 @@ The dashboard includes AI-powered test analysis that provides:
|
|
|
211
235
|
|
|
212
236
|
## 
|
|
213
237
|
|
|
214
|
-
## 🎉 What's New in v0.2.1
|
|
215
|
-
|
|
216
|
-
### ✨ **Key Improvements**
|
|
217
|
-
|
|
218
|
-
| Feature | Description |
|
|
219
|
-
|---------|-------------|
|
|
220
|
-
| **🎨 Refined UI** | Completely redesigned static HTML reports for better readability and navigation |
|
|
221
|
-
| **📊 History Trends** | Visual analytics for:<br>• Test History for last 15 runs<br>• Test suite pass/fail rates<br>• Duration trends<br>• Individual test flakiness |
|
|
222
|
-
| **🛠️ Project Fixes** | Corrected project name display in test suite components |
|
|
223
|
-
|
|
224
238
|
### 🚀 **Upgrade Now**
|
|
225
239
|
|
|
226
240
|
```bash
|
|
@@ -19,6 +19,7 @@ export declare class PlaywrightPulseReporter implements Reporter {
|
|
|
19
19
|
private processStep;
|
|
20
20
|
onTestEnd(test: TestCase, result: PwTestResult): Promise<void>;
|
|
21
21
|
onError(error: any): void;
|
|
22
|
+
private _getEnvDetails;
|
|
22
23
|
private _writeShardResults;
|
|
23
24
|
private _mergeShardResults;
|
|
24
25
|
private _cleanupTemporaryFiles;
|
|
@@ -40,6 +40,7 @@ const path = __importStar(require("path"));
|
|
|
40
40
|
const crypto_1 = require("crypto");
|
|
41
41
|
const attachment_utils_1 = require("./attachment-utils"); // Use relative path
|
|
42
42
|
const ua_parser_js_1 = require("ua-parser-js"); // Added UAParser import
|
|
43
|
+
const os = __importStar(require("os"));
|
|
43
44
|
const convertStatus = (status, testCase) => {
|
|
44
45
|
if ((testCase === null || testCase === void 0 ? void 0 : testCase.expectedStatus) === "failed") {
|
|
45
46
|
return "failed";
|
|
@@ -244,6 +245,15 @@ class PlaywrightPulseReporter {
|
|
|
244
245
|
});
|
|
245
246
|
}
|
|
246
247
|
const uniqueTestId = test.id;
|
|
248
|
+
// --- ADDED THIS SECTION for testData ---
|
|
249
|
+
const testSpecificData = {
|
|
250
|
+
workerId: result.workerIndex,
|
|
251
|
+
totalWorkers: this.config.workers,
|
|
252
|
+
configFile: this.config.configFile,
|
|
253
|
+
metadata: this.config.metadata
|
|
254
|
+
? JSON.stringify(this.config.metadata)
|
|
255
|
+
: undefined,
|
|
256
|
+
};
|
|
247
257
|
const pulseResult = {
|
|
248
258
|
id: uniqueTestId,
|
|
249
259
|
runId: "TBD",
|
|
@@ -265,6 +275,8 @@ class PlaywrightPulseReporter {
|
|
|
265
275
|
tracePath: undefined,
|
|
266
276
|
stdout: stdoutMessages.length > 0 ? stdoutMessages : undefined,
|
|
267
277
|
stderr: stderrMessages.length > 0 ? stderrMessages : undefined,
|
|
278
|
+
// --- ADDED THESE LINES from testSpecificData ---
|
|
279
|
+
...testSpecificData,
|
|
268
280
|
};
|
|
269
281
|
try {
|
|
270
282
|
(0, attachment_utils_1.attachFiles)(testIdForFiles, result, pulseResult, this.options);
|
|
@@ -289,6 +301,20 @@ class PlaywrightPulseReporter {
|
|
|
289
301
|
console.error(error.stack);
|
|
290
302
|
}
|
|
291
303
|
}
|
|
304
|
+
_getEnvDetails() {
|
|
305
|
+
return {
|
|
306
|
+
host: os.hostname(),
|
|
307
|
+
os: `${os.platform()} ${os.release()}`,
|
|
308
|
+
cpu: {
|
|
309
|
+
model: os.cpus()[0] ? os.cpus()[0].model : "N/A", // Handle cases with no CPU info
|
|
310
|
+
cores: os.cpus().length,
|
|
311
|
+
},
|
|
312
|
+
memory: `${(os.totalmem() / 1024 ** 3).toFixed(2)}GB`, // Total RAM in GB
|
|
313
|
+
node: process.version,
|
|
314
|
+
v8: process.versions.v8,
|
|
315
|
+
cwd: process.cwd(),
|
|
316
|
+
};
|
|
317
|
+
}
|
|
292
318
|
async _writeShardResults() {
|
|
293
319
|
if (this.shardIndex === undefined) {
|
|
294
320
|
return;
|
|
@@ -383,6 +409,8 @@ class PlaywrightPulseReporter {
|
|
|
383
409
|
const runEndTime = Date.now();
|
|
384
410
|
const duration = runEndTime - this.runStartTime;
|
|
385
411
|
const runId = `run-${this.runStartTime}-581d5ad8-ce75-4ca5-94a6-ed29c466c815`; // Need not to change
|
|
412
|
+
// --- CALLING _getEnvDetails HERE ---
|
|
413
|
+
const environmentDetails = this._getEnvDetails();
|
|
386
414
|
const runData = {
|
|
387
415
|
id: runId,
|
|
388
416
|
timestamp: new Date(this.runStartTime),
|
|
@@ -391,10 +419,16 @@ class PlaywrightPulseReporter {
|
|
|
391
419
|
failed: 0,
|
|
392
420
|
skipped: 0,
|
|
393
421
|
duration,
|
|
422
|
+
// --- ADDED environmentDetails HERE ---
|
|
423
|
+
environment: environmentDetails,
|
|
394
424
|
};
|
|
395
425
|
let finalReport = undefined; // Initialize as undefined
|
|
396
426
|
if (this.isSharded) {
|
|
397
427
|
finalReport = await this._mergeShardResults(runData);
|
|
428
|
+
// Ensured environment details are on the final merged runData if not already
|
|
429
|
+
if (finalReport && finalReport.run && !finalReport.run.environment) {
|
|
430
|
+
finalReport.run.environment = environmentDetails;
|
|
431
|
+
}
|
|
398
432
|
}
|
|
399
433
|
else {
|
|
400
434
|
this.results.forEach((r) => (r.runId = runId));
|
|
@@ -441,6 +475,7 @@ PlaywrightPulseReporter: Run Finished
|
|
|
441
475
|
failed: 0,
|
|
442
476
|
skipped: 0,
|
|
443
477
|
duration: duration,
|
|
478
|
+
environment: environmentDetails,
|
|
444
479
|
},
|
|
445
480
|
results: [],
|
|
446
481
|
metadata: {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -36,6 +36,10 @@ export interface TestResult {
|
|
|
36
36
|
tracePath?: string;
|
|
37
37
|
stdout?: string[];
|
|
38
38
|
stderr?: string[];
|
|
39
|
+
workerId?: number;
|
|
40
|
+
totalWorkers?: number;
|
|
41
|
+
configFile?: string;
|
|
42
|
+
metadata?: string;
|
|
39
43
|
}
|
|
40
44
|
export interface TestRun {
|
|
41
45
|
id: string;
|
|
@@ -45,6 +49,7 @@ export interface TestRun {
|
|
|
45
49
|
failed: number;
|
|
46
50
|
skipped: number;
|
|
47
51
|
duration: number;
|
|
52
|
+
environment?: EnvDetails;
|
|
48
53
|
}
|
|
49
54
|
export interface TrendDataPoint {
|
|
50
55
|
date: string;
|
|
@@ -63,3 +68,15 @@ export interface PlaywrightPulseReporterOptions {
|
|
|
63
68
|
outputDir?: string;
|
|
64
69
|
base64Images?: boolean;
|
|
65
70
|
}
|
|
71
|
+
export interface EnvDetails {
|
|
72
|
+
host: string;
|
|
73
|
+
os: string;
|
|
74
|
+
cpu: {
|
|
75
|
+
model: string;
|
|
76
|
+
cores: number;
|
|
77
|
+
};
|
|
78
|
+
memory: string;
|
|
79
|
+
node: string;
|
|
80
|
+
v8: string;
|
|
81
|
+
cwd: string;
|
|
82
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arghajit/dummy",
|
|
3
3
|
"author": "Arghajit Singha",
|
|
4
|
-
"version": "0.1.0-beta-
|
|
4
|
+
"version": "0.1.0-beta-14",
|
|
5
5
|
"description": "A Playwright reporter and dashboard for visualizing test results.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"playwright",
|
|
@@ -27,8 +27,9 @@
|
|
|
27
27
|
"bin": {
|
|
28
28
|
"generate-pulse-report": "./scripts/generate-static-report.mjs",
|
|
29
29
|
"merge-pulse-report": "./scripts/merge-pulse-report.js",
|
|
30
|
-
"send-email": "./scripts/sendReport.
|
|
31
|
-
"generate-trend": "./scripts/generate-trend.mjs"
|
|
30
|
+
"send-email": "./scripts/sendReport.mjs",
|
|
31
|
+
"generate-trend": "./scripts/generate-trend.mjs",
|
|
32
|
+
"generate-email-report": "./scripts/generate-email-report.mjs"
|
|
32
33
|
},
|
|
33
34
|
"exports": {
|
|
34
35
|
".": {
|
|
@@ -42,7 +43,8 @@
|
|
|
42
43
|
"prepublishOnly": "npm run build:reporter",
|
|
43
44
|
"report:static": "node ./scripts/generate-static-report.mjs",
|
|
44
45
|
"report:merge": "node ./scripts/merge-pulse-report.js",
|
|
45
|
-
"report:email": "node ./scripts/sendReport.
|
|
46
|
+
"report:email": "node ./scripts/sendReport.mjs",
|
|
47
|
+
"report:minify": "node ./scripts/generate-email-report.mjs"
|
|
46
48
|
},
|
|
47
49
|
"dependencies": {
|
|
48
50
|
"archiver": "^7.0.1",
|
|
@@ -53,18 +55,19 @@
|
|
|
53
55
|
"dotenv": "^16.5.0",
|
|
54
56
|
"highcharts": "^12.2.0",
|
|
55
57
|
"jsdom": "^26.1.0",
|
|
58
|
+
"lucide-react": "^0.475.0",
|
|
59
|
+
"node-fetch": "^3.3.2",
|
|
56
60
|
"nodemailer": "^7.0.3",
|
|
57
61
|
"patch-package": "^8.0.0",
|
|
58
62
|
"recharts": "^2.15.1",
|
|
59
63
|
"ua-parser-js": "^2.0.3",
|
|
60
|
-
"zod": "^3.24.2"
|
|
61
|
-
"lucide-react": "^0.475.0",
|
|
62
|
-
"node-fetch": "^3.3.2"
|
|
64
|
+
"zod": "^3.24.2"
|
|
63
65
|
},
|
|
64
66
|
"devDependencies": {
|
|
65
67
|
"@types/node": "^20",
|
|
66
68
|
"@types/ua-parser-js": "^0.7.39",
|
|
67
69
|
"eslint": "9.25.1",
|
|
70
|
+
"pretty-ansi": "^3.0.0",
|
|
68
71
|
"typescript": "^5"
|
|
69
72
|
},
|
|
70
73
|
"engines": {
|