checkly pw-test
command runs Playwright tests with Checkly monitoring features and reuses the Playwright CLI arguments.
This command automatically records test sessions without requiring the --record
flag.
Prerequisites
Prerequisites
Before using
checkly pw-test
, ensure you have:- An initialized Checkly CLI project
- Valid Checkly account authentication (run
npx checkly login
if needed) - Playwright tests in your project
- A
playwright.config.ts
orplaywright.config.js
file.
Basic Usage
Use--
to separate Checkly flags from Playwright test options.
Terminal
Define
checkly pw-test
specific options before the --
separator:Option | Description |
---|---|
--config | The Checkly CLI configuration file. If not passed, uses the checkly.config.ts|js file in the current directory. |
--create-check | Create a Checkly check from the Playwright test. |
--env, -e | Env vars to be passed to the test run. Default: [] |
--env-file | dotenv file path to be passed. For example --env-file="./.env" |
--location, -l | The location to run the checks at. |
--private-location | The private location to run checks at. |
--[no-]record | Record test results in Checkly as a test session with full logs, traces and videos. |
--reporter | A list of custom reporters for the test output. |
--stream-logs | Stream logs from the test run to the console. |
--test-session-name | A name to use when storing results in Checkly |
--timeout | A timeout (in seconds) to wait for checks to complete. |
--verbose | Always show the full logs of the checks. |
Checkly Command Options
Specify a configuration file to use instead of the
checkly.config.ts
or checkly.config.js
in the current directory.Usage:Terminal
Add a new Playwright Check Suite with your Playwright configuration to your Examples:Running this command:Adds a new Playwright Check Suite to your
checkly.config
.Usage:Terminal
Terminal
checkly.config.ts
:checkly.config.ts
If there’s no existing
checkly.config.ts
file, the --create-check
option will create one.--env, -e
Pass environment variables to the test run. Can be specified multiple times to set multiple variables.Usage:
Terminal
Specify a dotenv file path to load environment variables from. This is useful for managing multiple environment variables in a single file.Usage:
Terminal
Specify the geographic location where the checks should run. This determines which Checkly data center executes your tests.Usage:
Terminal
Run checks at a specific private location. Private locations allow you to test internal applications or services behind a firewall.Usage:
Terminal
The
pw-test
automatically records your test results as a test session with full logs, traces, and videos. Use --no-record
to disable recording.Usage:Terminal
Specify a custom reporter for the test output. Available options:
list
, dot
, ci
, github
, json
Usage:Terminal
Stream logs from the test run to the console in real-time. This provides immediate feedback during test execution.Usage:
Terminal
Provide a custom name for the test session when storing results in Checkly. This helps identify and organize test runs.Usage:
Terminal
Set a timeout (in seconds) to wait for checks to complete.Usage:
Terminal
The current maximum timeout is 1200 seconds (20 minutes).
Enable verbose output to always show the full logs of the checks. This provides detailed information about test execution.Usage:
Terminal
Common Playwright Test Options
Thepw-test
command will reuse your playwright.config
settings. To overwrite these values from the command line, Playwright Check Suites supports most Playwright test runner options.
Here are some commonly used command line options for running your Playwright tests in the Checkly infrastructure.
Select specific Playwright projects to run. This allows you to run only a subset of your configured projects from your Playwright configuration.Usage:
Terminal
You can only run projects specified in your
playwright.config
file.Filter tests to run based on a pattern match against test titles. Only tests matching the pattern will be executed.Usage:
Terminal
Exclude tests from running based on a pattern match against test titles. Tests matching the pattern will be skipped.Usage:
Terminal
Playwright Configuration vs. Applied Command Line Options
Playwright Check Suites and thepw-test
command read and parse your existing playwright.config
to apply your configuration.
To differentiate between your local testing setup and the Checkly monitoring environment, you can rely on the set CI
environment variable or override specific settings using command line options.
playwright.config.ts
npx checkly pw-test
without additional arguments, the test suite will:
- run with
2
retries - use
1
worker - run all defined projects including
chromium
pw-test
.
Terminal
Examples
Run tests in multiple browsers
Terminal
Run tests by pattern
Terminal
Run tests by file
Terminal
Key Features
pw-test
automatically records test sessions (no--record
flag needed)- Your Playwright configuration applies automatically (traces, videos, screenshots)
- View all artifacts in Checkly’s UI
Related Commands
checkly test
- Test your setup before deploymentcheckly deploy
- Deploy your Checkly configuration