@sentinelqa/playwright-reporter 0.1.20 → 0.1.22

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/README.md CHANGED
@@ -93,7 +93,7 @@ If `SENTINEL_TOKEN` is not set, the reporter generates a local HTML debugging re
93
93
 
94
94
  ### Cloud mode
95
95
 
96
- If `SENTINEL_TOKEN` is set, the reporter uploads the run to Sentinel instead of generating the local HTML report.
96
+ If `SENTINEL_TOKEN` is set in CI, the reporter uploads the run to Sentinel instead of generating the local HTML report.
97
97
 
98
98
  ```bash
99
99
  SENTINEL_TOKEN=your_project_ingest_token npx playwright test
@@ -101,6 +101,17 @@ SENTINEL_TOKEN=your_project_ingest_token npx playwright test
101
101
 
102
102
  For intentional uploads outside CI, also set `SENTINEL_UPLOAD_LOCAL=1` and provide the usual commit and run metadata expected by the uploader.
103
103
 
104
+ Example:
105
+
106
+ ```bash
107
+ SENTINEL_TOKEN=your_project_ingest_token \
108
+ SENTINEL_UPLOAD_LOCAL=1 \
109
+ GITHUB_SHA=abc123 \
110
+ GITHUB_REF_NAME=main \
111
+ GITHUB_RUN_ID=local-dev \
112
+ npx playwright test
113
+ ```
114
+
104
115
  ## What `withSentinel()` does
105
116
 
106
117
  - Preserves your existing reporter configuration
@@ -927,13 +927,11 @@ const buildHtml = (tests, summary, extraArtifacts) => {
927
927
  var tracePath = button.getAttribute("data-trace-path");
928
928
  if (!tracePath) return;
929
929
  try {
930
- if (window.location.protocol === "http:" || window.location.protocol === "https:") {
931
- var traceUrl = new URL(tracePath, window.location.href).href;
932
- button.setAttribute(
933
- "href",
934
- "https://trace.playwright.dev/?trace=" + encodeURIComponent(traceUrl)
935
- );
936
- }
930
+ var traceUrl = new URL(tracePath, window.location.href).href;
931
+ button.setAttribute(
932
+ "href",
933
+ "https://trace.playwright.dev/?trace=" + encodeURIComponent(traceUrl)
934
+ );
937
935
  } catch (_error) {
938
936
  // Keep the raw trace file link as fallback.
939
937
  }
package/dist/reporter.js CHANGED
@@ -82,11 +82,13 @@ class SentinelReporter {
82
82
  console.log("");
83
83
  console.log(` ${magenta("★ If this reporter helped you debug faster,")}`);
84
84
  console.log(` ${dim("consider starring the project:")}`);
85
- console.log(` ${cyan(formatTerminalLink("https://github.com/sentinelqa/playwright-reporter", "https://github.com/sentinelqa/playwright-reporter"))}`);
85
+ console.log(` ${cyan(formatTerminalLink("https://github.com/adnangradascevic/playwright-reporter", "https://github.com/adnangradascevic/playwright-reporter"))}`);
86
86
  }
87
87
  async onEnd() {
88
88
  const hasSentinelToken = Boolean(process.env.SENTINEL_TOKEN);
89
- if (!hasSentinelToken) {
89
+ const hasCiEnv = (0, node_1.hasSupportedCiEnv)(process.env);
90
+ const localUploadEnabled = (0, node_1.isLocalUploadEnabled)(process.env);
91
+ if (!hasSentinelToken || (!hasCiEnv && !localUploadEnabled)) {
90
92
  const localReport = (0, localReport_1.generateLocalDebugReport)({
91
93
  playwrightJsonPath: this.options.playwrightJsonPath,
92
94
  playwrightReportDir: this.options.playwrightReportDir,
@@ -98,25 +100,16 @@ class SentinelReporter {
98
100
  });
99
101
  this.printLocalReport(localReport.htmlPath);
100
102
  console.log("");
103
+ if (hasSentinelToken && !hasCiEnv && !localUploadEnabled) {
104
+ console.log("Sentinel upload skipped for this local run.");
105
+ console.log("To upload local runs, set SENTINEL_UPLOAD_LOCAL=1 and provide the required CI metadata.");
106
+ console.log("");
107
+ }
101
108
  return;
102
109
  }
103
- const hasCiEnv = (0, node_1.hasSupportedCiEnv)(process.env);
104
- const localUploadEnabled = (0, node_1.isLocalUploadEnabled)(process.env);
105
110
  console.log("");
106
111
  console.log("Uploading failure artifacts to Sentinel...");
107
112
  console.log("");
108
- if (!hasCiEnv && !localUploadEnabled) {
109
- console.log("Local upload mode detected.");
110
- console.log("If this run is outside CI, set SENTINEL_UPLOAD_LOCAL=1 and provide the required CI metadata.");
111
- console.log("");
112
- console.log("Typical local upload environment variables:");
113
- console.log("• SENTINEL_UPLOAD_LOCAL=1");
114
- console.log("• CI_COMMIT_SHA or GITHUB_SHA");
115
- console.log("• CI_COMMIT_REF_NAME or GITHUB_REF_NAME");
116
- console.log("• CI_JOB_URL or a matching run URL");
117
- console.log("• CI_PIPELINE_ID or GITHUB_RUN_ID");
118
- console.log("");
119
- }
120
113
  const exitCode = await (0, node_1.runSentinelUpload)({
121
114
  playwrightJsonPath: this.options.playwrightJsonPath,
122
115
  playwrightReportDir: this.options.playwrightReportDir,
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@sentinelqa/playwright-reporter",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "private": false,
5
5
  "description": "Playwright reporter for CI debugging with optional Sentinel cloud dashboards",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/sentinelqa/playwright-reporter.git"
9
+ "url": "https://github.com/adnangradascevic/playwright-reporter.git"
10
10
  },
11
- "homepage": "https://github.com/sentinelqa/playwright-reporter#readme",
11
+ "homepage": "https://github.com/adnangradascevic/playwright-reporter#readme",
12
12
  "bugs": {
13
- "url": "https://github.com/sentinelqa/playwright-reporter/issues"
13
+ "url": "https://github.com/adnangradascevic/playwright-reporter/issues"
14
14
  },
15
15
  "keywords": [
16
16
  "sentinelqa",