> ## Documentation Index
> Fetch the complete documentation index at: https://docs.typewise.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Automated Tests

> Create test scenarios with checks to validate your AI Agent's behavior automatically

Automated Tests let you define repeatable test scenarios that validate your AI
Agent's behavior. Unlike the
[Playground](https://docs.typewise.app/documentation/testing-and-feedback/simulator.md), which is designed
for ad-hoc manual conversations, Tests run automatically and evaluate results
against checks you define.

Use Tests to catch regressions, check which Specialist handles a request, and
make sure your AI Agent handles key scenarios correctly, before and after
publishing changes.

![Tests tab with the Result and Suggested improvements columns, the status filter, Apply suggestions with Nova, and the pass and fail counts](https://mintcdn.com/typewise/whSiWDm2OTNjoQEX/images/documentation/testing-and-feedback/tests/simulator-tests.png?fit=max\&auto=format\&n=whSiWDm2OTNjoQEX\&q=85\&s=11333af264703706ba3718ee05d1048e)

## Test list

| Column | Description |
| :- | :- |
| **Name** | The label you gave the test. |
| **Specialist** | The Specialist the test expects, or **Any specialist**. |
| **Result** | How many conversations passed in the latest run, for example *2 of 3 passed*. |
| **Suggested improvements** | Style notes from the latest run. Hover to see all of them. See [Suggested improvements](#suggested-improvements). |
| **Last run** | When the test last ran. |

Filter the list by **All tests**, **Passed**, **With suggested improvements**,
or **Failed**. Each option shows how many tests it holds, for example **Failed
(2)**, and **Passed** includes tests with suggested improvements. The footer
counts the latest results: passed, failed, needs attention (the run or its
analysis errored), and running.

## Creating a test

**1. Open the Tests tab**

Navigate to the [Simulator](https://platform.typewise.app/simulator) and
select the **Tests** tab.

**2. Click Create test**

Click **Create test** to open the test form.

**3. Describe the scenario**

Enter a name and a scenario, pick a test customer, and choose the channels
and number of conversations per run.

**4. Configure checks**

Choose the Specialist you expect, set checks on lookups and actions,
describe what success looks like, and say whether a handoff is expected.

**5. Save**

Click **Create**, or **Create and run** to start the first run right away.

> [!TIP]
>
> You can also let [Nova](https://docs.typewise.app/documentation/nova/what-nova-can-do.md) write the test.
> Click **Turn into test** in a Playground conversation or on a ticket. Nova
> drafts a test from that conversation, shows it to you, and creates and runs it
> once you confirm.

## Test configuration

### Scenario

![Scenario section of a test with Name, Scenario, Attachments, a saved test customer, Channels, and Conversations per run](https://mintcdn.com/typewise/whSiWDm2OTNjoQEX/images/documentation/testing-and-feedback/tests/simulator-scenario.png?fit=max\&auto=format\&n=whSiWDm2OTNjoQEX\&q=85\&s=cca3f955defffb75203ff053f1cb683e)

| Field | Description |
| :- | :- |
| **Name** | A short label for the test, shown in the test list. |
| **Scenario** | What the customer wants and the facts they know. The simulated customer follows it. Keep each path in a separate test. |
| **Attachments** | Files sent with the customer's first message. See [Attachments](#attachments). |
| **Test customer** | Who the simulated customer is. See [Test customers](#test-customers). |
| **Channels** | Chat, Email, WhatsApp, or any mix. Conversations are spread across the selected channels in turn. |
| **Conversations per run** | 1, 3, or 5. More conversations check consistency. If you pick fewer conversations than channels, some channels are not tested. |

> [!TIP]
>
> Write the scenario as if you're briefing a role-player. Include the customer's
> problem, the details they know (order numbers, account info), and when they
> should consider the conversation complete.
>
> **Example:** *"A customer wants to change a delivery address. They know their
> order number and the new address, but provide them only when asked."*

### Test customers

A test customer gives the simulated customer a name, contact details, and
context variables. Pick one of:

* **Anonymous visitor**: no name, email, or variables. Lookups by customer won't
  find anyone.
* **A saved customer**: reusable in any test or Playground conversation. Click
  **Customize details** to change it for this test only.
* **New customer**: enter details for this test. Tick **Save to reuse in other
  tests and conversations** to keep it.

Each customer has **Name**, **Email**, **Phone**, **Personality and background**
(used by the simulated customer), and your
[context variables](https://docs.typewise.app/documentation/settings/context-variables.md). Manage saved
customers in the **Simulated customers** tab. They belong to the workspace, and
editing one changes it in every test that uses it. If you delete a saved
customer, the tests that use it run with an anonymous visitor instead.

Without an email, test emails come from a placeholder address. Without a phone
number, WhatsApp messages come from a test number.

> [!NOTE]
>
> If the AI Agent asks the customer to verify their email, the test completes
> the verification automatically with the test customer's email. An anonymous
> visitor has no email, so verification fails and the analysis notes that the
> test needs a customer with an email.

### Attachments

Files you add are sent with the customer's first message, on every conversation
in the run. The AI judge sees the files too, so an agent that ignores them or
asks again for information they show fails the test.

* Up to 15 MB per file.
* Supported types: images (PNG, JPG, GIF, WebP), PDF, text, Markdown,
  reStructuredText and Org, CSV and TSV, Excel, Word, RTF, OpenDocument text,
  PowerPoint, JSON, XML, HTML, EPUB, and ZIP.

Files of another type (such as video or HEIC) or over 15 MB aren't attached.
They're listed in an error under **Attachments** instead.

### Checks

![Checks section with the expected Specialist, an expanded lookup set to Should always be called with a Response, the success description, and Expect a handoff to a human](https://mintcdn.com/typewise/I1f8iY7DWGfLoSdg/images/documentation/testing-and-feedback/tests/simulator-assertions.png?fit=max\&auto=format\&n=I1f8iY7DWGfLoSdg\&q=85\&s=b23a177cddc53363626f5fb72e3ff11f)

| Check | Description |
| :- | :- |
| **Which specialist should be used?** | The Specialist you expect to handle the conversation. **General Intelligence** means no Specialist matched. Choose **Any specialist** to skip this check, for example to test general or channel instructions. This checks routing; it doesn't force it. |
| **Lookups & actions** | For each lookup and action, set a **Check** (*Optional*, *Should always be called*, or *Should never be called*) and an optional **Response**. See [Tool mocking](#tool-mocking). |
| **How would you define success for this test?** | An observable result or required behavior, judged by AI. Don't put tone or style here; those are reported as suggested improvements. |
| **Expect a handoff to a human** | On: the conversation must end in a full [handoff](https://docs.typewise.app/documentation/tickets/conversation-view/ticket-conversation.md#ai-handoff-requests) to your team. Off: a full handoff fails the test. Partial requests, such as asking your team to look something up or approve an action, don't count either way. |

**Lookups & actions** lists what's tagged in the selected Specialist, your
general instructions, and the instructions of the selected channels. It also
always includes **Close conversation** and **Verify email address**, so you can
check that the AI Agent closes the chat or asks for verification.

### Tool mocking

During test runs, actions are always mocked, so tests never change anything in
your systems. Integration lookups and knowledge sources can still read live data
unless you give them a **Response**:

| Tool type | Mocking behavior |
| :- | :- |
| **Actions** (including manual actions) | Always mocked. Without a **Response**, the action succeeds with a generic result. |
| **Manual lookups** | Always mocked. |
| **Knowledge sources** (website, text, files, web search, live URL) | Real source used, unless you provide a **Response**. |
| **Integration lookups** | Return the **Response** if you provide one. Without one, the real lookup may be used. |

Write the **Response** as a natural-language description of the output, for
example *"Order #12345, status: shipped, estimated delivery: March 5, 2025"*.
Explicit responses make tests more predictable.

![Expanded lookup with Check set to Should always be called and a filled Response](https://mintcdn.com/typewise/whSiWDm2OTNjoQEX/images/documentation/testing-and-feedback/tests/simulator-lookups.png?fit=max\&auto=format\&n=whSiWDm2OTNjoQEX\&q=85\&s=632b571e40bcd463cde75b000c251b32)

## Running tests

* **Single test**: Click the run button next to a test, or **Save and run** in
  the test form.
* **Run all tests**: Click **Run all tests** at the top of the page. Every test
  starts at once. A toast shows how many started, how many were already running,
  and how many failed to start.

Each test has at most one active run. While it runs, its run button is disabled
and **Run all tests** skips it.

> [!NOTE]
>
> Tests always run against your latest drafts, including unpublished changes.
> This makes them useful for validating changes before
> [publishing](https://docs.typewise.app/documentation/behavior/publishing.md).

## Reviewing results

Open a test and select the **Runs** tab. Each run is numbered and shows how many
conversations passed.

A run passes only if every conversation passes. Each conversation shows its own
status, and a failed one explains why: wrong Specialist, missing or unexpected
handoff, a required action not used, an action marked "never" used, or the
outcome not met. Click a conversation to read the full exchange next to the run.

Below the conversations, **Analysis** summarizes the run and recommends changes.

![A run with 2 of 3 conversations passed, showing why one failed, suggested improvements, Investigate this conversation with Nova, the Analysis, and Fix this test with Nova](https://mintcdn.com/typewise/I1f8iY7DWGfLoSdg/images/documentation/testing-and-feedback/tests/simulator-edit-test.png?fit=max\&auto=format\&n=I1f8iY7DWGfLoSdg\&q=85\&s=5fef3668927fae11fb040703fa92835f)

### Suggested improvements

When the answer is right but the reply doesn't follow your writing rules (the
greeting, sign-off, formatting, tone, or length), the deviation is listed under
**Suggested improvements**. Suggested improvements never fail a test.

Replying in the wrong language is not a style note. If your instructions require
a language and the AI Agent uses another one, the test fails.

### Fixing tests with Nova

If you have [Nova](https://docs.typewise.app/documentation/nova/what-nova-can-do.md), you can hand failures
and style notes to it:

* **Fix this test with Nova** on a failed run: Nova investigates the run and
  proposes a fix.
* **Investigate this conversation with Nova** on a failed conversation or one
  with suggested improvements.
* **Apply suggestions with Nova** on the test list or a run: Nova proposes one
  instruction change covering the suggested improvements, for you to approve. It
  doesn't edit your tests.

Nova's changes are drafts. Review them before you
[publish](https://docs.typewise.app/documentation/nova/reviewing-changes.md).

## How tests work

When you run a test, the system:

1. **Simulates a customer** from your scenario and test customer. It messages
   your AI Agent back and forth until it considers the scenario complete, the
   conversation is handed off or closed, or 10 turns have passed.
2. **Runs the AI Agent as in production**: the AI Agent picks a Specialist,
   follows its instructions, and calls tools as normal, with tools mocked as
   described above. It doesn't see the scenario.
3. **Evaluates the checks** once each conversation ends: platform checks for the
   Specialist, tools, and handoff, and an AI judge for the expected outcome and
   suggested improvements.
4. **Summarizes the run** with a pass or fail status and an analysis.

## See also

* [Playground](https://docs.typewise.app/documentation/testing-and-feedback/simulator.md): Test
  conversations manually
* [Specialists](https://docs.typewise.app/documentation/behavior/specialists.md): Create topic-specific AI
  behavior
* [Actions](https://docs.typewise.app/documentation/actions/overview.md): Configure automated and manual
  actions
* [Knowledge](https://docs.typewise.app/documentation/knowledge/overview.md): Add knowledge sources for the
  AI
* [Publishing](https://docs.typewise.app/documentation/behavior/publishing.md): Publish changes to your AI
  Agent


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.