QuickStart Guide
Here’s how to get started with Playwright Check Suites.Before you begin
What you need:- A checkly account
- A repository using Playwright for end-to-end testing and a Playwright configuration file.
Steps
1. Install the Checkly CLI
terminal
2. [Optional] If you’re using TypeScript
If you’re using TypeScript, install the dev dependencyjiti. Jiti will enable the CLI to bundle your TypeScript config and test files correctly.
terminal
3. Use pw-test to test in Checkly
Run your existing Playwright test suite using pw-test.
pw-test accepts both Checkly and Playwright command line arguments using the following syntax:
npx checkly pw-test [--checkly-flag] -- [--playwright-flag]. Use -- to separate Checkly and Playwright flags.
The CLI command will then return a link to the test session results, traces and more details:
4. Convert tests to monitoring checks with pw-test --create-check:
The pw-test command enables you to run your existing tests in the Checkly infrastructure.
Use the --create-check flag to define the new check in your checkly.config.ts file.
--create-check will create a checkly.config.ts file if it doesn’t exist and will include the necessary definitions to run your Playwright tests as a synthetic check.
For example:
checkly.config.ts file and make sure to adjust locations and schedule as needed.
5. Test your monitoring configuration
After creating yourcheckly.config.ts file, run the checkly test command to validate and test your Checkly monitoring infrastructure that now includes your new Playwright Check Suite.
The difference between
checkly test and checkly pw-test is that test uses checkly.config.* and takes all your defined monitors and runs them in the Checkly infrastructure. pw-test uses your playwright.config.* instead, which parses and runs your existing Playwright tests with the provided CLI configuration.6. Deploy your Playwright Check Suites
Once you are happy with the test results and ready to start monitoring your applications with your defined checks, deploy your Playwright Check Suite into global monitoring withnpx checkly deploy.
terminal