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 loginif needed) - Playwright tests in your project
- A
playwright.config.tsorplaywright.config.jsfile.
Basic Usage
Use-- to separate Checkly flags from Playwright test options.
Terminal
- Checkly Command Options
- Playwright Test Options
Define
checkly pw-test specific options before the -- separator:Checkly Command Options
string
Specify a configuration file to use instead of the
checkly.config.ts or checkly.config.js in the current directory.Usage:Terminal
boolean
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.Pass environment variables to the test run. Can be specified multiple times to set multiple variables.Usage:
Terminal
string
Specify a dotenv file path to load environment variables from. This is useful for managing multiple environment variables in a single file.Usage:
Terminal
string
Specify the geographic location where the checks should run. This determines which Checkly data center executes your tests.Usage:
Terminal
string
Run checks at a specific private location. Private locations allow you to test internal applications or services behind a firewall.Usage:
Terminal
boolean
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
string
Specify a custom reporter for the test output. Available options:
list, dot, ci, github, jsonUsage:Terminal
boolean
Stream logs from the test run to the console in real-time. This provides immediate feedback during test execution.Usage:
Terminal
string
Provide a custom name for the test session when storing results in Checkly. This helps identify and organize test runs.Usage:
Terminal
number
default:"600"
Set a timeout (in seconds) to wait for checks to complete.Usage:
Terminal
The current maximum timeout is 1200 seconds (20 minutes).
boolean
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.
string
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.string
Filter tests to run based on a pattern match against test titles. Only tests matching the pattern will be executed.Usage:
Terminal
string
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
2retries - use
1worker - 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-testautomatically records test sessions (no--recordflag 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