Skip to content

Commit f057b7a

Browse files
authored
add group usage instructions (#1261)
* add group usage instructions * just regular weight 🙏 * correct parent, and weight in menu :fingers_crossed:
1 parent bb8976c commit f057b7a

File tree

2 files changed

+80
-1
lines changed

2 files changed

+80
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ The alpha version gets updated daily with new improvements. You can follow updat
6161
If you're using TypeScript, install the dev dependencies [`ts-node`](https://www.npmjs.com/package/ts-node) and [`typescript`](https://www.npmjs.com/package/typescript).
6262

6363
```bash {title="Terminal"}
64-
npm i --save-dev ts-node typescript
64+
npm i --save-dev jiti typescript
6565
```
6666

6767
### 3. Test and create a monitor with all your tests
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
title: Adding Playwright Check Suites to groups
3+
displayTitle: Adding a Playwright Check Suite to a group
4+
navTitle: Add to a group
5+
weight: 20
6+
slug: /groups-usage
7+
menu:
8+
resources:
9+
parent: "Playwright Check Suites (Alpha)"
10+
weight: 20
11+
---
12+
13+
{{< markdownpartial "/_shared/playwright-native-alpha.md" >}}
14+
15+
You can define a new group, or associate a Playwright Check Suite to an existing group.
16+
17+
## Steps
18+
19+
### 1. Create a group for your checks
20+
21+
To define a new group, create a group file, for example `website-group.check.ts`.
22+
23+
```typescript {title="website-group.check.ts"}
24+
25+
import { CheckGroup } from 'checkly/constructs'
26+
27+
export const myGroup = new CheckGroup('production-group', {
28+
name: 'Production group',
29+
activated: true,
30+
muted: false,
31+
locations: ['us-east-1', 'eu-west-1'],
32+
tags: ['mac', 'group'],
33+
environmentVariables: [],
34+
apiCheckDefaults: {},
35+
concurrency: 100,
36+
runParallel: true,
37+
retryStrategy: RetryStrategyBuilder.linearStrategy({ baseBackoffSeconds: 30, maxRetries: 2, sameRegion: false }),
38+
})
39+
```
40+
41+
Learn more about [using groups](https://www.checklyhq.com/docs/cli/constructs-reference/#checkgroup) to unify checks in Checkly.
42+
43+
## 2. Associate the group to the check
44+
45+
When specifying your Playwright Check Suite, you can reference the new or existing group, using its name:
46+
47+
```typescript {title="checkly.config.ts"}
48+
import { defineConfig } from 'checkly'
49+
50+
const config = defineConfig({
51+
logicalId: 'checkly-website',
52+
projectName: 'checkly-website',
53+
checks: {
54+
playwrightConfigPath: './playwright.config.ts',
55+
playwrightChecks: [
56+
{
57+
name: 'checkly-website',
58+
frequency: 10,
59+
locations: ['us-east-1',],
60+
groupName: 'Production group', // use the name of the group you created
61+
},
62+
],
63+
},
64+
cli: {
65+
runLocation: 'us-east-1',
66+
},
67+
})
68+
69+
export default config
70+
```
71+
72+
## 3. Deploy to apply the changes
73+
74+
```bash {title="Terminal"}
75+
npx checkly deploy --preview #confirm what will be deployed
76+
npx checkly deploy # deploy
77+
```
78+
79+
You can now see your Playwright Check Suite in your group.

0 commit comments

Comments
 (0)