@sentinelqa/playwright-reporter 0.1.12 → 0.1.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.
Files changed (2) hide show
  1. package/dist/localReport.js +101 -8
  2. package/package.json +1 -1
@@ -20,6 +20,17 @@ const ARTIFACT_EXTENSIONS = {
20
20
  report: [".html", ".json"],
21
21
  attachment: []
22
22
  };
23
+ const normalizeTestStatus = (status) => {
24
+ if (!status)
25
+ return "unknown";
26
+ if (status === "expected")
27
+ return "passed";
28
+ if (status === "unexpected")
29
+ return "failed";
30
+ if (status === "flaky")
31
+ return "passed";
32
+ return status;
33
+ };
23
34
  const escapeHtml = (value) => value
24
35
  .replace(/&/g, "&")
25
36
  .replace(/</g, "&lt;")
@@ -161,7 +172,7 @@ const createReportTest = (test, titlePath) => {
161
172
  titlePath,
162
173
  file: test?.location?.file || null,
163
174
  projectName: test?.projectName || null,
164
- status: test?.status || lastResult?.status || "unknown",
175
+ status: normalizeTestStatus(test?.status || lastResult?.status || "unknown"),
165
176
  duration,
166
177
  errors,
167
178
  artifacts: []
@@ -241,6 +252,27 @@ const summarizeTests = (tests) => {
241
252
  const renderArtifact = (artifact) => {
242
253
  const href = escapeHtml(artifact.relativePath);
243
254
  const label = escapeHtml(artifact.label);
255
+ if (artifact.kind === "trace") {
256
+ return `
257
+ <div class="artifact-link artifact-link-trace">
258
+ <div class="artifact-trace-row">
259
+ <div class="artifact-trace-meta">
260
+ <span class="artifact-kind">Trace</span>
261
+ <a href="${href}" target="_blank" rel="noreferrer">${label}</a>
262
+ </div>
263
+ <a
264
+ class="trace-button"
265
+ href="${href}"
266
+ target="_blank"
267
+ rel="noreferrer"
268
+ data-trace-path="${href}"
269
+ >
270
+ View Trace
271
+ </a>
272
+ </div>
273
+ </div>
274
+ `;
275
+ }
244
276
  if (artifact.kind === "screenshot") {
245
277
  return `
246
278
  <div class="artifact-card">
@@ -503,6 +535,9 @@ const buildHtml = (tests, summary, extraArtifacts) => {
503
535
  background: rgba(9, 13, 20, 0.9);
504
536
  padding: 12px;
505
537
  }
538
+ .artifact-link-trace {
539
+ padding: 14px;
540
+ }
506
541
  .artifact-card img, .artifact-card video {
507
542
  width: 100%;
508
543
  border-radius: 10px;
@@ -527,6 +562,37 @@ const buildHtml = (tests, summary, extraArtifacts) => {
527
562
  text-transform: uppercase;
528
563
  letter-spacing: 0.08em;
529
564
  }
565
+ .artifact-trace-row {
566
+ display: flex;
567
+ justify-content: space-between;
568
+ gap: 12px;
569
+ align-items: center;
570
+ }
571
+ .artifact-trace-meta {
572
+ display: flex;
573
+ gap: 10px;
574
+ align-items: center;
575
+ flex-wrap: wrap;
576
+ }
577
+ .trace-button {
578
+ display: inline-flex;
579
+ align-items: center;
580
+ justify-content: center;
581
+ padding: 8px 12px;
582
+ border-radius: 999px;
583
+ border: 1px solid rgba(125, 211, 252, 0.28);
584
+ background: rgba(125, 211, 252, 0.08);
585
+ color: var(--accent);
586
+ font-size: 12px;
587
+ font-weight: 600;
588
+ text-transform: uppercase;
589
+ letter-spacing: 0.06em;
590
+ white-space: nowrap;
591
+ }
592
+ .trace-button:hover {
593
+ text-decoration: none;
594
+ background: rgba(125, 211, 252, 0.14);
595
+ }
530
596
  .artifact-list {
531
597
  display: grid;
532
598
  gap: 12px;
@@ -560,6 +626,10 @@ const buildHtml = (tests, summary, extraArtifacts) => {
560
626
  }
561
627
  .test-summary { flex-direction: column; }
562
628
  .meta-stack { min-width: 0; }
629
+ .artifact-trace-row {
630
+ flex-direction: column;
631
+ align-items: flex-start;
632
+ }
563
633
  }
564
634
  </style>
565
635
  </head>
@@ -611,14 +681,16 @@ const buildHtml = (tests, summary, extraArtifacts) => {
611
681
 
612
682
  <section class="section-shell">
613
683
  <h2>Optional: Sentinel Cloud</h2>
614
- <div class="artifact-list">
615
- <div class="artifact-link">Upload runs to Sentinel Cloud for:</div>
616
- <div class="artifact-link">• CI history</div>
617
- <div class="artifact-link">• shareable run links</div>
618
- <div class="artifact-link">• AI failure summaries</div>
619
- <div class="artifact-link">
684
+ <div class="panel">
685
+ <p>Upload runs to Sentinel Cloud for:</p>
686
+ <ul>
687
+ <li>CI history</li>
688
+ <li>shareable run links</li>
689
+ <li>AI failure summaries</li>
690
+ </ul>
691
+ <p>
620
692
  <a href="${SENTINEL_URL}" target="_blank" rel="noreferrer">More on sentinelqa.com</a>
621
- </div>
693
+ </p>
622
694
  </div>
623
695
  </section>
624
696
 
@@ -626,6 +698,27 @@ const buildHtml = (tests, summary, extraArtifacts) => {
626
698
  Generated by <a href="${SENTINEL_URL}" target="_blank" rel="noreferrer">Sentinel Playwright Reporter</a>.
627
699
  </footer>
628
700
  </div>
701
+ <script>
702
+ (function () {
703
+ var traceButtons = document.querySelectorAll("[data-trace-path]");
704
+ traceButtons.forEach(function (button) {
705
+ var tracePath = button.getAttribute("data-trace-path");
706
+ if (!tracePath) return;
707
+
708
+ try {
709
+ if (window.location.protocol === "http:" || window.location.protocol === "https:") {
710
+ var traceUrl = new URL(tracePath, window.location.href).href;
711
+ button.setAttribute(
712
+ "href",
713
+ "https://trace.playwright.dev/?trace=" + encodeURIComponent(traceUrl)
714
+ );
715
+ }
716
+ } catch (_error) {
717
+ // Fall back to the raw trace zip link when URL construction fails.
718
+ }
719
+ });
720
+ })();
721
+ </script>
629
722
  </body>
630
723
  </html>`;
631
724
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentinelqa/playwright-reporter",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "private": false,
5
5
  "description": "Playwright reporter for CI debugging with optional Sentinel cloud dashboards",
6
6
  "license": "MIT",