﻿---
title: Set up Scout in your plugin or package
description: This page shows the minimum setup to add Scout tests to a plugin/package. For choosing the right import (@kbn/scout vs solution packages), see Scout packages...
url: https://www.elastic.co/elastic/docs-builder/docs/2771/extend/kibana/scout/setup-plugin
products:
  - Kibana
---

# Set up Scout in your plugin or package
This page shows the **minimum setup** to add Scout tests to a plugin/package. For choosing the right import (`@kbn/scout` vs solution packages), see [Scout packages](/elastic/docs-builder/docs/2771/extend/kibana/scout#scout-packages).

## Guided setup with the Scout CLI

Generate a working scaffold (folders, configs, and sample tests):
```bash
node scripts/scout.js generate
```

Then, [enable your plugin or package](#enable-scout-tests-in-ci) in the CI.

## Manual setup


### 1. Create the folder layout

Create `test/scout`:
```text
your-plugin/
└── test/
    └── scout/
        ├── ui/     
        ├── api/    
        └── common/ 
```


### 2. Add Playwright config(s)

Create `playwright.config.ts` under `test/scout/ui` and/or `test/scout/api`:
```ts
import { createPlaywrightConfig } from '@kbn/scout';

export default createPlaywrightConfig({
  testDir: './tests',
});
```

<important>
  Name the file exactly `playwright.config.ts` so Scout tooling can discover it.
</important>

Then create the `tests/` directory next to the config.

### 3. (Optional) Add a parallel UI config

If your UI suites can be isolated, add `parallel.playwright.config.ts` under `test/scout/ui` and point it at `parallel_tests/`:
```ts
import { createPlaywrightConfig } from '@kbn/scout';

export default createPlaywrightConfig({
  testDir: './parallel_tests',
  workers: 2,
});
```

<important>
  Name the file exactly `parallel.playwright.config.ts` so Scout tooling can discover it.
</important>

See [Parallelism](https://www.elastic.co/elastic/docs-builder/docs/2771/extend/kibana/scout/parallelism) and [Global setup hook](https://www.elastic.co/elastic/docs-builder/docs/2771/extend/kibana/scout/global-setup-hook) for recommended parallel patterns.

### 4. Enable tests in CI

Finally, [enable Scout test runs in the CI](#enable-scout-tests-in-ci) for your plugin or package.

## Enable Scout tests in CI

To enable Scout CI for your plugin/package, add it to `.buildkite/scout_ci_config.yml`:
```yaml
plugins:
  enabled:
    - <your_plugin_name>
  disabled:

packages:
  enabled:
    - <your_package_name>
  disabled:
```