Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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.

11 changes: 6 additions & 5 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}

Expand Down Expand Up @@ -726,7 +727,7 @@
{
"group": "Incidents",
"pages": [
"incidents/create-an-incident",
"api-reference/incidents/create-an-incident",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! 👏

"api-reference/incidents/retrieve-an-incident",
"api-reference/incidents/update-an-incident",
"api-reference/incidents/delete-an-incident"
Expand Down Expand Up @@ -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"
]
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions platform/variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,7 @@ How variables are accessed depends on where you're accessing them from:
<Note>
Handlebar (double brackets) variables will be URI encoded. To avoid encoding, you can access your environment variables with triple brackets, i.e. `{{{VARIABLE_NAME}}}`.
</Note>

## 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.