@checkly/playwright-reporter 1.1.0 → 1.2.0

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/CHANGELOG.md CHANGED
@@ -4,6 +4,26 @@ All notable changes to `@checkly/playwright-reporter` will be documented in this
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
+ ## 1.2.0 (2026-01-21)
8
+
9
+ ### Breaking Changes
10
+
11
+ - **Credentials now required** - The reporter now requires Checkly credentials (`apiKey` + `accountId`) or explicit `dryRun: true`. Previously, missing credentials would silently skip uploading. Now you'll get a clear error message explaining what's needed.
12
+
13
+ **If you're not using Checkly Test Sessions**, add `dryRun: true` to your config:
14
+
15
+ ```typescript
16
+ reporter: [['@checkly/playwright-reporter', { dryRun: true }]]
17
+ ```
18
+
19
+ ### Added
20
+
21
+ - Clear error messages for credential issues:
22
+ - Shows both the config option and environment variable (e.g., "apiKey / CHECKLY_API_KEY")
23
+ - Includes a direct link to the API keys settings page
24
+ - Invalid API keys show "Authentication failed" instead of a generic error
25
+ - Wrong account IDs show "Access denied" with guidance to check the account ID
26
+
7
27
  ## 1.1.0 (2026-01-20)
8
28
 
9
29
  > **Note:** This minor version contains breaking changes. Due to options API configurations in 1.0.x that could lead to broken states, we decided to publish this as a minor version and unpublish previous 1.0.x releases to prevent issues. If you were using 1.0.x, please update your configuration as described below.
package/dist/index.d.ts CHANGED
@@ -21,6 +21,10 @@ interface JSONReportTestResult extends JSONReportTestResult$1 {
21
21
  _checkly?: ChecklyData;
22
22
  }
23
23
 
24
+ declare class MissingCredentialsError extends Error {
25
+ constructor(missing: string[]);
26
+ }
27
+
24
28
  /**
25
29
  * Configuration options for the Checkly Playwright Reporter.
26
30
  */
@@ -61,4 +65,4 @@ declare const _default: ChecklyReporterClass;
61
65
  */
62
66
  declare function createChecklyReporter(options?: ChecklyReporterOptions): ['@checkly/playwright-reporter', ChecklyReporterOptions];
63
67
 
64
- export { type ChecklyConsoleLog, type ChecklyData, type ChecklyNetworkRequest, type ChecklyReporterOptions, type JSONReportTestResult, createChecklyReporter, _default as default };
68
+ export { type ChecklyConsoleLog, type ChecklyData, type ChecklyNetworkRequest, type ChecklyReporterOptions, type JSONReportTestResult, MissingCredentialsError, createChecklyReporter, _default as default };
package/dist/index.js CHANGED
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
+ MissingCredentialsError: () => MissingCredentialsError,
33
34
  createChecklyReporter: () => createChecklyReporter,
34
35
  default: () => index_default
35
36
  });
@@ -1635,6 +1636,18 @@ function createClient(options) {
1635
1636
  }
1636
1637
 
1637
1638
  // src/extensions/checkly-upload.ts
1639
+ var MissingCredentialsError = class extends Error {
1640
+ constructor(missing) {
1641
+ const missingList = missing.map((m) => m === "CHECKLY_API_KEY" ? "apiKey / CHECKLY_API_KEY" : "accountId / CHECKLY_ACCOUNT_ID").join(", ");
1642
+ super(
1643
+ `Missing required Checkly credentials: ${missingList}.
1644
+ Provide them via reporter options or environment variables.
1645
+ Get your API key at: https://app.checklyhq.com/settings/user/api-keys
1646
+ Or use dryRun: true for local report generation.`
1647
+ );
1648
+ this.name = "MissingCredentialsError";
1649
+ }
1650
+ };
1638
1651
  function getPackageVersion() {
1639
1652
  try {
1640
1653
  const packageJson = JSON.parse(fs5.readFileSync(path4.join(__dirname, "..", "package.json"), "utf-8"));
@@ -1713,6 +1726,20 @@ function checklyUpload(options = {}) {
1713
1726
  });
1714
1727
  log("\u2705 Session created", { id: testSession.testSessionId });
1715
1728
  } catch (err2) {
1729
+ if (err2 instanceof UnauthorizedError) {
1730
+ console.error(
1731
+ "[Checkly] Authentication failed: Invalid API key.\n Please verify your apiKey option or CHECKLY_API_KEY environment variable is correct.\n Get your API key at: https://app.checklyhq.com/settings/user/api-keys"
1732
+ );
1733
+ api = void 0;
1734
+ return;
1735
+ }
1736
+ if (err2 instanceof ForbiddenError) {
1737
+ console.error(
1738
+ "[Checkly] Access denied: You do not have access to this account.\n Please verify your accountId option or CHECKLY_ACCOUNT_ID environment variable is correct.\n Get your API key at: https://app.checklyhq.com/settings/user/api-keys"
1739
+ );
1740
+ api = void 0;
1741
+ return;
1742
+ }
1716
1743
  console.error("[Checkly] Failed to create test session:", err2);
1717
1744
  }
1718
1745
  }
@@ -1847,10 +1874,14 @@ function checklyUpload(options = {}) {
1847
1874
  assetCollector = new AssetCollector(resolvedOutputDir);
1848
1875
  zipper = new Zipper({ outputPath: zipPath });
1849
1876
  if (!canUpload) {
1850
- if (!dryRun && (!apiKey || !accountId)) {
1851
- log("\u26A0\uFE0F Skipping upload (missing API credentials)");
1877
+ if (dryRun) {
1878
+ console.warn("[Checkly] Dry run mode - report will be generated locally");
1879
+ return;
1852
1880
  }
1853
- return;
1881
+ const missing = [];
1882
+ if (!apiKey) missing.push("CHECKLY_API_KEY");
1883
+ if (!accountId) missing.push("CHECKLY_ACCOUNT_ID");
1884
+ throw new MissingCredentialsError(missing);
1854
1885
  }
1855
1886
  api = createClient({
1856
1887
  apiKey,
@@ -2452,5 +2483,6 @@ function createChecklyReporter(options = {}) {
2452
2483
  }
2453
2484
  // Annotate the CommonJS export names for ESM import in node:
2454
2485
  0 && (module.exports = {
2486
+ MissingCredentialsError,
2455
2487
  createChecklyReporter
2456
2488
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkly/playwright-reporter",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Standalone Playwright reporter for Checkly - compatible with Playwright 1.40-1.57+",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -35,10 +35,11 @@
35
35
  "tsup": "8.5.1",
36
36
  "tsx": "4.19.0",
37
37
  "typescript": "5.9.3",
38
- "@checkly/reporter-utils": "1.1.0"
38
+ "@checkly/reporter-utils": "1.2.0"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "tsup",
42
+ "test:e2e": "pnpm build && vitest run --config vitest.e2e.config.ts",
42
43
  "test:integration": "playwright test -c src/__tests__/integration/playwright.config.ts",
43
44
  "test:integration:validate": "tsx src/__tests__/integration/validate-baseline.ts",
44
45
  "test:pw-version": "./scripts/test-pw-version.sh",