checkly 8.4.0 → 8.5.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/dist/ai-context/checkly.rules.md +153 -1
- package/dist/ai-context/context.d.ts +13 -1
- package/dist/ai-context/context.js +14 -1
- package/dist/ai-context/context.js.map +1 -1
- package/dist/ai-context/public-skills/checkly/SKILL.md +3 -1
- package/dist/ai-context/skills-command/references/configure-api-checks.md +1 -0
- package/dist/ai-context/skills-command/references/configure-browser-checks.md +1 -0
- package/dist/ai-context/skills-command/references/configure-check-groups.md +1 -0
- package/dist/ai-context/skills-command/references/configure-environment.md +92 -0
- package/dist/ai-context/skills-command/references/configure-multistep-checks.md +1 -0
- package/dist/ai-context/skills-command/references/configure-playwright-checks.md +50 -0
- package/dist/ai-context/skills-command/references/configure.md +6 -1
- package/dist/ai-context/skills-command/references/investigate-test-sessions.md +125 -0
- package/dist/ai-context/skills-command/references/investigate.md +3 -0
- package/dist/commands/alert-channels/get.d.ts +14 -0
- package/dist/commands/alert-channels/get.js +50 -0
- package/dist/commands/alert-channels/get.js.map +1 -0
- package/dist/commands/alert-channels/list.d.ts +13 -0
- package/dist/commands/alert-channels/list.js +64 -0
- package/dist/commands/alert-channels/list.js.map +1 -0
- package/dist/commands/alert-channels/logs.d.ts +19 -0
- package/dist/commands/alert-channels/logs.js +91 -0
- package/dist/commands/alert-channels/logs.js.map +1 -0
- package/dist/commands/rca/run.d.ts +1 -0
- package/dist/commands/rca/run.js +6 -3
- package/dist/commands/rca/run.js.map +1 -1
- package/dist/commands/test-sessions/get.d.ts +1 -0
- package/dist/commands/test-sessions/get.js +28 -1
- package/dist/commands/test-sessions/get.js.map +1 -1
- package/dist/commands/test-sessions/list.d.ts +22 -0
- package/dist/commands/test-sessions/list.js +190 -0
- package/dist/commands/test-sessions/list.js.map +1 -0
- package/dist/constructs/playwright-check.d.ts +13 -5
- package/dist/constructs/playwright-check.js +3 -1
- package/dist/constructs/playwright-check.js.map +1 -1
- package/dist/formatters/alert-channels.d.ts +15 -0
- package/dist/formatters/alert-channels.js +259 -0
- package/dist/formatters/alert-channels.js.map +1 -0
- package/dist/formatters/checks.js +11 -19
- package/dist/formatters/checks.js.map +1 -1
- package/dist/formatters/render.d.ts +7 -0
- package/dist/formatters/render.js +73 -0
- package/dist/formatters/render.js.map +1 -1
- package/dist/formatters/test-sessions.d.ts +4 -1
- package/dist/formatters/test-sessions.js +93 -0
- package/dist/formatters/test-sessions.js.map +1 -1
- package/dist/helpers/number.d.ts +3 -0
- package/dist/helpers/number.js +20 -0
- package/dist/helpers/number.js.map +1 -0
- package/dist/rest/alert-channels.d.ts +52 -0
- package/dist/rest/alert-channels.js +23 -0
- package/dist/rest/alert-channels.js.map +1 -0
- package/dist/rest/alert-notifications.d.ts +39 -0
- package/dist/rest/alert-notifications.js +19 -0
- package/dist/rest/alert-notifications.js.map +1 -0
- package/dist/rest/api.d.ts +4 -0
- package/dist/rest/api.js +4 -0
- package/dist/rest/api.js.map +1 -1
- package/dist/rest/rca.d.ts +2 -2
- package/dist/rest/rca.js +4 -4
- package/dist/rest/rca.js.map +1 -1
- package/dist/rest/test-sessions.d.ts +51 -0
- package/dist/rest/test-sessions.js +24 -1
- package/dist/rest/test-sessions.js.map +1 -1
- package/oclif.manifest.json +571 -237
- package/package.json +4 -1
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
- Use the [Checkly construct reference documentation](https://www.checklyhq.com/docs/constructs/overview/).
|
|
7
7
|
- Import and / or require any constructs you need in your code, such as `ApiCheck`, `BrowserCheck`, or `PlaywrightCheck` from the `checkly/constructs` package.
|
|
8
8
|
- Always ground generated code and CLI commands against the official documentation and examples in this file.
|
|
9
|
+
- Use `runtimeId` for Browser Checks and MultiStep Checks. Runtimes are managed Checkly execution environments with fixed Checkly-provided dependencies such as Playwright, browser binaries, and runtime libraries.
|
|
10
|
+
- Use `engine` only for Playwright Check Suites. `engine` selects the JavaScript engine version that runs the user's own Playwright project.
|
|
9
11
|
|
|
10
12
|
## Using the Checkly CLI
|
|
11
13
|
|
|
@@ -19,7 +21,7 @@
|
|
|
19
21
|
- `*.check.ts|js` - TS / JS files that define the checks.
|
|
20
22
|
- `*.spec.ts|js` - TS / JS files that contain Playwright code for Browser and MultiStep checks.
|
|
21
23
|
- `src/__checks__` - Default directory where all your checks are stored. Use this directory if it already exists, otherwise create a new directory for your checks.
|
|
22
|
-
- `package.json` - Standard
|
|
24
|
+
- `package.json` - Standard npm project manifest.
|
|
23
25
|
|
|
24
26
|
Here is an example directory tree of what that would look like:
|
|
25
27
|
|
|
@@ -118,6 +120,9 @@ Email (`EmailAlertChannel`), Phone (`PhoneCallAlertChannel`), Slack (`SlackAlert
|
|
|
118
120
|
### `npx checkly skills configure supporting-constructs`
|
|
119
121
|
Status pages (`StatusPage`), dashboards (`Dashboard`), maintenance windows (`MaintenanceWindow`), and private locations (`PrivateLocation`)
|
|
120
122
|
|
|
123
|
+
### `npx checkly skills configure environment`
|
|
124
|
+
Environment variables: built-in vars Checkly injects at runtime (`CHECK_ID`, `CHECK_NAME`, `REGION`, `CHECKLY_*`), user-defined variables and secrets at global/group/check scope, reference syntax (`process.env` vs `{{handlebars}}`), and the `checkly env` CLI for managing global vars.
|
|
125
|
+
|
|
121
126
|
## Important: Public URL Requirement
|
|
122
127
|
|
|
123
128
|
All checks (API, Browser, URL monitors) run on **Checkly's cloud infrastructure**, not on the user's local machine. Target URLs must be publicly accessible from the internet.
|
|
@@ -284,6 +289,7 @@ Note the names: `notEmpty` (not `isNotEmpty`), `greaterThan` / `lessThan` (not `
|
|
|
284
289
|
- Use axios for making HTTP requests.
|
|
285
290
|
- Read the input credentials from env variables using `process.env`.
|
|
286
291
|
- Pass auth tokens to the request object using `request.headers['key'] = AUTH_TOKEN_VALUE`.
|
|
292
|
+
- For built-in env vars setup/teardown scripts receive at runtime (`CHECK_ID`, `REGION`, `RUNTIME_VERSION`, `PUBLIC_IP_V4`, etc.), see `npx checkly skills configure environment`. The API request itself doesn't run JS — use Handlebars (`{{MY_VAR}}`) in URL, headers, body, basic auth, and query params instead.
|
|
287
293
|
|
|
288
294
|
### Browser Checks
|
|
289
295
|
|
|
@@ -292,6 +298,7 @@ Note the names: `notEmpty` (not `isNotEmpty`), `greaterThan` / `lessThan` (not `
|
|
|
292
298
|
- Use the `code.entrypoint` property to specify the path to your Playwright test file.
|
|
293
299
|
- **Important:** The target URL must be publicly accessible — checks run on Checkly's cloud, not locally.
|
|
294
300
|
- **Plan-gated properties:** `retryStrategy`, `runParallel`, and higher frequencies may not be available on all plans. Check entitlements matching `BROWSER_CHECKS_*` before using these. Omit any property whose entitlement is disabled. See `npx checkly skills manage` for details.
|
|
301
|
+
- For env vars Checkly exposes at runtime (`CHECK_ID`, `REGION`, `RUNTIME_VERSION`, etc.), see `npx checkly skills configure environment`.
|
|
295
302
|
|
|
296
303
|
**Reference:** https://www.checklyhq.com/docs/constructs/browser-check/
|
|
297
304
|
|
|
@@ -324,9 +331,54 @@ new BrowserCheck('example-browser-check', {
|
|
|
324
331
|
### Playwright Check Suites
|
|
325
332
|
|
|
326
333
|
- Import the `PlaywrightCheck` construct from `checkly/constructs`.
|
|
334
|
+
- Use Playwright Check Suites to run an existing Playwright project. Do not rewrite tests as Browser or Multistep Checks unless the user asks.
|
|
335
|
+
- Set `playwrightConfigPath` relative to the `.check.ts` file that declares the construct, not the project root. If the check is in `monitoring/suites.check.ts` and the config is at the repo root, use `"../playwright.config.ts"`.
|
|
336
|
+
- Use `pwProjects` only when the user wants specific Playwright projects. Values must match the Playwright project `name`, such as `"Cart & Checkout"`, not a folder or slug. Wrong names can deploy but run zero tests.
|
|
337
|
+
- Use `pwTags` only when the user wants tag-based selection.
|
|
338
|
+
|
|
339
|
+
#### Dependencies
|
|
340
|
+
|
|
341
|
+
- Use the user's `package.json` and lock file for dependencies. Do not add dependency declarations to check code.
|
|
342
|
+
- For private packages or custom registries, include the registry config file, usually `.npmrc`, with `include`.
|
|
343
|
+
- The `.npmrc` should reference a Checkly environment variable such as `${NPM_TOKEN}`. Tell the user that the token must exist in Checkly before `deploy` or `trigger`.
|
|
344
|
+
- Use `installCommand` only when the default package-manager install command is not enough.
|
|
345
|
+
- In Checkly CLI v8.0.0 and later, `include` patterns resolve relative to the Playwright config directory, not the project root. If `playwrightConfigPath` points to a subdirectory, adjust `include` globs. Example: `playwrightConfigPath: "./e2e/playwright.config.ts"` with root `.npmrc` needs `include: ["../.npmrc"]`.
|
|
346
|
+
|
|
347
|
+
#### Install troubleshooting
|
|
348
|
+
|
|
349
|
+
- The execution environment is Linux and non-root, and it does not include a C/C++ compiler. Browsers are pre-installed, so never add `playwright install`, `npx playwright install`, Puppeteer browser downloads, or similar browser installation commands.
|
|
350
|
+
- If `scripts.postinstall`, `scripts.prepare`, or `scripts.install` references missing files, downloads browsers, sets up git hooks, or compiles native code, set `installCommand` to skip project lifecycle scripts and rebuild dependency scripts:
|
|
351
|
+
- npm: `npm install --ignore-scripts && npm rebuild`
|
|
352
|
+
- pnpm: `pnpm install --ignore-scripts && pnpm rebuild`
|
|
353
|
+
- Flag likely dependency problems before suggesting a deploy:
|
|
354
|
+
- `puppeteer` is usually unnecessary because browsers are pre-installed.
|
|
355
|
+
- Native dependencies that require a compiler, such as `sharp` or `better-sqlite3`, may fail.
|
|
356
|
+
- `fsevents` must be optional; a locked non-optional `fsevents` dependency can fail on Linux.
|
|
357
|
+
- `workspace:*` dependencies must be included in the uploaded bundle.
|
|
358
|
+
- Private registries must have auth configured through Checkly environment variables.
|
|
359
|
+
|
|
360
|
+
#### Runtime model
|
|
361
|
+
|
|
362
|
+
- Do not use `runtimeId` for Playwright Check Suites. Browser and Multistep Checks use `runtimeId`; Playwright Check Suites use project dependencies plus `engine`.
|
|
363
|
+
- Omit `engine` unless the user explicitly asks to override the JavaScript engine or version.
|
|
364
|
+
- If an engine override is needed, import `Engine` from `checkly/constructs` and use `Engine.node("24")` or `Engine.bun("1.3")`.
|
|
365
|
+
- If no engine is configured or detected, Checkly defaults to Node.js 22. Node.js engine majors map to pinned patch versions: `22` -> `22.14.0`, `24` -> `24.13.1`, and `26` -> `26.2.0`.
|
|
366
|
+
|
|
367
|
+
```typescript
|
|
368
|
+
import { PlaywrightCheck } from "checkly/constructs"
|
|
369
|
+
|
|
370
|
+
new PlaywrightCheck("checkout-suite", {
|
|
371
|
+
name: "Checkout suite",
|
|
372
|
+
playwrightConfigPath: "./e2e/playwright.config.ts",
|
|
373
|
+
// Include root .npmrc for private package or registry auth.
|
|
374
|
+
include: ["../.npmrc"],
|
|
375
|
+
})
|
|
376
|
+
```
|
|
327
377
|
- `playwrightConfigPath` is resolved **relative to the `.check.ts` file that declares the construct**, not the project root. If your check lives in `monitoring/suites.check.ts` and your config in `playwright.config.ts` at the repo root, use `'../playwright.config.ts'`.
|
|
328
378
|
- use `pwProjects` if you're tasked to reuse a Playwright project. Values must match the `name` field of each project in your `playwright.config.ts` (e.g. `'Cart & Checkout'`), **not** the directory slug. Mismatched names deploy silently and resolve to zero tests.
|
|
329
379
|
- use `pwTags` if you're tasked to reuse a Playwright tag.
|
|
380
|
+
- Use `include` only for non-code assets that specs read via `fs` at runtime (markdown, JSON fixtures, snapshots). Test files and anything reachable through `import` are already bundled via Playwright's project discovery and the import graph — listing them in `include` is redundant. Globs resolve **relative to the directory of `playwrightConfigPath`**, not the project root and not the `.check.ts`.
|
|
381
|
+
- For env vars Checkly exposes at runtime (e.g. `CHECKLY=1` for "am I running on Checkly?"), see `npx checkly skills configure environment`.
|
|
330
382
|
|
|
331
383
|
**Reference:** https://www.checklyhq.com/docs/constructs/playwright-check/
|
|
332
384
|
|
|
@@ -339,6 +391,11 @@ const playwrightChecks = new PlaywrightCheck("multi-browser-check", {
|
|
|
339
391
|
// Playwright Check Suites support all browsers
|
|
340
392
|
// defined in your `playwright.config`
|
|
341
393
|
pwProjects: ["chromium", "firefox", "webkit"],
|
|
394
|
+
// Bundle non-code assets that specs read via `fs` at runtime.
|
|
395
|
+
// Test files and anything reachable through `import` are already
|
|
396
|
+
// bundled — `include` is only for files outside the import graph.
|
|
397
|
+
// Globs resolve relative to the playwright config's directory.
|
|
398
|
+
include: ["fixtures/**/*.json", "docs/**/*.md"],
|
|
342
399
|
});
|
|
343
400
|
```
|
|
344
401
|
|
|
@@ -347,6 +404,7 @@ const playwrightChecks = new PlaywrightCheck("multi-browser-check", {
|
|
|
347
404
|
- Import the `MultiStepCheck` construct from `checkly/constructs`.
|
|
348
405
|
- Generate a separate `.spec.ts` file for the Playwright code referenced in the `MultiStepCheck` construct.
|
|
349
406
|
- Use the `code.entrypoint` property to specify the path to your Playwright test file.
|
|
407
|
+
- For env vars Checkly exposes at runtime (`CHECK_ID`, `REGION`, `RUNTIME_VERSION`, etc.), see `npx checkly skills configure environment`.
|
|
350
408
|
|
|
351
409
|
**Reference:** https://www.checklyhq.com/docs/constructs/multistep-check/
|
|
352
410
|
|
|
@@ -576,6 +634,7 @@ new HeartbeatMonitor('example-heartbeat-monitor', {
|
|
|
576
634
|
- Import the `CheckGroupV2` construct from `checkly/constructs`.
|
|
577
635
|
- Check Groups are used to group checks together for easier management and organization.
|
|
578
636
|
- Checks are added to Check Groups by referencing the group in the `group` property of a check.
|
|
637
|
+
- **Alert channels on a group require `alertEscalationPolicy`.** If you set custom `alertChannels` on a `CheckGroupV2` without also setting `alertEscalationPolicy`, the group's channels are ignored and each check uses its own alert settings. Use `alertEscalationPolicy: 'global'` to apply the account-wide policy, or build a custom policy with `AlertEscalationBuilder` from `checkly/constructs`.
|
|
579
638
|
|
|
580
639
|
**Reference:** https://www.checklyhq.com/docs/constructs/check-group/
|
|
581
640
|
|
|
@@ -773,3 +832,96 @@ export const examplePrivateLocation = new PrivateLocation('example-private-locat
|
|
|
773
832
|
icon: 'location',
|
|
774
833
|
})
|
|
775
834
|
```
|
|
835
|
+
|
|
836
|
+
### Environment Variables
|
|
837
|
+
|
|
838
|
+
Checks execute on Checkly's cloud infrastructure, not on the user's machine. Two sources of values are exposed at runtime: built-in variables Checkly injects, and user-defined variables managed in the project, group, check, or globally via the CLI.
|
|
839
|
+
|
|
840
|
+
#### Built-in: Available in All Check Types
|
|
841
|
+
|
|
842
|
+
Entries with no value are stripped.
|
|
843
|
+
|
|
844
|
+
| Variable | Description |
|
|
845
|
+
| --- | --- |
|
|
846
|
+
| `CHECK_ID` | UUID of the check. |
|
|
847
|
+
| `CHECK_NAME` | Name of the check. |
|
|
848
|
+
| `CHECK_TYPE` | `BROWSER`, `MULTISTEP`, `API`, `PLAYWRIGHT`, etc. |
|
|
849
|
+
| `CHECK_RUN_ID` | ID of the run. Format varies by check type (UUID for Playwright Check Suites, numeric ID for browser/multistep). |
|
|
850
|
+
| `CHECK_RESULT_ID` | UUID of the result record. |
|
|
851
|
+
| `ACCOUNT_ID` | UUID of the Checkly account. |
|
|
852
|
+
| `REQUEST_URL` | The check's request URL (mainly relevant for API checks). |
|
|
853
|
+
| `GROUP_BASE_URL` | Base URL of the check's group, if any. |
|
|
854
|
+
| `CLIENT_CERTIFICATE` | Client cert if configured. |
|
|
855
|
+
| `ENVIRONMENT_NAME` | Deployment environment name. Set only for CI/CD-triggered runs. |
|
|
856
|
+
| `DEPLOYMENT_ID` | Deployment UUID. Set only for CI/CD-triggered runs. |
|
|
857
|
+
|
|
858
|
+
#### Built-in: Browser Checks, MultiStep Checks, API Setup/Teardown
|
|
859
|
+
|
|
860
|
+
In addition to the variables above:
|
|
861
|
+
|
|
862
|
+
| Variable | Description |
|
|
863
|
+
| --- | --- |
|
|
864
|
+
| `REGION` | AWS region of the runner. |
|
|
865
|
+
| `RUNTIME_VERSION` | Runtime version string (e.g. `2025.04`). |
|
|
866
|
+
| `PUBLIC_IP_V4` | Public IPv4 of the runner. Value has a trailing newline — call `.trim()` before using. |
|
|
867
|
+
| `PUBLIC_IP_V6` | Public IPv6 of the runner. Value has a trailing newline — call `.trim()` before using. |
|
|
868
|
+
|
|
869
|
+
#### Built-in: Playwright Check Suites
|
|
870
|
+
|
|
871
|
+
In addition to the variables in the first table:
|
|
872
|
+
|
|
873
|
+
| Variable | Description |
|
|
874
|
+
| --- | --- |
|
|
875
|
+
| `CHECKLY` | Always `1`. Cleanest "am I running on Checkly?" signal. |
|
|
876
|
+
| `CHECKLY_CHECK_ID` | UUID of the check. Mirrors `CHECK_ID`. |
|
|
877
|
+
| `CHECKLY_REGION` | Region where the run executes. |
|
|
878
|
+
| `CHECKLY_RUN_SOURCE` | What triggered the run (CLI deploy, deployment, group run, manual schedule, scheduler, test, API). |
|
|
879
|
+
| `CI` | `1` for CLI runs (`npx checkly test`, `npx checkly trigger`) and deployment-triggered runs. |
|
|
880
|
+
|
|
881
|
+
Docs: https://www.checklyhq.com/docs/detect/synthetic-monitoring/playwright-checks/environment-variables/
|
|
882
|
+
|
|
883
|
+
#### User-Defined Variables
|
|
884
|
+
|
|
885
|
+
User-defined variables live at three scopes. Precedence: **check overrides group overrides global**.
|
|
886
|
+
|
|
887
|
+
- **Global** — available to every check and alert channel in the account. Managed in the UI or via `npx checkly env *`.
|
|
888
|
+
- **Group** — scoped to a check group and all its checks. Defined on the `CheckGroupV2` construct.
|
|
889
|
+
- **Check** — scoped to a single check. Defined on the construct.
|
|
890
|
+
|
|
891
|
+
##### Variables vs. Secrets
|
|
892
|
+
|
|
893
|
+
- **Variables** are plaintext: visible in the UI, on result pages, in logs, and exportable via CLI / API.
|
|
894
|
+
- **Secrets** are encrypted at rest and never visible after creation — not in the UI, not in logs, not retrievable via CLI or API. Secrets require runtime `2024.09` or later (`3.3.4+` for Private Locations, CLI `4.9.0+`).
|
|
895
|
+
- **Locked** variables are encrypted at rest and restricted to Read & Write, Admin, or Owner roles.
|
|
896
|
+
|
|
897
|
+
Docs: https://www.checklyhq.com/docs/platform/variables/
|
|
898
|
+
|
|
899
|
+
#### Reference Syntax
|
|
900
|
+
|
|
901
|
+
How to read a variable depends on the context:
|
|
902
|
+
|
|
903
|
+
| Context | Syntax |
|
|
904
|
+
| --- | --- |
|
|
905
|
+
| Browser checks, MultiStep checks, API setup/teardown scripts | `process.env.MY_VAR` |
|
|
906
|
+
| API check requests (URL, headers, body, query params, basic auth) | `{{MY_VAR}}` |
|
|
907
|
+
| API check requests where URI encoding is unwanted | `{{{MY_VAR}}}` |
|
|
908
|
+
| Webhook alert channel payloads | `{{MY_VAR}}` |
|
|
909
|
+
|
|
910
|
+
#### Managing Global Variables via the CLI
|
|
911
|
+
|
|
912
|
+
`npx checkly env` manages **global** account variables. Group- and check-level variables are managed via the UI or directly on the construct.
|
|
913
|
+
|
|
914
|
+
| Command | Description |
|
|
915
|
+
| --- | --- |
|
|
916
|
+
| `npx checkly env add <key> <value> [--locked\|-l] [--secret\|-s]` | Create a variable. |
|
|
917
|
+
| `npx checkly env update <key> <value> [--locked\|-l] [--secret\|-s]` | Update an existing variable. |
|
|
918
|
+
| `npx checkly env ls` | List all account variables; secrets are masked. |
|
|
919
|
+
| `npx checkly env pull [filename] [--force\|-f]` | Export to a local file (default `.env`). |
|
|
920
|
+
| `npx checkly env rm <key> [--force\|-f]` | Delete a variable. |
|
|
921
|
+
|
|
922
|
+
Docs: https://www.checklyhq.com/docs/cli/checkly-env/
|
|
923
|
+
|
|
924
|
+
#### Common Use
|
|
925
|
+
|
|
926
|
+
- Gate behavior between local runs and Checkly cloud by checking `process.env.CHECK_ID` (set for every check type).
|
|
927
|
+
- Differentiate retry counts, reporter output, or fixture loading by environment without defining a custom env var.
|
|
@@ -37,10 +37,16 @@ export declare const REFERENCES: readonly [{
|
|
|
37
37
|
}, {
|
|
38
38
|
readonly id: "configure-supporting-constructs";
|
|
39
39
|
readonly description: "Status pages (`StatusPage`), dashboards (`Dashboard`), maintenance windows (`MaintenanceWindow`), and private locations (`PrivateLocation`)";
|
|
40
|
+
}, {
|
|
41
|
+
readonly id: "configure-environment";
|
|
42
|
+
readonly description: "Environment variables: built-in vars Checkly injects at runtime (`CHECK_ID`, `CHECK_NAME`, `REGION`, `CHECKLY_*`), user-defined variables and secrets at global/group/check scope, reference syntax (`process.env` vs `{{handlebars}}`), and the `checkly env` CLI for managing global vars.";
|
|
40
43
|
}];
|
|
41
44
|
export declare const INVESTIGATE_REFERENCES: readonly [{
|
|
42
45
|
readonly id: "investigate-checks";
|
|
43
46
|
readonly description: "Inspecting checks (`checks list`, `checks get`) and triggering on-demand runs";
|
|
47
|
+
}, {
|
|
48
|
+
readonly id: "investigate-test-sessions";
|
|
49
|
+
readonly description: "Run and inspect recorded test sessions, drill into test-session error groups, run RCA, and retrieve result assets";
|
|
44
50
|
}];
|
|
45
51
|
export declare const COMMUNICATE_REFERENCES: readonly [{
|
|
46
52
|
readonly id: "communicate-incidents";
|
|
@@ -102,13 +108,19 @@ export declare const ACTIONS: readonly [{
|
|
|
102
108
|
}, {
|
|
103
109
|
readonly id: "configure-supporting-constructs";
|
|
104
110
|
readonly description: "Status pages (`StatusPage`), dashboards (`Dashboard`), maintenance windows (`MaintenanceWindow`), and private locations (`PrivateLocation`)";
|
|
111
|
+
}, {
|
|
112
|
+
readonly id: "configure-environment";
|
|
113
|
+
readonly description: "Environment variables: built-in vars Checkly injects at runtime (`CHECK_ID`, `CHECK_NAME`, `REGION`, `CHECKLY_*`), user-defined variables and secrets at global/group/check scope, reference syntax (`process.env` vs `{{handlebars}}`), and the `checkly env` CLI for managing global vars.";
|
|
105
114
|
}];
|
|
106
115
|
}, {
|
|
107
116
|
readonly id: "investigate";
|
|
108
|
-
readonly description: "Access check status, analyze failures, and investigate errors.";
|
|
117
|
+
readonly description: "Access check and test-session status, analyze failures, and investigate errors.";
|
|
109
118
|
readonly references: readonly [{
|
|
110
119
|
readonly id: "investigate-checks";
|
|
111
120
|
readonly description: "Inspecting checks (`checks list`, `checks get`) and triggering on-demand runs";
|
|
121
|
+
}, {
|
|
122
|
+
readonly id: "investigate-test-sessions";
|
|
123
|
+
readonly description: "Run and inspect recorded test sessions, drill into test-session error groups, run RCA, and retrieve result assets";
|
|
112
124
|
}];
|
|
113
125
|
}, {
|
|
114
126
|
readonly id: "communicate";
|
|
@@ -51,12 +51,20 @@ export const REFERENCES = [
|
|
|
51
51
|
id: 'configure-supporting-constructs',
|
|
52
52
|
description: 'Status pages (`StatusPage`), dashboards (`Dashboard`), maintenance windows (`MaintenanceWindow`), and private locations (`PrivateLocation`)',
|
|
53
53
|
},
|
|
54
|
+
{
|
|
55
|
+
id: 'configure-environment',
|
|
56
|
+
description: 'Environment variables: built-in vars Checkly injects at runtime (`CHECK_ID`, `CHECK_NAME`, `REGION`, `CHECKLY_*`), user-defined variables and secrets at global/group/check scope, reference syntax (`process.env` vs `{{handlebars}}`), and the `checkly env` CLI for managing global vars.',
|
|
57
|
+
},
|
|
54
58
|
];
|
|
55
59
|
export const INVESTIGATE_REFERENCES = [
|
|
56
60
|
{
|
|
57
61
|
id: 'investigate-checks',
|
|
58
62
|
description: 'Inspecting checks (`checks list`, `checks get`) and triggering on-demand runs',
|
|
59
63
|
},
|
|
64
|
+
{
|
|
65
|
+
id: 'investigate-test-sessions',
|
|
66
|
+
description: 'Run and inspect recorded test sessions, drill into test-session error groups, run RCA, and retrieve result assets',
|
|
67
|
+
},
|
|
60
68
|
];
|
|
61
69
|
export const COMMUNICATE_REFERENCES = [
|
|
62
70
|
{
|
|
@@ -90,7 +98,7 @@ export const ACTIONS = [
|
|
|
90
98
|
},
|
|
91
99
|
{
|
|
92
100
|
id: 'investigate',
|
|
93
|
-
description: 'Access check status, analyze failures, and investigate errors.',
|
|
101
|
+
description: 'Access check and test-session status, analyze failures, and investigate errors.',
|
|
94
102
|
references: INVESTIGATE_REFERENCES,
|
|
95
103
|
},
|
|
96
104
|
{
|
|
@@ -162,6 +170,11 @@ const playwrightChecks = new PlaywrightCheck("multi-browser-check", {
|
|
|
162
170
|
// Playwright Check Suites support all browsers
|
|
163
171
|
// defined in your \`playwright.config\`
|
|
164
172
|
pwProjects: ["chromium", "firefox", "webkit"],
|
|
173
|
+
// Bundle non-code assets that specs read via \`fs\` at runtime.
|
|
174
|
+
// Test files and anything reachable through \`import\` are already
|
|
175
|
+
// bundled — \`include\` is only for files outside the import graph.
|
|
176
|
+
// Globs resolve relative to the playwright config's directory.
|
|
177
|
+
include: ["fixtures/**/*.json", "docs/**/*.md"],
|
|
165
178
|
});
|
|
166
179
|
`,
|
|
167
180
|
reference: 'https://www.checklyhq.com/docs/constructs/playwright-check/',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/ai-context/context.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB;QACE,EAAE,EAAE,0BAA0B;QAC9B,WAAW,EAAE,oHAAoH;KAClI;IACD;QACE,EAAE,EAAE,sBAAsB;QAC1B,WAAW,EAAE,gFAAgF;KAC9F;IACD;QACE,EAAE,EAAE,0BAA0B;QAC9B,WAAW,EAAE,qEAAqE;KACnF;IACD;QACE,EAAE,EAAE,6BAA6B;QACjC,WAAW,EAAE,oFAAoF;KAClG;IACD;QACE,EAAE,EAAE,4BAA4B;QAChC,WAAW,EAAE,qEAAqE;KACnF;IACD;QACE,EAAE,EAAE,wBAAwB;QAC5B,WAAW,EAAE,sDAAsD;KACpE;IACD;QACE,EAAE,EAAE,wBAAwB;QAC5B,WAAW,EAAE,sDAAsD;KACpE;IACD;QACE,EAAE,EAAE,wBAAwB;QAC5B,WAAW,EAAE,sDAAsD;KACpE;IACD;QACE,EAAE,EAAE,yBAAyB;QAC7B,WAAW,EAAE,gFAAgF;KAC9F;IACD;QACE,EAAE,EAAE,8BAA8B;QAClC,WAAW,EAAE,kDAAkD;KAChE;IACD;QACE,EAAE,EAAE,wBAAwB;QAC5B,WAAW,EAAE,+DAA+D;KAC7E;IACD;QACE,EAAE,EAAE,0BAA0B;QAC9B,WAAW,EAAE,kJAAkJ;KAChK;IACD;QACE,EAAE,EAAE,iCAAiC;QACrC,WAAW,EAAE,6IAA6I;KAC3J;CACO,CAAA;AAEV,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC;QACE,EAAE,EAAE,oBAAoB;QACxB,WAAW,EAAE,+EAA+E;KAC7F;CACO,CAAA;AAEV,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC;QACE,EAAE,EAAE,uBAAuB;QAC3B,WAAW,EAAE,uFAAuF;KACrG;CACO,CAAA;AAEV,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B;QACE,EAAE,EAAE,aAAa;QACjB,WAAW,EAAE,4FAA4F;KAC1G;IACD;QACE,EAAE,EAAE,wBAAwB;QAC5B,WAAW,EAAE,8DAA8D;KAC5E;CACO,CAAA;AAEV,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,iJAAiJ;CACtJ,CAAA;AAEV,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB;QACE,EAAE,EAAE,YAAY;QAChB,WAAW,EAAE,4EAA4E;KAC1F;IACD;QACE,EAAE,EAAE,WAAW;QACf,WAAW,EAAE,wFAAwF;QACrG,UAAU,EAAE,UAAU;KACvB;IACD;QACE,EAAE,EAAE,aAAa;QACjB,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/ai-context/context.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB;QACE,EAAE,EAAE,0BAA0B;QAC9B,WAAW,EAAE,oHAAoH;KAClI;IACD;QACE,EAAE,EAAE,sBAAsB;QAC1B,WAAW,EAAE,gFAAgF;KAC9F;IACD;QACE,EAAE,EAAE,0BAA0B;QAC9B,WAAW,EAAE,qEAAqE;KACnF;IACD;QACE,EAAE,EAAE,6BAA6B;QACjC,WAAW,EAAE,oFAAoF;KAClG;IACD;QACE,EAAE,EAAE,4BAA4B;QAChC,WAAW,EAAE,qEAAqE;KACnF;IACD;QACE,EAAE,EAAE,wBAAwB;QAC5B,WAAW,EAAE,sDAAsD;KACpE;IACD;QACE,EAAE,EAAE,wBAAwB;QAC5B,WAAW,EAAE,sDAAsD;KACpE;IACD;QACE,EA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,EAAE,2CAA2C;QAC3D,iBAAiB,EAAE,8DAA8D;QACjF,SAAS,EAAE,oEAAoE;KAChF;CACF,CAAA"}
|
|
@@ -14,6 +14,8 @@ Then run `npx checkly skills <action>` to load up-to-date details for the action
|
|
|
14
14
|
|
|
15
15
|
Use `npx checkly skills install` to install this skill into your project (supports Claude Code, Cursor, Codex and more).
|
|
16
16
|
|
|
17
|
+
For recorded test-session investigations, run `npx checkly skills investigate test-sessions`.
|
|
18
|
+
|
|
17
19
|
## Progressive Disclosure via `npx checkly skills`
|
|
18
20
|
|
|
19
21
|
The skill is structured for efficient context usage:
|
|
@@ -101,7 +103,7 @@ Learn how to initialize and set up a new Checkly CLI project from scratch.
|
|
|
101
103
|
Learn how to create and manage monitoring checks using Checkly constructs and the CLI.
|
|
102
104
|
|
|
103
105
|
### `npx checkly skills investigate`
|
|
104
|
-
Access check status, analyze failures, and investigate errors.
|
|
106
|
+
Access check and test-session status, analyze failures, and investigate errors.
|
|
105
107
|
|
|
106
108
|
### `npx checkly skills communicate`
|
|
107
109
|
Open incidents and lead customer communications via status pages.
|
|
@@ -70,3 +70,4 @@ Note the names: `notEmpty` (not `isNotEmpty`), `greaterThan` / `lessThan` (not `
|
|
|
70
70
|
- Use axios for making HTTP requests.
|
|
71
71
|
- Read the input credentials from env variables using `process.env`.
|
|
72
72
|
- Pass auth tokens to the request object using `request.headers['key'] = AUTH_TOKEN_VALUE`.
|
|
73
|
+
- For built-in env vars setup/teardown scripts receive at runtime (`CHECK_ID`, `REGION`, `RUNTIME_VERSION`, `PUBLIC_IP_V4`, etc.), see `npx checkly skills configure environment`. The API request itself doesn't run JS — use Handlebars (`{{MY_VAR}}`) in URL, headers, body, basic auth, and query params instead.
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
- Use the `code.entrypoint` property to specify the path to your Playwright test file.
|
|
6
6
|
- **Important:** The target URL must be publicly accessible — checks run on Checkly's cloud, not locally.
|
|
7
7
|
- **Plan-gated properties:** `retryStrategy`, `runParallel`, and higher frequencies may not be available on all plans. Check entitlements matching `BROWSER_CHECKS_*` before using these. Omit any property whose entitlement is disabled. See `npx checkly skills manage` for details.
|
|
8
|
+
- For env vars Checkly exposes at runtime (`CHECK_ID`, `REGION`, `RUNTIME_VERSION`, etc.), see `npx checkly skills configure environment`.
|
|
8
9
|
|
|
9
10
|
**Reference:** https://www.checklyhq.com/docs/constructs/browser-check/
|
|
10
11
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
- Import the `CheckGroupV2` construct from `checkly/constructs`.
|
|
4
4
|
- Check Groups are used to group checks together for easier management and organization.
|
|
5
5
|
- Checks are added to Check Groups by referencing the group in the `group` property of a check.
|
|
6
|
+
- **Alert channels on a group require `alertEscalationPolicy`.** If you set custom `alertChannels` on a `CheckGroupV2` without also setting `alertEscalationPolicy`, the group's channels are ignored and each check uses its own alert settings. Use `alertEscalationPolicy: 'global'` to apply the account-wide policy, or build a custom policy with `AlertEscalationBuilder` from `checkly/constructs`.
|
|
6
7
|
|
|
7
8
|
**Reference:** https://www.checklyhq.com/docs/constructs/check-group/
|
|
8
9
|
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Environment Variables
|
|
2
|
+
|
|
3
|
+
Checks execute on Checkly's cloud infrastructure, not on the user's machine. Two sources of values are exposed at runtime: built-in variables Checkly injects, and user-defined variables managed in the project, group, check, or globally via the CLI.
|
|
4
|
+
|
|
5
|
+
## Built-in: Available in All Check Types
|
|
6
|
+
|
|
7
|
+
Entries with no value are stripped.
|
|
8
|
+
|
|
9
|
+
| Variable | Description |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| `CHECK_ID` | UUID of the check. |
|
|
12
|
+
| `CHECK_NAME` | Name of the check. |
|
|
13
|
+
| `CHECK_TYPE` | `BROWSER`, `MULTISTEP`, `API`, `PLAYWRIGHT`, etc. |
|
|
14
|
+
| `CHECK_RUN_ID` | ID of the run. Format varies by check type (UUID for Playwright Check Suites, numeric ID for browser/multistep). |
|
|
15
|
+
| `CHECK_RESULT_ID` | UUID of the result record. |
|
|
16
|
+
| `ACCOUNT_ID` | UUID of the Checkly account. |
|
|
17
|
+
| `REQUEST_URL` | The check's request URL (mainly relevant for API checks). |
|
|
18
|
+
| `GROUP_BASE_URL` | Base URL of the check's group, if any. |
|
|
19
|
+
| `CLIENT_CERTIFICATE` | Client cert if configured. |
|
|
20
|
+
| `ENVIRONMENT_NAME` | Deployment environment name. Set only for CI/CD-triggered runs. |
|
|
21
|
+
| `DEPLOYMENT_ID` | Deployment UUID. Set only for CI/CD-triggered runs. |
|
|
22
|
+
|
|
23
|
+
## Built-in: Browser Checks, MultiStep Checks, API Setup/Teardown
|
|
24
|
+
|
|
25
|
+
In addition to the variables above:
|
|
26
|
+
|
|
27
|
+
| Variable | Description |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| `REGION` | AWS region of the runner. |
|
|
30
|
+
| `RUNTIME_VERSION` | Runtime version string (e.g. `2025.04`). |
|
|
31
|
+
| `PUBLIC_IP_V4` | Public IPv4 of the runner. Value has a trailing newline — call `.trim()` before using. |
|
|
32
|
+
| `PUBLIC_IP_V6` | Public IPv6 of the runner. Value has a trailing newline — call `.trim()` before using. |
|
|
33
|
+
|
|
34
|
+
## Built-in: Playwright Check Suites
|
|
35
|
+
|
|
36
|
+
In addition to the variables in the first table:
|
|
37
|
+
|
|
38
|
+
| Variable | Description |
|
|
39
|
+
| --- | --- |
|
|
40
|
+
| `CHECKLY` | Always `1`. Cleanest "am I running on Checkly?" signal. |
|
|
41
|
+
| `CHECKLY_CHECK_ID` | UUID of the check. Mirrors `CHECK_ID`. |
|
|
42
|
+
| `CHECKLY_REGION` | Region where the run executes. |
|
|
43
|
+
| `CHECKLY_RUN_SOURCE` | What triggered the run (CLI deploy, deployment, group run, manual schedule, scheduler, test, API). |
|
|
44
|
+
| `CI` | `1` for CLI runs (`npx checkly test`, `npx checkly trigger`) and deployment-triggered runs. |
|
|
45
|
+
|
|
46
|
+
Docs: https://www.checklyhq.com/docs/detect/synthetic-monitoring/playwright-checks/environment-variables/
|
|
47
|
+
|
|
48
|
+
## User-Defined Variables
|
|
49
|
+
|
|
50
|
+
User-defined variables live at three scopes. Precedence: **check overrides group overrides global**.
|
|
51
|
+
|
|
52
|
+
- **Global** — available to every check and alert channel in the account. Managed in the UI or via `npx checkly env *`.
|
|
53
|
+
- **Group** — scoped to a check group and all its checks. Defined on the `CheckGroupV2` construct.
|
|
54
|
+
- **Check** — scoped to a single check. Defined on the construct.
|
|
55
|
+
|
|
56
|
+
### Variables vs. Secrets
|
|
57
|
+
|
|
58
|
+
- **Variables** are plaintext: visible in the UI, on result pages, in logs, and exportable via CLI / API.
|
|
59
|
+
- **Secrets** are encrypted at rest and never visible after creation — not in the UI, not in logs, not retrievable via CLI or API. Secrets require runtime `2024.09` or later (`3.3.4+` for Private Locations, CLI `4.9.0+`).
|
|
60
|
+
- **Locked** variables are encrypted at rest and restricted to Read & Write, Admin, or Owner roles.
|
|
61
|
+
|
|
62
|
+
Docs: https://www.checklyhq.com/docs/platform/variables/
|
|
63
|
+
|
|
64
|
+
## Reference Syntax
|
|
65
|
+
|
|
66
|
+
How to read a variable depends on the context:
|
|
67
|
+
|
|
68
|
+
| Context | Syntax |
|
|
69
|
+
| --- | --- |
|
|
70
|
+
| Browser checks, MultiStep checks, API setup/teardown scripts | `process.env.MY_VAR` |
|
|
71
|
+
| API check requests (URL, headers, body, query params, basic auth) | `{{MY_VAR}}` |
|
|
72
|
+
| API check requests where URI encoding is unwanted | `{{{MY_VAR}}}` |
|
|
73
|
+
| Webhook alert channel payloads | `{{MY_VAR}}` |
|
|
74
|
+
|
|
75
|
+
## Managing Global Variables via the CLI
|
|
76
|
+
|
|
77
|
+
`npx checkly env` manages **global** account variables. Group- and check-level variables are managed via the UI or directly on the construct.
|
|
78
|
+
|
|
79
|
+
| Command | Description |
|
|
80
|
+
| --- | --- |
|
|
81
|
+
| `npx checkly env add <key> <value> [--locked\|-l] [--secret\|-s]` | Create a variable. |
|
|
82
|
+
| `npx checkly env update <key> <value> [--locked\|-l] [--secret\|-s]` | Update an existing variable. |
|
|
83
|
+
| `npx checkly env ls` | List all account variables; secrets are masked. |
|
|
84
|
+
| `npx checkly env pull [filename] [--force\|-f]` | Export to a local file (default `.env`). |
|
|
85
|
+
| `npx checkly env rm <key> [--force\|-f]` | Delete a variable. |
|
|
86
|
+
|
|
87
|
+
Docs: https://www.checklyhq.com/docs/cli/checkly-env/
|
|
88
|
+
|
|
89
|
+
## Common Use
|
|
90
|
+
|
|
91
|
+
- Gate behavior between local runs and Checkly cloud by checking `process.env.CHECK_ID` (set for every check type).
|
|
92
|
+
- Differentiate retry counts, reporter output, or fixture loading by environment without defining a custom env var.
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
- Import the `MultiStepCheck` construct from `checkly/constructs`.
|
|
4
4
|
- Generate a separate `.spec.ts` file for the Playwright code referenced in the `MultiStepCheck` construct.
|
|
5
5
|
- Use the `code.entrypoint` property to specify the path to your Playwright test file.
|
|
6
|
+
- For env vars Checkly exposes at runtime (`CHECK_ID`, `REGION`, `RUNTIME_VERSION`, etc.), see `npx checkly skills configure environment`.
|
|
6
7
|
|
|
7
8
|
**Reference:** https://www.checklyhq.com/docs/constructs/multistep-check/
|
|
8
9
|
|
|
@@ -1,9 +1,54 @@
|
|
|
1
1
|
# Playwright Check Suites
|
|
2
2
|
|
|
3
3
|
- Import the `PlaywrightCheck` construct from `checkly/constructs`.
|
|
4
|
+
- Use Playwright Check Suites to run an existing Playwright project. Do not rewrite tests as Browser or Multistep Checks unless the user asks.
|
|
5
|
+
- Set `playwrightConfigPath` relative to the `.check.ts` file that declares the construct, not the project root. If the check is in `monitoring/suites.check.ts` and the config is at the repo root, use `"../playwright.config.ts"`.
|
|
6
|
+
- Use `pwProjects` only when the user wants specific Playwright projects. Values must match the Playwright project `name`, such as `"Cart & Checkout"`, not a folder or slug. Wrong names can deploy but run zero tests.
|
|
7
|
+
- Use `pwTags` only when the user wants tag-based selection.
|
|
8
|
+
|
|
9
|
+
## Dependencies
|
|
10
|
+
|
|
11
|
+
- Use the user's `package.json` and lock file for dependencies. Do not add dependency declarations to check code.
|
|
12
|
+
- For private packages or custom registries, include the registry config file, usually `.npmrc`, with `include`.
|
|
13
|
+
- The `.npmrc` should reference a Checkly environment variable such as `${NPM_TOKEN}`. Tell the user that the token must exist in Checkly before `deploy` or `trigger`.
|
|
14
|
+
- Use `installCommand` only when the default package-manager install command is not enough.
|
|
15
|
+
- In Checkly CLI v8.0.0 and later, `include` patterns resolve relative to the Playwright config directory, not the project root. If `playwrightConfigPath` points to a subdirectory, adjust `include` globs. Example: `playwrightConfigPath: "./e2e/playwright.config.ts"` with root `.npmrc` needs `include: ["../.npmrc"]`.
|
|
16
|
+
|
|
17
|
+
## Install troubleshooting
|
|
18
|
+
|
|
19
|
+
- The execution environment is Linux and non-root, and it does not include a C/C++ compiler. Browsers are pre-installed, so never add `playwright install`, `npx playwright install`, Puppeteer browser downloads, or similar browser installation commands.
|
|
20
|
+
- If `scripts.postinstall`, `scripts.prepare`, or `scripts.install` references missing files, downloads browsers, sets up git hooks, or compiles native code, set `installCommand` to skip project lifecycle scripts and rebuild dependency scripts:
|
|
21
|
+
- npm: `npm install --ignore-scripts && npm rebuild`
|
|
22
|
+
- pnpm: `pnpm install --ignore-scripts && pnpm rebuild`
|
|
23
|
+
- Flag likely dependency problems before suggesting a deploy:
|
|
24
|
+
- `puppeteer` is usually unnecessary because browsers are pre-installed.
|
|
25
|
+
- Native dependencies that require a compiler, such as `sharp` or `better-sqlite3`, may fail.
|
|
26
|
+
- `fsevents` must be optional; a locked non-optional `fsevents` dependency can fail on Linux.
|
|
27
|
+
- `workspace:*` dependencies must be included in the uploaded bundle.
|
|
28
|
+
- Private registries must have auth configured through Checkly environment variables.
|
|
29
|
+
|
|
30
|
+
## Runtime model
|
|
31
|
+
|
|
32
|
+
- Do not use `runtimeId` for Playwright Check Suites. Browser and Multistep Checks use `runtimeId`; Playwright Check Suites use project dependencies plus `engine`.
|
|
33
|
+
- Omit `engine` unless the user explicitly asks to override the JavaScript engine or version.
|
|
34
|
+
- If an engine override is needed, import `Engine` from `checkly/constructs` and use `Engine.node("24")` or `Engine.bun("1.3")`.
|
|
35
|
+
- If no engine is configured or detected, Checkly defaults to Node.js 22. Node.js engine majors map to pinned patch versions: `22` -> `22.14.0`, `24` -> `24.13.1`, and `26` -> `26.2.0`.
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { PlaywrightCheck } from "checkly/constructs"
|
|
39
|
+
|
|
40
|
+
new PlaywrightCheck("checkout-suite", {
|
|
41
|
+
name: "Checkout suite",
|
|
42
|
+
playwrightConfigPath: "./e2e/playwright.config.ts",
|
|
43
|
+
// Include root .npmrc for private package or registry auth.
|
|
44
|
+
include: ["../.npmrc"],
|
|
45
|
+
})
|
|
46
|
+
```
|
|
4
47
|
- `playwrightConfigPath` is resolved **relative to the `.check.ts` file that declares the construct**, not the project root. If your check lives in `monitoring/suites.check.ts` and your config in `playwright.config.ts` at the repo root, use `'../playwright.config.ts'`.
|
|
5
48
|
- use `pwProjects` if you're tasked to reuse a Playwright project. Values must match the `name` field of each project in your `playwright.config.ts` (e.g. `'Cart & Checkout'`), **not** the directory slug. Mismatched names deploy silently and resolve to zero tests.
|
|
6
49
|
- use `pwTags` if you're tasked to reuse a Playwright tag.
|
|
50
|
+
- Use `include` only for non-code assets that specs read via `fs` at runtime (markdown, JSON fixtures, snapshots). Test files and anything reachable through `import` are already bundled via Playwright's project discovery and the import graph — listing them in `include` is redundant. Globs resolve **relative to the directory of `playwrightConfigPath`**, not the project root and not the `.check.ts`.
|
|
51
|
+
- For env vars Checkly exposes at runtime (e.g. `CHECKLY=1` for "am I running on Checkly?"), see `npx checkly skills configure environment`.
|
|
7
52
|
|
|
8
53
|
**Reference:** https://www.checklyhq.com/docs/constructs/playwright-check/
|
|
9
54
|
|
|
@@ -16,5 +61,10 @@ const playwrightChecks = new PlaywrightCheck("multi-browser-check", {
|
|
|
16
61
|
// Playwright Check Suites support all browsers
|
|
17
62
|
// defined in your `playwright.config`
|
|
18
63
|
pwProjects: ["chromium", "firefox", "webkit"],
|
|
64
|
+
// Bundle non-code assets that specs read via `fs` at runtime.
|
|
65
|
+
// Test files and anything reachable through `import` are already
|
|
66
|
+
// bundled — `include` is only for files outside the import graph.
|
|
67
|
+
// Globs resolve relative to the playwright config's directory.
|
|
68
|
+
include: ["fixtures/**/*.json", "docs/**/*.md"],
|
|
19
69
|
});
|
|
20
70
|
```
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
- Use the [Checkly construct reference documentation](https://www.checklyhq.com/docs/constructs/overview/).
|
|
7
7
|
- Import and / or require any constructs you need in your code, such as `ApiCheck`, `BrowserCheck`, or `PlaywrightCheck` from the `checkly/constructs` package.
|
|
8
8
|
- Always ground generated code and CLI commands against the official documentation and examples in this file.
|
|
9
|
+
- Use `runtimeId` for Browser Checks and MultiStep Checks. Runtimes are managed Checkly execution environments with fixed Checkly-provided dependencies such as Playwright, browser binaries, and runtime libraries.
|
|
10
|
+
- Use `engine` only for Playwright Check Suites. `engine` selects the JavaScript engine version that runs the user's own Playwright project.
|
|
9
11
|
|
|
10
12
|
## Using the Checkly CLI
|
|
11
13
|
|
|
@@ -19,7 +21,7 @@
|
|
|
19
21
|
- `*.check.ts|js` - TS / JS files that define the checks.
|
|
20
22
|
- `*.spec.ts|js` - TS / JS files that contain Playwright code for Browser and MultiStep checks.
|
|
21
23
|
- `src/__checks__` - Default directory where all your checks are stored. Use this directory if it already exists, otherwise create a new directory for your checks.
|
|
22
|
-
- `package.json` - Standard
|
|
24
|
+
- `package.json` - Standard npm project manifest.
|
|
23
25
|
|
|
24
26
|
Here is an example directory tree of what that would look like:
|
|
25
27
|
|
|
@@ -118,6 +120,9 @@ Email (`EmailAlertChannel`), Phone (`PhoneCallAlertChannel`), Slack (`SlackAlert
|
|
|
118
120
|
### `npx checkly skills configure supporting-constructs`
|
|
119
121
|
Status pages (`StatusPage`), dashboards (`Dashboard`), maintenance windows (`MaintenanceWindow`), and private locations (`PrivateLocation`)
|
|
120
122
|
|
|
123
|
+
### `npx checkly skills configure environment`
|
|
124
|
+
Environment variables: built-in vars Checkly injects at runtime (`CHECK_ID`, `CHECK_NAME`, `REGION`, `CHECKLY_*`), user-defined variables and secrets at global/group/check scope, reference syntax (`process.env` vs `{{handlebars}}`), and the `checkly env` CLI for managing global vars.
|
|
125
|
+
|
|
121
126
|
## Important: Public URL Requirement
|
|
122
127
|
|
|
123
128
|
All checks (API, Browser, URL monitors) run on **Checkly's cloud infrastructure**, not on the user's local machine. Target URLs must be publicly accessible from the internet.
|