You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/content/docs/playwright-checks/_index.md
+91-67Lines changed: 91 additions & 67 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,8 +18,8 @@ Use your existing Playwright tests as live, scheduled monitoring checks. No rewr
18
18
19
19
A Playwright Check Suite lets you define a monitoring strategy using your existing Playwright tests and configured projects.
20
20
21
-
You can mix and match existing
22
-
[Projects](https://playwright.dev/docs/test-projects) (`pwProjects`) and [test tags](https://playwright.dev/docs/test-annotations#tag-tests) (`pwTags`) to group test subsets into a Playwright Check Suite, like smoke tests or critical path flows into lightweight reliable flows.
21
+
You can mix and match existing
22
+
[projects](https://playwright.dev/docs/test-projects) (`pwProjects`) and [test tags](https://playwright.dev/docs/test-annotations#tag-tests) (`pwTags`) to select tests and group subsets into Playwright Check Suites. This approach allows you to specify different monitoring settings for each Playwright Check Suite to differenciate between smoke tests or critical path flows.
23
23
24
24
## QuickStart Guide
25
25
@@ -29,9 +29,8 @@ Here's how to get from zero to deployed checks in 5 minutes.
29
29
What you need:
30
30
31
31
* A checkly account
32
-
* A repository using Playwright for E2E tests
33
-
* one with a playwright configuration file.
34
-
32
+
* A repository using Playwright for E2E tests and a Playwright configuration file.
33
+
35
34
## Steps
36
35
37
36
### 1. Install the Checkly CLI
@@ -49,92 +48,117 @@ What you need:
49
48
npm install --save-dev jiti typescript
50
49
```
51
50
52
-
### 3. Define which tests to monitor in `checkly.config.ts`
51
+
### 3. Define which tests to monitor in `checkly.config.ts/js`
53
52
54
-
Create a `checkly.config.ts/js` and pick the tests you want to monitor, use [test tags](https://playwright.dev/docs/test-annotations#tag-tests) and [Projects](https://playwright.dev/docs/test-projects) to create a Playwright Check Suite.
53
+
Create a `checkly.config.ts/js` and pick the tests you want to monitor, use [test tags](https://playwright.dev/docs/test-annotations#tag-tests) and [projects](https://playwright.dev/docs/test-projects) to create a Playwright Check Suite.
55
54
56
55
Make sure:
57
56
58
57
*`pwProjects` match projects names in your playwright.config.ts.
59
58
*`pwTags` match tags in your test definitions.
60
59
61
-
Below are two example checks: one runs a full multi-browser suite with smoke tests, and one monitors only `@critical` tagged tests in `Chromium`.
62
-
63
-
64
-
```typescript {title="checkly.config.ts/js"}
65
-
// checkly.config.ts
66
-
import { defineConfig } from'checkly'
67
-
import { Frequency } from'checkly/constructs'
68
-
69
-
exportdefaultdefineConfig({
70
-
projectName: 'Cool Website Checks',
71
-
logicalId: 'cool-website-monitoring',
72
-
repoUrl: 'https://github.com/acme/website',
73
-
checks: {
74
-
playwrightConfigPath: './playwright.config.ts', //specify a custom playwright config file here
75
-
playwrightChecks: [
76
-
{
77
-
/* Create a multi-browser check that runs
78
-
every 5 mins.*/
79
-
logicalId: 'multi-browser',
80
-
name: 'Multi Browser Suite',
81
-
pwProjects: ['chromium', 'firefox', 'webkit'], // Use project (or projects) in your playwright config
82
-
pwTags: '@smoke-tests', // Use a tag (or tags) in your tests
83
-
frequency: Frequency.EVERY_10M, // set your ideal frequency
84
-
locations: ['us-east-1', 'eu-west-1'], // worldwide locations to run your check from
85
-
},
86
-
{
87
-
/* Create a check that runs the critical tagged tests every 10 mins */
88
-
logicalId: 'critical-tagged',
89
-
name: 'Critical Tagged tests',
90
-
pwTags: '@critical', // Reference an existing tag in your tests
91
-
pwProjects: ['chromium'],
92
-
frequency: Frequency.EVERY_5M, // set your ideal frequency
Access [the Playwright Check Suites reference documentation](/docs/playwright-checks/reference/) for more configuration options.
104
111
105
112
### 4. Validate your monitors
106
113
107
-
Now, you can validate the playwright check suites above, that reference existing playwright tags or projects in your repository.
114
+
Validate the Playwright check suites that reference existing Playwright tags or projects in your repository by running `npx checkly test` from your terminal. Your Playwright check suites will then be executed in the Checkly infrastructure running in the location specified in your Checkly config (`cli.runLocation`).
108
115
109
-
`npx checkly test --record` runs a test session to validate the defined checks on your `cli: runlocation:` using the settings in your checkly config file.
If you you want to persist the test results and access them in the Checkly web app, use the `--record` CLI option and run `npx checkly test --record` to transform your test runs into [a Checkly test session](/docs/testing/#test-sessions).
The CLI command will then return a link leading to results, traces and more details.
123
144
124
145
## 5. Deploy your Playwright Check Suites
125
146
147
+
If your Playwright monitoring passes and you are ready to start monitoring your applications with your Playwright tests, transform your Playwright Check Suite into global monitoring with `npx checkly deploy`.
126
148
127
149
```bash {title="Terminal"}
128
150
npx checkly deploy
129
151
130
-
> You are about to deploy your project "playwright-check-suites" to account "Checkly E2E Prod". Do you want to continue? … yes
152
+
> You are about to deploy your project "playwright-check-suites" to account "Checkly E2E Prod". Do you want to continue? … yes
153
+
154
+
Successfully deployed project "playwright-check-suite" to account "Checkly E2E Prod".
131
155
```
132
156
133
157
Once deployed, your checks will run on a schedule and results will appear in your [home dashboard](https://app.checklyhq.com/).
134
158
135
159
## 6. Set up Alerts
136
160
137
-
Checkly lets you configure alert channels and alert groups to get notified when checks fail. You can receive alerts via email, Slack, webhooks, and more.
161
+
Configure alert channels and alert groups to get notified when checks fail. You can receive alerts via email, Slack, webhooks, and more.
138
162
139
163
To set up alerts:
140
164
1. Go to the Checkly dashboard.
@@ -143,7 +167,7 @@ To set up alerts:
143
167
144
168
Learn more in the [alerting guide](https://www.checklyhq.com/docs/alerts/).
0 commit comments