Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Commit f573deb

Browse files
author
MariadeAnton
committed
Update references to --create-check
Clarify what we produce after using it Ensure Traces configuration is explained by default and with overrides with TestCommand Address Stefan's feedback
1 parent 5d23bb9 commit f573deb

3 files changed

Lines changed: 55 additions & 16 deletions

File tree

site/content/docs/cli/command-line-reference.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,18 @@ Exclude tests by pattern:
9393
npx checkly pw-test -- --grep-invert="skip|todo"
9494
```
9595

96-
### Creating monitors
96+
### Creating scheduled checks
97+
98+
Using `pw-test` with the `--create-check` flag will add the check with a default configuration, so that you can tweak the monitoring configuration for your check. If there's no `checkly.config.ts` file it will create it.
99+
100+
Regression tagged tests in multiple locations:
97101

98-
Regression tests in multiple locations:
99102
```bash
100103
npx checkly pw-test --create-check --location=us-east-1 --location=eu-west-1 --frequency=5m -- --grep="@regression"
101104
```
102105

103-
Mobile tests every 10 minutes:
106+
Mobile tests tagged critical every 10 minutes:
107+
104108
```bash
105109
npx checkly pw-test --create-check --frequency=10m -- --project="Mobile Chrome" --grep="@critical"
106110
```
@@ -117,7 +121,7 @@ npx checkly pw-test --create-check --frequency=10m -- --project="Mobile Chrome"
117121
- `--test-session-name`: Name your test session
118122
- `--env`: Pass environment variables
119123
- `--env-file`: Load variables from file
120-
- All other `checkly test` flags except `--record`
124+
- All other [`checkly test` flags](https://www.checklyhq.com/docs/cli/command-line-reference/#npx-checkly-test) except `--record`
121125

122126
### Playwright flags (after `--`)
123127
- `--project`: Select Playwright projects

site/content/docs/playwright-checks/_index.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,13 @@ What you need:
4848

4949

5050

51-
### 3. Use `pw-test` for quick testing
51+
### 3. Use `pw-test` to test in Checkly
5252

53-
Let's start with confirming your tests will work on Checkly, run the ones you want using `pw-test`.
53+
Run your Playwright test suite using `pw-test`.
5454

55-
`pw-test` accepts both Checkly and Playwright command line arguments using the following syntax:
56-
`npx checkly pwtest --checky-flag -- --playwright-flag`. Use `--` to seperate Checkly and Playwright flags.
55+
`pw-test` accepts both Checkly and Playwright command line arguments using the following syntax:
56+
57+
`npx checkly pwtest --checky-flag -- --playwright-flag`. Use `--` to seperate Checkly and Playwright flags.
5758

5859
The CLI command will then return a link leading to results, traces and more details:
5960

@@ -77,7 +78,7 @@ Detailed session summary at: https://chkly.link/l/linkhere
7778

7879
### 4. Convert tests to checks with `pw-test`:
7980

80-
Using `pw-test` with the `--create-check` flag will create a `checkly.config.ts` file if it doesn't exist, and add the new check, so that you can tweak the monitoring configuration for your check.
81+
Using `pw-test` with the `--create-check` flag will create a `checkly.config.ts` file will add the new check and create the Checkly configuration file if it doesn't exist. Afterwards, you can tweak the monitoring configuration for your check.
8182

8283
For example:
8384

@@ -90,7 +91,7 @@ For example:
9091
Creating Checkly check from Playwright test... ✅
9192
```
9293

93-
Review the resulting check configuration in your `checkly.config.ts` file and make sure to tweak locations and schedule as needed.
94+
Review the resulting check configuration in your `checkly.config.ts` file and make sure to tweak locations and schedule as needed.
9495

9596
```typescript {title="checkly.config.ts"}
9697
import { defineConfig } from 'checkly'

site/content/guides/using-pw-test-command.md

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ By default, `pw-test` uses N.Virginia (`us-east-1`) to run. Use any [global loca
4949

5050
### Create monitors
5151

52-
Add `--create-check` to convert suites of tests into scheduled Playwright check suites:
52+
Using `pw-test` with the `--create-check` flag will create a `checkly.config.ts` file if it doesn't exist, and add the new check, so that you can tweak the monitoring configuration for your check.
53+
54+
Each `--create-check` call will append the check configuration to your configuration file. If you run it twice with the same configuration, it'll create the same check twice.
55+
5356

5457
```bash
5558
# Run all tests in the "chromium" project every 10 minutes
@@ -64,7 +67,7 @@ npx checkly pw-test --create-check --frequency=15m -- --project="Mobile Chrome"
6467

6568
## Advanced examples
6669

67-
### Browser and device selection
70+
### Projects running browsers and emulating devices
6871

6972
```bash
7073
# Desktop browsers
@@ -91,7 +94,7 @@ npx checkly pw-test --create-check --frequency=10m -- --grep="@critical"
9194

9295
### Artifacts
9396

94-
Configure in your `playwright.config.ts`:
97+
Configure which artifacts are stored in your `playwright.config.ts`:
9598

9699
```javascript
97100
use: {
@@ -101,7 +104,38 @@ use: {
101104
}
102105
```
103106

104-
View all artifacts in Checkly's UI after test runs.
107+
If you'd like different configuration for your checks, make sure to use the `--trace <mode> ` flag in the `testCommand` section of your Playwright Check Suite.
108+
109+
```typescript {title="checkly.config.ts"}
110+
import { defineConfig } from 'checkly'
111+
112+
const config = defineConfig({
113+
logicalId: 'my-repo-name',
114+
projectName: 'my-repo-name',
115+
checks: {
116+
playwrightConfigPath: './playwright.config.ts',
117+
playwrightChecks: [
118+
{
119+
logicalId: 'myrepo', // tweak ID
120+
name: 'myrepo: Chromium Playwright Tests', // tweak name
121+
testCommand: 'npx playwright test --project=chromium --trace=on',//
122+
locations: [
123+
'eu-central-1', 'us-east-1' // add or change locations
124+
],
125+
frequency: 10, // a custom per-check frequency
126+
},
127+
],
128+
},
129+
cli: {
130+
runLocation: 'us-east-1', // where test and pw-test will run
131+
},
132+
})
133+
134+
export default config
135+
136+
```
137+
138+
View all artifacts in Checkly's UI after test runs in [Test Sessions](https://app.checklyhq.com/test-sessions).
105139

106140
### Environment variables
107141

@@ -113,9 +147,8 @@ npx checkly pw-test --env ENVIRONMENT_URL="https://staging.acme.com" -- --grep="
113147
npx checkly pw-test --env-file=".env.staging" -- --project=chromium
114148
```
115149

116-
## Common patterns
150+
## Common patterns creating checks
117151

118-
### E-commerce monitoring
119152
```bash
120153
# Checkout flow
121154
npx checkly pw-test --create-check --frequency=15m --location=us-east-1 -- --project="Desktop Chrome" --grep="checkout"
@@ -149,6 +182,7 @@ npx checkly pw-test --test-session-name="Pre-deployment check" -- --project=chro
149182

150183
**Missing artifacts**
151184
- Confirm they're set as `on` in `playwright.config.ts`
185+
- Alternatively, edit your `testCommand` to set the flag `trace=on`
152186

153187
**"Project not found" errors**
154188
- Match exact names from `playwright.config.ts`

0 commit comments

Comments
 (0)