@sentinelqa/playwright-reporter 0.1.15 → 0.1.17

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.
@@ -254,22 +254,9 @@ const renderArtifact = (artifact) => {
254
254
  const label = escapeHtml(artifact.label);
255
255
  if (artifact.kind === "trace") {
256
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>
257
+ <div class="artifact-link">
258
+ <span class="artifact-kind">Trace</span>
259
+ <a href="${href}" target="_blank" rel="noreferrer">${label}</a>
273
260
  </div>
274
261
  `;
275
262
  }
@@ -556,9 +543,6 @@ const buildHtml = (tests, summary, extraArtifacts) => {
556
543
  background: rgba(9, 13, 20, 0.9);
557
544
  padding: 12px;
558
545
  }
559
- .artifact-link-trace {
560
- padding: 14px;
561
- }
562
546
  .artifact-card img, .artifact-card video {
563
547
  width: 100%;
564
548
  border-radius: 10px;
@@ -583,37 +567,6 @@ const buildHtml = (tests, summary, extraArtifacts) => {
583
567
  text-transform: uppercase;
584
568
  letter-spacing: 0.08em;
585
569
  }
586
- .artifact-trace-row {
587
- display: flex;
588
- justify-content: space-between;
589
- gap: 12px;
590
- align-items: center;
591
- }
592
- .artifact-trace-meta {
593
- display: flex;
594
- gap: 10px;
595
- align-items: center;
596
- flex-wrap: wrap;
597
- }
598
- .trace-button {
599
- display: inline-flex;
600
- align-items: center;
601
- justify-content: center;
602
- padding: 8px 12px;
603
- border-radius: 999px;
604
- border: 1px solid rgba(125, 211, 252, 0.28);
605
- background: rgba(125, 211, 252, 0.08);
606
- color: var(--accent);
607
- font-size: 12px;
608
- font-weight: 600;
609
- text-transform: uppercase;
610
- letter-spacing: 0.06em;
611
- white-space: nowrap;
612
- }
613
- .trace-button:hover {
614
- text-decoration: none;
615
- background: rgba(125, 211, 252, 0.14);
616
- }
617
570
  .artifact-list {
618
571
  display: grid;
619
572
  gap: 12px;
@@ -654,10 +607,6 @@ const buildHtml = (tests, summary, extraArtifacts) => {
654
607
  }
655
608
  .test-summary { flex-direction: column; }
656
609
  .meta-stack { min-width: 0; }
657
- .artifact-trace-row {
658
- flex-direction: column;
659
- align-items: flex-start;
660
- }
661
610
  }
662
611
  </style>
663
612
  </head>
@@ -726,27 +675,6 @@ const buildHtml = (tests, summary, extraArtifacts) => {
726
675
  Generated by <a href="${SENTINEL_URL}" target="_blank" rel="noreferrer">Sentinel Playwright Reporter</a>.
727
676
  </footer>
728
677
  </div>
729
- <script>
730
- (function () {
731
- var traceButtons = document.querySelectorAll("[data-trace-path]");
732
- traceButtons.forEach(function (button) {
733
- var tracePath = button.getAttribute("data-trace-path");
734
- if (!tracePath) return;
735
-
736
- try {
737
- if (window.location.protocol === "http:" || window.location.protocol === "https:") {
738
- var traceUrl = new URL(tracePath, window.location.href).href;
739
- button.setAttribute(
740
- "href",
741
- "https://trace.playwright.dev/?trace=" + encodeURIComponent(traceUrl)
742
- );
743
- }
744
- } catch (_error) {
745
- // Fall back to the raw trace zip link when URL construction fails.
746
- }
747
- });
748
- })();
749
- </script>
750
678
  </body>
751
679
  </html>`;
752
680
  };
@@ -16,6 +16,7 @@ declare class SentinelReporter {
16
16
  constructor(options: ReporterOptions);
17
17
  onBegin(config: any, suite: any): void;
18
18
  onTestEnd(_test: any, result: any): void;
19
+ private printLocalReport;
19
20
  onEnd(): Promise<void>;
20
21
  }
21
22
  export = SentinelReporter;
package/dist/reporter.js CHANGED
@@ -45,8 +45,25 @@ class SentinelReporter {
45
45
  this.failedCount += 1;
46
46
  }
47
47
  }
