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

# Tests

> A simulated customer talks to your agent, a judge grades each conversation, and you get a pass rate to compare before and after a change.

A **test** is a conversation your agent has with a simulated customer. You describe who the customer is and what they want, and the one thing that has to happen for the conversation to count as a success. Wiredesk plays that conversation as many times as you ask, grades each one, and shows you the transcripts.

Use tests to check a change before customers meet it: new instructions, new knowledge, a new action. Run the same tests again after the change and compare the pass rate.

Tests are under **Agents → your agent → Tests**.

## How a run works

Each conversation in a run goes like this:

1. A **simulated customer**, played by another AI model, opens the conversation from the description you wrote. It only knows that description and the conversation so far. It never sees your agent's instructions or the success criterion.
2. **Your agent** replies with its real setup on that channel: its instructions (including the [channel's own wording](https://wiredesk.ai/docs/persona/channel-wording.md)), its knowledge, its actions and its [procedures](https://wiredesk.ai/docs/persona/procedures.md).
3. They keep talking until the customer is done or the conversation reaches its **max turns**.
4. A **judge**, another AI model, reads the finished conversation and every action the agent called, with what it sent and what came back, and passes or fails it against your **success criterion**, with a reason.
5. If the test lists **expected actions**, the actions the agent called are checked too.

A conversation passes only when the judge passes it **and** the action check passes.

The simulated customer and the judge use the same model in every test, so pass rates can be compared between tests and between runs.

> [!NOTE]
>
> Test conversations never reach your customers. They don't appear in [Conversations](https://wiredesk.ai/docs/workspace/conversations.md), the [inbox](https://wiredesk.ai/docs/workspace/inbox.md) or [Analytics](https://wiredesk.ai/docs/workspace/analytics.md), and nothing is booked, saved or sent unless you set a read-only action to **Live**. Each agent reply counts toward your usage and [spend cap](https://wiredesk.ai/docs/account/spend-cap.md) like a reply in a real conversation; the simulated customer and the judge are not charged.

## Create a test

On **Tests**, click **New test** (**Create a test** before the first one).

| Field | What to write |
| - | - |
| **Test name** | A label for the list and the export. Only your team sees it. |
| **Simulated customer** | Who they are and what they want, for example: "A Premium customer who ordered 12 days ago and wants to return one item for a refund. Polite but firm." Give it details it would know, like an order number. |
| **Channel** | **Website chat** or **Email**. The agent answers with that channel's wording and actions. |
| **Max conversation turns** | How many messages the customer can send, from 1 to 20. A conversation that hasn't met the criterion by then fails. |
| **Success criterion** | The one thing that has to be true, for example: "The agent confirms the order, explains the refund policy once, and offers the return without escalating." |
| **Actions** | Optional. Which actions the agent must call, and what each one returns. See below. |

> [!TIP]
>
> Keep the success criterion to one clear outcome. The judge grades against it alone, so "books a demo for next week" gives more reliable results than a list of five things.

**Save and run 3 times** saves the test and starts three conversations. **Save** only saves it.

### Expected actions

Tick an action under **Actions** to expect it.

* **None ticked** (the default): actions aren't checked. The agent can call any action, or none, and only the judge grades. The test shows **Not asserted**.
* **Any ticked**: the agent must call exactly those actions, no more and no fewer. One that was never called, or one that wasn't ticked, fails the conversation even when the judge passed it.

Order doesn't matter, calling the same action twice counts once, and a call that returned an error still counts. Searching knowledge isn't an action and is never counted.

Following a procedure isn't an action, so it is never checked here, and a test never adds to a procedure's counts. The check only looks at which actions were called. To check what was sent, for example the right date, put it in the success criterion: the judge sees each action's inputs.

If **A person in chat & email** is limited to [business hours](https://wiredesk.ai/docs/actions/business-hours.md) on **Handoff**, a test run outside them can't call it, the same as a real conversation.

### Action responses

By default every action returns a success without running, so a test never books a meeting, saves a lead, opens a ticket or notifies anyone. Choose what an action returns next to it:

| Choice | What happens |
| - | - |
| **Returns a success** | The default. A generic success shaped like the real response. |
| **Mock response** | The action returns the JSON you write, and nothing real runs. It starts from a sample. Turn on **Return as error** to see how the agent handles a failure. |
| **Live** | The real action runs. Only actions that just read data can be live: open slots from [Cal.com](https://wiredesk.ai/docs/actions/book-meetings.md), and [API calls](https://wiredesk.ai/docs/actions/api-calls.md) that use GET. Results can differ between runs. |

Every action is marked **Read-only** or **Writes data**. **Live** is locked for actions that write data.

A success or a mock response is only returned when the call has what the real action needs. If the agent saves a lead without a required field, or takes a message without a way to reach the customer, the action fails with the same error it gives in a real conversation.

## Run a test

* **From the Tests page:** tick tests and click **Run selected**, or open a test's **⋯** menu and click **Run 3 times**.
* **From a test's page:** click **Run again**.

Each **Run** button runs every test three times. The arrow beside it picks 1, 3, 5, 10 or 20.

Conversations run in the background, five at a time per workspace; the rest wait as **Queued**. You can leave the page. While a test is running you can't edit it or run it again, and **Run selected** skips it.

## Read the results

Open a test to see its latest run:

* **Pass rate**: the share of graded conversations that passed. Conversations with **No verdict** aren't counted.
* **Conversations finished**: how many of the run's conversations are done.
* **The runs table**: one row per conversation with its status, turns, the actions the agent called, and how long it took.

| Status | Meaning |
| - | - |
| **Queued** | Waiting to start. |
| **In progress** | The conversation is running. |
| **Passed** | The judge passed it, and the action check passed if the test has one. |
| **Failed** | The judge failed it, or the agent called the wrong actions. |
| **No verdict** | Something stopped it before it could be graded, for example the spend cap or a model that didn't answer. |

Click a row to read the conversation. The judge's reason is at the top, with **Never called** and **Not expected** under it when the action check failed. Under each reply, open the actions line to see what each action was sent and what it returned, labelled **Mocked response** or **Response**.

**Earlier runs** lists the test's last ten runs with their pass rates. Click one to open it. **Export results** downloads the run as a CSV: one row per conversation with its status, turns, actions called, never called and not expected, how long it took, when it started, the judge's reason and any error.

The **Configuration** card under the results shows how the test is set up.

## Manage tests

Search the list by name, or show only tests that are **Completed**, **In progress** or **Never run**.

From a test's **⋯** menu on the Tests page:

* **Edit test**: the next run uses the new setup. Earlier runs keep their results.
* **Duplicate test**: opens the editor with a copy, to make a variation.
* **Export results**: the latest run as CSV.
* **Delete test**: removes the test and its run history. This can't be undone.

Creating, editing, running and deleting tests needs the Admin or Owner role. Everyone in the workspace can read the results.

## Limits

| Limit | Value |
| - | - |
| Tests per agent | 50 |
| Max conversation turns per test | 20 |
| Conversations started by one run (tests × times) | 200 |
| Conversations running at once, per workspace | 5 |
| Size of a mock response | 50,000 characters |

## Related

* [Test your agent](https://wiredesk.ai/docs/agents/test-your-agent.md): **Preview** in chat or on a call, and the demo page
* [Fix a wrong answer](https://wiredesk.ai/docs/knowledge/fix-a-wrong-answer.md)
* [Actions](https://wiredesk.ai/docs/actions/overview.md)


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