# Testing agent

> Let the AI write browser tests for your app and run them after every change.


The testing agent checks that your app still works the way visitors use it. The AI writes the tests, and a real browser (headless Chromium) clicks through them on your live app. Available on Pro and Pro+.

## Write tests

Open **Dashboard → Tests** and click **Write tests**. Leave the box empty to cover the main flows, or describe what to check, for example “a visitor can submit an idea and see it in the list”.

Each test is a list of plain steps you can read:

1. Open /
2. Type “Ada” into “Your name”
3. Click “Submit”
4. See “Thanks for your feedback”

## Run them

Click **Run all tests**, or **Run** on a single test. Each test runs in a fresh browser with no saved login. You get, per test:

- passed or failed, and how long it took
- the step that failed and why, e.g. *Couldn't find anything to click called “Submit”*
- a screenshot of the page at that moment
- errors from the browser console

**Fix with AI** sends the failure, the steps and the console errors to the chat.

Turn on **Run tests automatically after every change** to test each new version as soon as it's built. The result shows up in the chat.

## Your data stays clean

Tests run against your real app and its real backend, so the testing agent cleans up after itself:

- Records and accounts created during a run are deleted when it ends.
- Automations don't fire, and emails aren't really sent.
- Test visits don't count in analytics.

Backend functions keep this working when they create the server client with the request: `createServiceClient(req)`. Draftship writes them that way.

AI features in your app (like InvokeLLM) still run during tests and count toward your limits.

## Tips

- Tests find buttons and inputs by their visible text or label. Apps with clear labels test better, and are easier for everyone to use.
- Test branches before merging: open the branch and run its tests there.