48
+ printLocalReport(localReportPath) {
49
+ console.log("");
50
+ console.log("✔ Artifacts collected");
51
+ console.log("✔ Sentinel debugging report generated");
52
+ console.log("");
53
+ console.log("Report location:");
54
+ const relativeReportPath = path_1.default
55
+ .relative(process.cwd(), localReportPath)
56
+ .replace(/\\/g, "/");
57
+ const displayPath = relativeReportPath.startsWith(".")
58
+ ? relativeReportPath
59
+ : `./${relativeReportPath}`;
60
+ console.log(formatTerminalLink(displayPath, (0, url_1.pathToFileURL)(localReportPath).href));
61
+ }
48
62
  async onEnd() {
49
- if (!process.env.SENTINEL_TOKEN) {
63
+ const hasSentinelToken = Boolean(process.env.SENTINEL_TOKEN);
64
+ const hasCiEnv = (0, node_1.hasSupportedCiEnv)(process.env);
65
+ const localUploadEnabled = (0, node_1.isLocalUploadEnabled)(process.env);
66
+ if (!hasSentinelToken || (!hasCiEnv && !localUploadEnabled)) {
50
67
  const localReport = (0, localReport_1.generateLocalDebugReport)({
51
68
  playwrightJsonPath: this.options.playwrightJsonPath,
52
69
  playwrightReportDir: this.options.playwrightReportDir,
@@ -56,26 +73,27 @@ class SentinelReporter {
56
73
  reportFileName: this.options.localReportFileName,
57
74
  redirectFileName: this.options.localRedirectFileName
58
75
  });
76
+ this.printLocalReport(localReport.htmlPath);
59
77
  console.log("");
60
- console.log("✔ Artifacts collected");
61
- console.log("✔ Sentinel debugging report generated");
62
- console.log("");
63
- console.log("Report location:");
64
- const relativeReportPath = path_1.default
65
- .relative(process.cwd(), localReport.htmlPath)
66
- .replace(/\\/g, "/");
67
- const displayPath = relativeReportPath.startsWith(".")
68
- ? relativeReportPath
69
- : `./${relativeReportPath}`;
70
- console.log(formatTerminalLink(displayPath, (0, url_1.pathToFileURL)(localReport.htmlPath).href));
71
- console.log("");
72
- console.log("Optional:");
73
- console.log("Upload runs to Sentinel Cloud for:");
74
- console.log("• CI history");
75
- console.log("• shareable run links");
76
- console.log("• AI failure summaries");
78
+ if (!hasSentinelToken) {
79
+ console.log("Optional:");
80
+ console.log("Upload runs to Sentinel Cloud for:");
81
+ console.log(" CI history");
82
+ console.log("• shareable run links");
83
+ console.log("• AI failure summaries");
84
+ console.log("");
85
+ console.log(`Learn more: ${formatTerminalLink("https://sentinelqa.com", "https://sentinelqa.com")}`);
86
+ return;
87
+ }
88
+ console.log("Sentinel upload skipped for this local run.");
89
+ console.log("To record local runs in Sentinel, set SENTINEL_UPLOAD_LOCAL=1 and provide the required CI metadata.");
77
90
  console.log("");
78
- console.log(`Learn more: ${formatTerminalLink("https://sentinelqa.com", "https://sentinelqa.com")}`);
91
+ console.log("Typical local upload environment variables:");
92
+ console.log("• SENTINEL_UPLOAD_LOCAL=1");
93
+ console.log("• CI_COMMIT_SHA or GITHUB_SHA");
94
+ console.log("• CI_COMMIT_REF_NAME or GITHUB_REF_NAME");
95
+ console.log("• CI_JOB_URL or a matching run URL");
96
+ console.log("• CI_PIPELINE_ID or GITHUB_RUN_ID");
79
97
  return;
80
98
  }
81
99
  console.log("");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentinelqa/playwright-reporter",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "private": false,
5
5
  "description": "Playwright reporter for CI debugging with optional Sentinel cloud dashboards",
6
6
  "license": "MIT",