@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.
- package/dist/reporter.d.ts +1 -0
- package/dist/reporter.js +37 -19
- package/package.json +1 -1
package/dist/reporter.d.ts
CHANGED
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
|
-
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
.
|
|
66
|
-
.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
console.log(
|
|
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(
|
|
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("");
|