@sentinelqa/playwright-reporter 0.1.16 → 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.
@@ -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.16",
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",