> ## Documentation Index
> Fetch the complete documentation index at: https://checkly-422f444a-immanuel-fix-api-spec.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating a Playwright Check Suite

> Turn your Playwright tests into production monitors by creating a checkly.config.ts file

export const YoutubeEmbed = ({id, allowFullScreen = true, end, loading = "eager", start, title = "YouTube video"}) => {
  if (!id) {
    console.error("YouTube component requires an id prop");
  }
  const params = new URLSearchParams();
  if (start) params.append("start", start.toString());
  if (end) params.append("end", end.toString());
  const src = `https://www.youtube.com/embed/${id}?${params.toString()}`;
  return <iframe src={src} title={title} loading={loading} className="w-full aspect-video rounded-xl" allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowFullScreen={allowFullScreen} />;
};

Turn your Playwright tests into production monitors. This guide walks through creating a `checkly.config.ts`, testing it, and deploying your first check suites.

<Tip>
  Explore all [Playwright Check Suite capabilities](/detect/synthetic-monitoring/playwright-checks/overview).
</Tip>

<Accordion title="Prerequisites">
  * A Checkly account
  * A repository with Playwright tests and a `playwright.config.ts` file
  * Playwright version 1.40 or higher
  * Node.js installed locally
</Accordion>

<YoutubeEmbed id="eP9rSxVWt9Y" />

## Step 1: Install the Checkly CLI

```bash terminal theme={null}
npm install --save-dev checkly
```

If you use TypeScript, also install `jiti` to bundle config and test files correctly:

```bash terminal theme={null}
npm install --save-dev jiti
```

## Step 2: Create Your checkly.config.ts

Create a `checkly.config.ts` file in your project root. This file defines which tests become monitors and how they run.

**Basic structure:**

```typescript checkly.config.ts theme={null}
import { defineConfig } from 'checkly'
import { Frequency } from 'checkly/constructs'

export default defineConfig({
  projectName: 'My App Monitoring',
  logicalId: 'my-app-monitoring',

  checks: {
    // Point to your Playwright config
    playwrightConfigPath: './playwright.config.ts',

    // Define which tests to monitor
    playwrightChecks: [
      // Add check suites here
    ],

    // Default settings for all checks
    frequency: Frequency.EVERY_10M,
    locations: ['us-east-1', 'eu-west-1'],
  },

  cli: {
    runLocation: 'us-east-1',
  },
})
```

## Step 3: Select Tests to Monitor

Each entry in the `playwrightChecks` array becomes a separate monitor. Use `pwProjects` or `pwTags` to control which tests each check suite runs.

This example creates two check suites — one for critical flows running every 5 minutes, and one for secondary features at a lower frequency:

```typescript checkly.config.ts theme={null}
export default defineConfig({
  // ... config from above

  checks: {
    playwrightConfigPath: './playwright.config.ts',
    playwrightChecks: [
      {
        name: 'Critical User Flows',
        logicalId: 'critical-flows',
        pwProjects: ['critical'],
        frequency: Frequency.EVERY_5M,
        locations: ['us-east-1', 'eu-west-1', 'ap-south-1'],
      },

      {
        name: 'Important Features',
        logicalId: 'important-features',
        pwProjects: ['important'],
        frequency: Frequency.EVERY_30M,
        locations: ['us-east-1', 'eu-west-1'],
      },
    ],
  },
})
```

Per-check `frequency` and `locations` override the global defaults set in Step 2. For strategies on grouping tests by urgency, environment, or feature area, see [Test organization](/detect/synthetic-monitoring/playwright-checks/test-organization).

## Step 4: Test Your Configuration

Before deploying, validate your monitoring setup locally:

```bash terminal theme={null}
npx checkly test --record
```

The `--record` flag uploads results to Checkly so you can review traces, logs, and screenshots in the UI.

This runs your check suites in Checkly's infrastructure and shows results:

```bash theme={null}
Parsing your project... ✅
Validating project resources... ✅
Bundling project resources... ✅

Running 2 checks in us-east-1.

playwright.config.ts
  ✔ Critical User Flows (12s)
  ✔ Important Features (8s)

2 passed, 2 total
```

**Test specifying the environment type:**

```bash terminal theme={null}
npx checkly test --record --env ENVIRONMENT=staging
```

<Info>
  **Difference between `checkly test` and `checkly pw-test`:**

  * `checkly test` - Runs check suites defined in `checkly.config.ts` and `check.ts` files
  * `checkly pw-test` - Runs any Playwright tests defined in your `playwright.config.ts`,  directly on Checkly's cloud infrastructure. See the [CLI reference](/cli/checkly-pw-test).
</Info>

## Step 5: Deploy to Production Monitoring

Deploy your check suites to start continuous monitoring:

```bash terminal theme={null}
npx checkly deploy
```

Confirm deployment:

```bash theme={null}
> You are about to deploy your project "my-app-monitoring" to account "My Account".
  Do you want to continue? … yes

Successfully deployed project "my-app-monitoring" to account "My Account".
```

Your monitors run on the configured schedule. View results in your [Checkly dashboard](https://app.checklyhq.com/).

## Best Practices

* **Start small** — Begin with 1-2 critical flows. Add more as you understand your monitoring needs.
* **Keep suites fast** — Shorter suites mean faster alerts. See [How long should a check suite run?](/detect/synthetic-monitoring/playwright-checks/test-organization#how-long-should-an-ideal-playwright-check-suite-run) for guidance.
* **Reuse authentication state** — Use [Playwright project dependencies and `storageState`](/detect/synthetic-monitoring/playwright-checks/test-organization#group-tests-to-reuse-authentication-states) to log in once and share the session across tests.

## Next Steps

<CardGroup cols={2}>
  <Card title="Test Organization" href="/detect/synthetic-monitoring/playwright-checks/test-organization">
    Advanced strategies for organizing test suites
  </Card>

  <Card title="Configure Alerts" href="/communicate/alerts/overview">
    Set up notifications when checks fail
  </Card>

  <Card title="Add to Groups" href="/detect/synthetic-monitoring/playwright-checks/add-to-group">
    Organize checks with groups
  </Card>

  <Card title="checkly pw-test" href="/cli/checkly-pw-test">
    Run Playwright tests on Checkly's cloud infrastructure
  </Card>
</CardGroup>
