Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ Use the [Checkly CLI](/cli/) to turn your Playwright tests into globally distrib

Checkly installs dependencies from your `package.json` and lock files. It works with [npm](https://www.npmjs.com/), [yarn](https://yarnpkg.com/), and [pnpm](https://pnpm.io/).

By default, Checkly installs all dependencies (both `dependencies` and `devDependencies`). You can change this setting to install only `devDependencies` in your [account settings](https://app.checklyhq.com/accounts/settings/account/playwright).

By default, Checkly installs all dependencies (both `dependencies` and `devDependencies`).

```json package.json
{
Expand All @@ -31,31 +30,38 @@ By default, Checkly installs all dependencies (both `dependencies` and `devDepen

Checkly detects your package manager from your lock file:

| Available lock file | Package manager |
| Lock file | Package manager |
|---------------------|-----------------|
| `package-lock.json` | npm |
| `pnpm-lock.json` | pnpm |
| `yarn.lock` | yarn |
| `pnpm-lock.yaml` | pnpm |
| `yarn.lock` | yarn |

To override the [playwright account setting](https://app.checklyhq.com/accounts/settings/account/playwright) for a specific check suite, use the `installCommand` property in your `checkly.config.ts`:
### Workspace support

```typescript checkly.config.ts
import { defineConfig } from 'checkly'
Starting from [Checkly CLI 7.1.](https://github.com/checkly/checkly-cli/releases/tag/7.1.0), Checkly supports `npm` and `pnpm` workspaces in Playwright Check Suites, while Yarn workspaces remain unsupported.

If your Playwright tests are stored in a monorepo, Checkly automatically recognizes and manages dependencies based on your workspace configuration.
When using workspaces, packages in your workspace can depend on other packages in the same workspace, including those from the root package. Check out [pnpm workspaces docs](https://pnpm.io/workspaces)(https://pnpm.io/workspaces) or [npm workspaces docs](https://docs.npmjs.com/cli/v8/using-npm/workspaces) to get an overview on workspaces.

**Requirements:**
- Place your lock file (`package-lock.json` or `pnpm-lock.yaml`) at the workspace root
- Include both root and workspace `package.json` files in your project

**Example workspace structure:**

export default defineConfig({
checks: {
playwrightChecks: [
{
name: 'My Check Suite',
logicalId: 'my-check-suite',
installCommand: 'npm install --dev',
}
]
}
})
```
my-monorepo/
├── package.json # Root workspace config
├── package-lock.json # or pnpm-lock.yaml
├── packages/
│ └── e2e-tests/
│ ├── package.json # Can depend on other workspace packages
│ └── playwright.config.ts
```

Learn more about [customizing install commands](/detect/synthetic-monitoring/playwright-checks/configuration#customize-install-and-test-commands).
Checkly supports the `exports` and `imports` features in `package.json`.

No additional configuration is needed in `checkly.config.ts` for workspace support.

## Using private dependencies

Expand Down Expand Up @@ -136,20 +142,61 @@ export default defineConfig({
})
```

#### Using lifecycle scripts

Some npm packages define lifecycle scripts (such as `prepare`, `postinstall`, or `preinstall`) that run during installation and may require access to files not automatically included in the CLI's code bundle.


If you're confident your dependencies work without lifecycle scripts, you can use the [`installCommand`](/detect/synthetic-monitoring/playwright-checks/configuration#customize-install-and-test-commands) property to pass the `--ignore-scripts` flag to your package manager:

```typescript checkly.config.ts
import { defineConfig } from 'checkly'

export default defineConfig({
checks: {
playwrightChecks: [
{
name: 'My Check Suite',
logicalId: 'my-check-suite',
installCommand: 'npm install --ignore-scripts',
}
]
}
})
```

If a dependency does require its install hooks to function correctly, use the [`include`](/constructs/playwright-check#param-include) option to add any required files to the code bundle:

```typescript checkly.config.ts
import { defineConfig } from 'checkly'

export default defineConfig({
checks: {
include: ['scripts/**/*', 'config/**/*'],
playwrightChecks: [
// ...
]
}
})
```


Learn more about [customizing install commands](/detect/synthetic-monitoring/playwright-checks/configuration#customize-install-and-test-commands).

## Dependency Caching

Checkly caches installed packages between check runs to speed up execution and reduce installation time. Dependencies are installed once and reused for subsequent runs until your lock files (`package-lock.json`, `pnpm-lock.yaml`, or `yarn.lock`) change.
Checkly caches installed packages between check runs to speed up execution and reduce installation time. Dependencies are installed once and reused for subsequent runs until your lock files (`package-lock.json`, `pnpm-lock.yaml`, or `yarn.lock`), your `installCommand` or your working directory change.

### How caching works

When dependency caching is enabled:

1. On the first run, Checkly installs all packages from your lock file and stores them in cache
2. On subsequent runs, Checkly checks if your lock file has changed
2. On subsequent runs, Checkly checks if your lock file, `installCommand` or working directory have changed
3. If unchanged, Checkly uses the cached packages, skipping the installation step
4. If changed, Checkly installs packages again and updates the cache

This significantly reduces check execution time, especially for projects with many or large dependencies.
Caching significantly reduces check execution time, especially for projects with many or large dependencies.

### Cache behavior by location type

Expand Down