@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 CHANGED
@@ -1,6 +1,11 @@
1
1
  # Playwright Pluse Report
2
2
 
3
- ![Playwright Pulse Report](https://ocpaxmghzmfbuhxzxzae.supabase.co/storage/v1/object/public/images/image.png)
3
+ [![NPM Version](https://img.shields.io/npm/v/@arghajit/playwright-pulse-report.svg)](https://www.npmjs.com/package/@arghajit/playwright-pulse-report)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![NPM Downloads](https://img.shields.io/npm/dm/@arghajit/playwright-pulse-report.svg)](https://www.npmjs.com/package/@arghajit/playwright-pulse-report)
6
+
7
+ ![Playwright Pulse Report](https://ocpaxmghzmfbuhxzxzae.supabase.co/storage/v1/object/public/images/pulse-report/playwright-pulse-report.png)
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
- <img src="https://ocpaxmghzmfbuhxzxzae.supabase.co/storage/v1/object/public/images//pulse-logo.png" alt="pulse dashboard" title="pulse dashboard" height="35px" width="60px" align="left" padding="5px"/>
276
- <h2>Pulse Dashboard</h2>
316
+ ![pulse dashboard](https://ocpaxmghzmfbuhxzxzae.supabase.co/storage/v1/object/public/images/pulse-report/pulse_dashboard_full_icon.png)
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
- (_k = pulseResult.screenshots) === null || _k === void 0 ? void 0 : _k.push(relativeDestPath);
281
+ (_l = pulseResult.screenshots) === null || _l === void 0 ? void 0 : _l.push(relativeDestPath);
281
282
  }
282
283
  else if (attachment.contentType.startsWith("video/")) {
283
- (_l = pulseResult.videoPath) === null || _l === void 0 ? void 0 : _l.push(relativeDestPath);
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
- (_m = pulseResult.attachments) === null || _m === void 0 ? void 0 : _m.push({
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,
@@ -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.3",
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 = path.resolve(process.cwd(), DEFAULT_OUTPUT_DIR);
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