diff --git a/detect/synthetic-monitoring/playwright-checks/environment-variables.mdx b/detect/synthetic-monitoring/playwright-checks/environment-variables.mdx new file mode 100644 index 0000000..f23ae1b --- /dev/null +++ b/detect/synthetic-monitoring/playwright-checks/environment-variables.mdx @@ -0,0 +1,32 @@ +--- +title: Playwright Check Suite Environment Variables +sidebarTitle: Environment Variables +description: "Customize your Playwright Check Suite runs based on the execution environment." +tags: ["synthetic-monitoring", "playwright-checks", "environment-variables"] +--- + +Checkly sets the following built-in environment variables on every Playwright Check Suite run. They provide information about the check execution environment, and allow you to distinguish between Checkly executions and local runs. + +- **CHECKLY**: Set to `1` for all check runs executed by Checkly. +- **CHECKLY_RUN_SOURCE**: Indicates the manual or scheduled check run trigger. Use this variable to skip parts of your test suite in certain scenarios or adjust the check run configuration. Possible values include: + - `CLI_DEPLOY`: Checks deployed using `npx checkly deploy` get their first run scheduled with this type. + - `DEPLOYMENT`: The check was triggered as part of a [CI/CD deployment](/integrations/ci-cd/github/deployments). + - `GROUP_RUN_ALL`: The check was triggered as part of a group edit by a user clicking the "Run all checks" button. + - `SCHEDULE_NOW`: The check was triggered manually by a user clicking "Schedule now" in the webapp. + - `SCHEDULER`: The check was run as part of its regular schedule. + - `TEST_NO_RECORD`: The check triggered from the CLI with `npx checkly test`. + - `TEST_RECORD`: The check triggered from the CLI with `npx checkly test --record`. + - `TRIGGER_API`: The check was triggered via the API. + - `TRIGGER_NO_RECORD`: The check triggered from the CLI with `npx checkly trigger`. + - `TRIGGER_RECORD`: The check triggered from the CLI with `npx checkly trigger --record`. +- **CI**: Set to `1` for the following check runs: + - CLI runs via `npx checkly test` or `npx checkly trigger`. + - Check runs that are triggered by [deployments](/integrations/ci-cd/github/deployments). + +The following variables are mostly for informational and debugging purposes and shouldn't be used to influence test behaviour. + +- `ACCOUNT_ID`: The UUID of the Checkly account as found in the URL. +- `CHECK_NAME`: The name of the check. +- `CHECKLY_CHECK_ID`: The UUID of the check as found in the URL. +- `CHECKLY_REGION`: The region in which the check was executed. + diff --git a/docs.json b/docs.json index 9afea47..7b26264 100644 --- a/docs.json +++ b/docs.json @@ -233,7 +233,8 @@ "detect/synthetic-monitoring/playwright-checks/configuration", "detect/synthetic-monitoring/playwright-checks/test-organization", "detect/synthetic-monitoring/playwright-checks/add-to-group", - "detect/synthetic-monitoring/playwright-checks/custom-dependencies" + "detect/synthetic-monitoring/playwright-checks/custom-dependencies", + "detect/synthetic-monitoring/playwright-checks/environment-variables" ] } @@ -726,7 +727,7 @@ { "group": "Incidents", "pages": [ - "incidents/create-an-incident", + "api-reference/incidents/create-an-incident", "api-reference/incidents/retrieve-an-incident", "api-reference/incidents/update-an-incident", "api-reference/incidents/delete-an-incident" @@ -786,8 +787,8 @@ "group": "Snippets", "pages": [ "api-reference/snippets/list-all-snippets", - "snippets/create-a-snippet", - "snippets/retrieve-a-snippet", + "api-reference/snippets/create-a-snippet", + "api-reference/snippets/retrieve-a-snippet", "api-reference/snippets/update-a-snippet", "api-reference/snippets/delete-a-snippet" ] @@ -854,7 +855,7 @@ { "group": "Environment variables", "pages": [ - "api-reference/apenvironment-variables/list-all-environment-variables", + "api-reference/environment-variables/list-all-environment-variables", "api-reference/environment-variables/create-an-environment-variable", "api-reference/environment-variables/retrieve-an-environment-variable", "api-reference/environment-variables/update-an-environment-variable", diff --git a/platform/variables.mdx b/platform/variables.mdx index 22836ef..a24beb9 100644 --- a/platform/variables.mdx +++ b/platform/variables.mdx @@ -92,3 +92,7 @@ How variables are accessed depends on where you're accessing them from: Handlebar (double brackets) variables will be URI encoded. To avoid encoding, you can access your environment variables with triple brackets, i.e. `{{{VARIABLE_NAME}}}`. + +## Playwright Check Suite Variables + +Checkly provides a set of [built-in environment variables](/detect/synthetic-monitoring/playwright-checks/environment-variables) that you can use in your [Playwright Check Suites](/detect/synthetic-monitoring/playwright-checks/overview) to distinguish between Checkly executions and local runs.