diff --git a/site/content/docs/playwright-checks/_index.md b/site/content/docs/playwright-checks/_index.md index 4f0eea893..14a465ab2 100644 --- a/site/content/docs/playwright-checks/_index.md +++ b/site/content/docs/playwright-checks/_index.md @@ -61,7 +61,7 @@ The alpha version gets updated daily with new improvements. You can follow updat 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). ```bash {title="Terminal"} - npm i --save-dev ts-node typescript + npm i --save-dev jiti typescript ``` ### 3. Test and create a monitor with all your tests diff --git a/site/content/docs/playwright-checks/add-to-group.md b/site/content/docs/playwright-checks/add-to-group.md new file mode 100644 index 000000000..a1611654f --- /dev/null +++ b/site/content/docs/playwright-checks/add-to-group.md @@ -0,0 +1,79 @@ +--- +title: Adding Playwright Check Suites to groups +displayTitle: Adding a Playwright Check Suite to a group +navTitle: Add to a group +weight: 20 +slug: /groups-usage +menu: + resources: + parent: "Playwright Check Suites (Alpha)" + weight: 20 +--- + +{{< markdownpartial "/_shared/playwright-native-alpha.md" >}} + +You can define a new group, or associate a Playwright Check Suite to an existing group. + +## Steps + +### 1. Create a group for your checks + +To define a new group, create a group file, for example `website-group.check.ts`. + +```typescript {title="website-group.check.ts"} + +import { CheckGroup } from 'checkly/constructs' + +export const myGroup = new CheckGroup('production-group', { + name: 'Production group', + activated: true, + muted: false, + locations: ['us-east-1', 'eu-west-1'], + tags: ['mac', 'group'], + environmentVariables: [], + apiCheckDefaults: {}, + concurrency: 100, + runParallel: true, + retryStrategy: RetryStrategyBuilder.linearStrategy({ baseBackoffSeconds: 30, maxRetries: 2, sameRegion: false }), +}) +``` + +Learn more about [using groups](https://www.checklyhq.com/docs/cli/constructs-reference/#checkgroup) to unify checks in Checkly. + +## 2. Associate the group to the check + +When specifying your Playwright Check Suite, you can reference the new or existing group, using its name: + + ```typescript {title="checkly.config.ts"} + import { defineConfig } from 'checkly' + + const config = defineConfig({ + logicalId: 'checkly-website', + projectName: 'checkly-website', + checks: { + playwrightConfigPath: './playwright.config.ts', + playwrightChecks: [ + { + name: 'checkly-website', + frequency: 10, + locations: ['us-east-1',], + groupName: 'Production group', // use the name of the group you created + }, + ], + }, + cli: { + runLocation: 'us-east-1', + }, + }) + + export default config + ``` + +## 3. Deploy to apply the changes + +```bash {title="Terminal"} + npx checkly deploy --preview #confirm what will be deployed + npx checkly deploy # deploy +``` + +You can now see your Playwright Check Suite in your group.