> For clean Markdown of any page, append `.md` to the page URL. > For a complete documentation index, see https://docs.sarvam.ai/llms.txt. > For full documentation content in one file, see https://docs.sarvam.ai/llms-full.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.sarvam.ai/_mcp/server. # Write test cases A test case is one simulated conversation: a **user scenario** the simulated user follows, and the **expected behaviors** the agent is graded against. ## Add a test case #### Create the test In the **Tests** tab, click **Add test** and give the test a name. If the agent has no tests yet, you can instead generate a starter set with AI and edit from there. ![The test editor dialog with fields for the name, the user scenario, and the expected behaviors.](/_fern-img/4129e75a2acc02edc1f9d23b2cd5a451bf06c82bc8d97db14bebb89948c76d54.webp) #### Write the user scenario The user scenario is a brief for the simulated user on how to behave. The simulator improvises within it, so describe the person and their goal rather than the exact words: > The caller has an appointment tomorrow but wants a weekend slot. They are in a hurry, switch to Hindi midway, and ask twice whether a cancellation fee applies. Keep one intent per scenario — if a scenario covers several tasks, split it into separate test cases. #### Add expected behaviors Each behavior describes one thing to check for in the finished conversation. Write them as clear yes-or-no checks: | | | | - | --------------------------------------------------------------------------- | | ✅ | "Repeats the final date and time back to the caller before ending the call" | | ❌ | "Handles the call well" — nothing concrete to check | ## Next #### [Run tests & review results](/conversations/build/tests/run-tests) Run the tests and read transcripts and verdicts. #### [Best practices (API)](/conversations/api/tests/best-practices) How to write each part of a suite, in depth.