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
+17-13Lines changed: 17 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Use your existing Playwright tests as live, scheduled monitoring checks. No rewr
16
16
17
17
## What's a Playwright Check Suite?
18
18
19
-
A Playwright Check Suite lets you define a monitoring strategy using your existing Playwright tests and configured projects.
19
+
A Playwright Check Suite lets you use your existing Playwright tests and projects for end-to-end monitoring with tailored monitoring strategies.
20
20
21
21
You can mix and match existing
22
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.
@@ -54,7 +54,7 @@ Create a `checkly.config.ts/js` and pick the tests you want to monitor, use [tes
54
54
55
55
Make sure:
56
56
57
-
*`pwProjects` match projects names in your playwright.config.ts.
57
+
*`pwProjects` match projects names in your `playwright.config.ts`.
58
58
*`pwTags` match tags in your test definitions.
59
59
60
60
Below are two example check suites:
@@ -75,26 +75,30 @@ export default defineConfig({
75
75
playwrightConfigPath: './playwright.config.ts',
76
76
playwrightChecks: [
77
77
{
78
-
/*
79
-
Create a multi-browser check that runs
80
-
every 10 mins in two locations.
81
-
*/
78
+
/**
79
+
* Create a multi-browser check that runs
80
+
* every 10 mins in two locations.
81
+
*/
82
82
logicalId: 'multi-browser',
83
83
name: 'Multi Browser Suite',
84
-
pwProjects: ['chromium', 'firefox', 'webkit'], // Use project (or projects) in your Playwright config
85
-
pwTags: '@smoke-tests', // Use a tag (or tags) in your tests
84
+
// Use one project (or multiple projects) defined in your Playwright config
85
+
pwProjects: ['chromium', 'firefox', 'webkit'],
86
+
// Use one tag (or multiple tags) defined in your spec files
87
+
pwTags: '@smoke-tests',
86
88
frequency: Frequency.EVERY_10M,
87
89
locations: ['us-east-1', 'eu-west-1'],
88
90
},
89
91
{
90
-
/*
91
-
Create a check that runs the `@critical` tagged tests
92
-
every 5 mins in three locations.
93
-
*/
92
+
/**
93
+
* Create a check that runs the `@critical` tagged tests
94
+
* every 5 mins in three locations.
95
+
*/
94
96
logicalId: 'critical-tagged',
95
97
name: 'Critical Tagged tests',
96
-
pwTags: '@critical', //Reference an existing tag in your tests
98
+
//Use one project (or multiple projects) defined in your Playwright config
97
99
pwProjects: ['chromium'],
100
+
// Use one tag (or multiple tags) defined in your spec files
To define your Playwright Check Suite, you use the `checkly.config.ts/js` file.
14
+
Use the `checkly.config.ts/js` file to define your Playwright Check Suite.
15
15
16
-
Each Playwright Check Suite is connected to an existing reference in your `playwright.config.ts/js` file.
17
-
During the Alpha, a Playwright Check Suite can last up to 20 minutes. This limit is open to be increased/decreased after the alpha.
16
+
Each Playwright Check Suite can be connected to references in your `playwright.config.ts/js` file.
17
+
18
+
During the Alpha, **a Playwright Check Suite can run up to 20 minutes**. This limit can be increased/decreased after the alpha.
18
19
19
20
## Playwright Check Suite definition
20
21
22
+
To add Playwright Check Suites to your Checkly monitoring setup, specify the path to your `playwright.config.ts/js` and add a new `playwrightChecks` property to the existing `checks` configuration in your `checkly.config.ts/js`.
A Playwright Check Suite requires the following properties:
47
+
21
48
*`name` - a human friendly name for your check suite.
22
49
*`logicalId` - a reference for your check suite.
23
50
51
+
Other available properties like `frequency`, `alertChannels` or `locations` are inherited from the general Checkly configuration if not specified otherwise.
52
+
24
53
## Playwright references
25
54
26
-
The following Playwright references are available to create a Playwright Monitor:
55
+
The Checkly infrastructure will run and deploy all your existing Playwright tests (similar to what `npx playwright test` runs) as monitors if you don't reference Playwright projects or tags.
56
+
57
+
Specify which tests should become part of global end-to-end monitoring by defining these properties:
27
58
28
-
*`pwProjects` --- select existing project names from your playwright configuration to create a playwright check.
59
+
*`pwProjects` --- select existing project names from your Playwright configuration to create a Playwright Check Suite.
29
60
30
-
*`pwTags` --- select witch tags will be grouped into a playwright check.
61
+
*`pwTags` --- select test tags that will be grouped into a Playwright Check Suite.
31
62
32
-
You can combine `pwTags` and `pwProjects` to generate your check. For example:
63
+
You can combine `pwTags` and `pwProjects` to generate your check suite, too.
64
+
65
+
For example:
33
66
34
67
```typescript {title="checkly.config.ts"}
35
-
checks: {
36
-
playwrightConfigPath: './playwright.config.ts',
37
-
playwrightChecks: [
38
-
{
39
-
// Run critical tagged tests in Chromium every minute from 4 locations
> We recommend using `pwTags` and `pwProjects` to group your Playwright tests into different monitoring levels with different monitoring settings. For example, critical application functionality may be monitored best with short monitoring frequencies to lower the mean time to detect (MTTD).
51
90
52
-
These are the available monitoring configuration options:
91
+
## Monitoring customizations
53
92
54
-
*`installCommand:` Override the command to install dependencies, by default it'll use `npm install --dev`.
93
+
A Playwright Check Suite inherits multiple properties from [the abstract `Check` class](/docs/cli/constructs-reference/#check):
55
94
56
-
*`testCommand:` Override the command to test, by default it uses npx playwright test with the tags, projects, and config file options your check specifies.
95
+
-`name`
96
+
-`activated`
97
+
-`muted`
98
+
-`locations`
99
+
-`tags`
100
+
-`frequency`
101
+
-`alertChannels`
102
+
-`privateLocations`
103
+
-`retryStrategy`
104
+
-`alertEscalationPolicy`
57
105
58
-
*`activated:` A boolean value to activate/run your check or not.
106
+
Check [the reference documentation](/docs/cli/constructs-reference/#check) for more information on these settings.
59
107
60
-
*`muted:` A boolean value to mute Alert notifications.
108
+
Additionally, Playwright Check Suites provide specific configuration for your Playwright monitoring.
61
109
62
-
*`frequency:` How often the check will run. It supports:
*`installCommand:` Override the command to install dependencies, by default it'll use `npm install --dev`.
65
111
66
-
*`locations:`An array of locations where to run your Checks.
112
+
*`testCommand:`Override the command to test, by default it uses npx playwright test with the tags, projects, and config file options your check specifies.
67
113
68
114
*`groupName:` The group this check belongs to.
69
115
70
116
```typescript {title="checkly.config.ts"}
71
-
72
117
checks: {
73
118
playwrightConfigPath: './playwright.config.ts', // specify your config file
74
119
playwrightChecks: [
75
120
{
76
-
// Run E2E tagged tests across browsers in 4 locations
121
+
/**
122
+
* Run `@e2e` tagged tests across browsers
123
+
* every 5 minute from 4 locations.
124
+
*/
125
+
// Human readable name
77
126
name: 'E2E test suite',
127
+
// Reference id
78
128
logicalId: 'e2e-test-suite',
79
-
pwProjects: ['chromium', 'firefox', 'webkit'], // Reference the project or projects in playwright.config file
80
-
pwTags: 'e2e', // Reference an existing tag in your tests
0 commit comments