@arghajit/playwright-pulse-report 0.2.5 → 0.2.6

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
@@ -16,7 +16,7 @@ The project provides these utility commands:
16
16
  | Command | Description |
17
17
  |------------------------|-----------------------------------------------------------------------------|
18
18
  | `generate-report` | Generates playwright-pulse-report.html, Loads screenshots and images dynamically from the attachments/ directory, Produces a lighter HTML file with faster initial load, Requires attachments/ directory to be present when viewing the report |
19
- | `generate-pulse-report`| Generates `playwright-pulse-static-report.html`, Self-contained, no server required, Preserves all dashboard functionality |
19
+ | `generate-pulse-report`| Generates `playwright-pulse-static-report.html`, Self-contained, no server required, Preserves all dashboard functionality, all the attachments are embadded in the report, no need to have attachments/ directory when viewing the report, with a dark theme and better initial load handling |
20
20
  | `merge-pulse-report` | Combines multiple parallel test json reports, basically used in sharding |
21
21
  | `generate-trend` | Analyzes historical trends in test results |
22
22
  | `generate-email-report`| Generates email-friendly report versions |
@@ -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;
200
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
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);
@@ -252,6 +252,7 @@ class PlaywrightPulseReporter {
252
252
  steps: ((_f = result.steps) === null || _f === void 0 ? void 0 : _f.length) ? await processAllSteps(result.steps) : [],
253
253
  errorMessage: (_g = result.error) === null || _g === void 0 ? void 0 : _g.message,
254
254
  stackTrace: (_h = result.error) === null || _h === void 0 ? void 0 : _h.stack,
255
+ snippet: (_j = result.error) === null || _j === void 0 ? void 0 : _j.snippet,
255
256
  codeSnippet: codeSnippet,
256
257
  tags: test.tags.map((tag) => tag.startsWith("@") ? tag.substring(1) : tag),
257
258
  screenshots: [],
@@ -276,16 +277,16 @@ class PlaywrightPulseReporter {
276
277
  await this._ensureDirExists(path.dirname(absoluteDestPath));
277
278
  await fs.copyFile(attachment.path, absoluteDestPath);
278
279
  if (attachment.contentType.startsWith("image/")) {
279
- (_j = pulseResult.screenshots) === null || _j === void 0 ? void 0 : _j.push(relativeDestPath);
280
+ (_k = pulseResult.screenshots) === null || _k === void 0 ? void 0 : _k.push(relativeDestPath);
280
281
  }
281
282
  else if (attachment.contentType.startsWith("video/")) {
282
- (_k = pulseResult.videoPath) === null || _k === void 0 ? void 0 : _k.push(relativeDestPath);
283
+ (_l = pulseResult.videoPath) === null || _l === void 0 ? void 0 : _l.push(relativeDestPath);
283
284
  }
284
285
  else if (attachment.name === "trace") {
285
286
  pulseResult.tracePath = relativeDestPath;
286
287
  }
287
288
  else {
288
- (_l = pulseResult.attachments) === null || _l === void 0 ? void 0 : _l.push({
289
+ (_m = pulseResult.attachments) === null || _m === void 0 ? void 0 : _m.push({
289
290
  name: attachment.name,
290
291
  path: relativeDestPath,
291
292
  contentType: attachment.contentType,
@@ -1,4 +1,4 @@
1
- import type { LucideIcon } from 'lucide-react';
1
+ import type { LucideIcon } from "lucide-react";
2
2
  export type TestStatus = "passed" | "failed" | "skipped" | "expected-failure" | "unexpected-success" | "explicitly-skipped";
3
3
  export interface TestStep {
4
4
  id: string;
@@ -26,6 +26,7 @@ export interface TestResult {
26
26
  steps: TestStep[];
27
27
  errorMessage?: string;
28
28
  stackTrace?: string;
29
+ snippet?: string;
29
30
  codeSnippet?: string;
30
31
  tags?: string[];
31
32
  suiteName?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arghajit/playwright-pulse-report",
3
3
  "author": "Arghajit Singha",
4
- "version": "0.2.5",
4
+ "version": "0.2.6",
5
5
  "description": "A Playwright reporter and dashboard for visualizing test results.",
6
6
  "homepage": "https://playwright-pulse-report.netlify.app/",
7
7
  "keywords": [