@arghajit/dummy 0.1.0-beta-26 → 0.1.0-beta-27

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.
@@ -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/dummy",
3
3
  "author": "Arghajit Singha",
4
- "version": "0.1.0-beta-26",
4
+ "version": "0.1.0-beta-27",
5
5
  "description": "A Playwright reporter and dashboard for visualizing test results.",
6
6
  "homepage": "https://playwright-pulse-report.netlify.app/",
7
7
  "keywords": [
@@ -548,7 +548,7 @@ function generateMinifiedHTML(reportData) {
548
548
  <footer class="report-footer">
549
549
  <div style="display: inline-flex; align-items: center; gap: 0.5rem;">
550
550
  <span>Created for</span>
551
- <a href="https://github.com/Arghajit47" target="_blank" rel="noopener noreferrer">
551
+ <a href="https://playwright-pulse-report.netlify.app/" target="_blank" rel="noopener noreferrer">
552
552
  Pulse Email Report
553
553
  </a>
554
554
  </div>
@@ -1700,6 +1700,13 @@ function generateHTML(reportData, trendData = null) {
1700
1700
  </div>`
1701
1701
  : ""
1702
1702
  }
1703
+ ${
1704
+ test.snippet
1705
+ ? `<div class="code-section"><h4>Error Snippet</h4><pre><code>${formatPlaywrightError(
1706
+ test.snippet
1707
+ )}</code></pre></div>`
1708
+ : ""
1709
+ }
1703
1710
  <h4>Steps</h4>
1704
1711
  <div class="steps-list">${generateStepsHTML(test.steps)}</div>
1705
1712
  ${(() => {
@@ -1651,7 +1651,32 @@ function generateHTML(reportData, trendData = null) {
1651
1651
  test.errorMessage
1652
1652
  ? `<div class="test-error-summary">${formatPlaywrightError(
1653
1653
  test.errorMessage
1654
- )}<button class="copy-error-btn" onclick="copyErrorToClipboard(this)">Copy Error Prompt</button></div>`
1654
+ )}<button
1655
+ class="copy-error-btn"
1656
+ onclick="copyErrorToClipboard(this)"
1657
+ style="
1658
+ margin-top: 8px;
1659
+ padding: 4px 8px;
1660
+ background: #f0f0f0;
1661
+ border: 2px solid #ccc;
1662
+ border-radius: 4px;
1663
+ cursor: pointer;
1664
+ font-size: 12px;
1665
+ border-color: #8B0000;
1666
+ color: #8B0000;
1667
+ "
1668
+ onmouseover="this.style.background='#e0e0e0'"
1669
+ onmouseout="this.style.background='#f0f0f0'"
1670
+ >
1671
+ Copy Error Prompt
1672
+ </button></div>`
1673
+ : ""
1674
+ }
1675
+ ${
1676
+ test.snippet
1677
+ ? `<div class="code-section"><h4>Error Snippet</h4><pre><code>${formatPlaywrightError(
1678
+ test.snippet
1679
+ )}</code></pre></div>`
1655
1680
  : ""
1656
1681
  }
1657
1682
  <h4>Steps</h4><div class="steps-list">${generateStepsHTML(