﻿---
title: Write Scout UI tests
description: Scout UI tests are Playwright tests that use Scout fixtures and page objects for readable, maintainable flows. Authenticate with browserAuth in beforeEach,...
url: https://www.elastic.co/elastic/docs-builder/docs/2773/extend/kibana/scout/write-ui-tests
products:
  - Kibana
---

# Write Scout UI tests
Scout UI tests are Playwright tests that use Scout fixtures and page objects for readable, maintainable flows.
<important>
  [Set up your plugin or package](https://www.elastic.co/elastic/docs-builder/docs/2773/extend/kibana/scout/setup-plugin) first.
</important>


## A good starting pattern

- Authenticate with `browserAuth` in `beforeEach`
- Navigate and interact via `pageObjects`
- Use `test.step` for multi-step flows you want to read in reports

Example test ([APM](https://github.com/elastic/kibana/blob/main/x-pack/solutions/observability/plugins/apm/test/scout/ui/parallel_tests/settings/anomaly_detection.spec.ts)).

## Save the test file

- Sequential UI tests: `<plugin-root>/test/scout/ui/tests`
- Parallel UI tests: `<plugin-root>/test/scout/ui/parallel_tests`

Spec files must end with `.spec.ts`.

## Next steps

- [Browser authentication](https://www.elastic.co/elastic/docs-builder/docs/2773/extend/kibana/scout/browser-auth)
- [Best practices](https://www.elastic.co/elastic/docs-builder/docs/2773/extend/kibana/scout/best-practices)
- [Page objects](https://www.elastic.co/elastic/docs-builder/docs/2773/extend/kibana/scout/page-objects)
- [Fixtures](https://www.elastic.co/elastic/docs-builder/docs/2773/extend/kibana/scout/fixtures)
- [Run tests](https://www.elastic.co/elastic/docs-builder/docs/2773/extend/kibana/scout/run-tests) and [Debugging](https://www.elastic.co/elastic/docs-builder/docs/2773/extend/kibana/scout/debugging)