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

# Test Cases

> Write reusable manual test cases—step-by-step or high-level intent—that Scout can run on demand and replay deterministically.

A **test case** is a reusable unit of testing work. Instead of describing what you want every time you launch a run, you save the scenario once and run it whenever you need it—after a deploy, before a release, or as part of a [test suite](/essentials/test-suites).

Find your test cases under **Library → Test Cases** in the project sidebar.

## Two ways to write a test case

When you click **New test case**, choose the style that fits the scenario:

<CardGroup cols={2}>
  <Card title="Step-by-step" icon="list-ol" color="#17A977">
    Spell out each action as an explicit step. Best when you know exactly what should happen and want repeatable, predictable coverage.
  </Card>

  <Card title="High-level intent" icon="wand-magic-sparkles" color="#8b5cf6">
    Describe the goal in plain language and let Scout figure out the steps. Best for flows that change often or when you care about the outcome, not the clicks.
  </Card>
</CardGroup>

## Writing the instruction

Every test case starts with a **Title** (e.g. *Login flow*). From there the fields depend on the mode you picked.

### Step-by-step cases

| Field                | Required | What it's for                                                                                                                   |
| -------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------- |
| **Steps**            | Yes      | The ordered actions Scout performs, one per line — e.g. *"Open the login page"*, *"Enter valid credentials"*, *"Click Submit"*. |
| **Preconditions**    | Optional | State that must be true before the steps run — e.g. *"User must be logged in"*.                                                 |
| **Expected results** | Optional | What you expect to be true afterward — e.g. *"Dashboard is visible"*.                                                           |
| **Test data**        | Optional | A JSON object Scout can reference during the run — e.g. `{"email": "demo@example.com"}`.                                        |

A step-by-step case needs **at least one step** to be valid.

### Intent cases

For an intent case, you write a single **Intent** describing the goal:

> *"Verify a user can reset their password from the login page."*

Scout interprets the intent, plans the steps, and adapts as it explores—so the case keeps working even when your UI shifts. Preconditions and test data are still available if you want to pin down context.

<Tip>
  Reach for **intent** when you're testing an outcome (*"a user can check out with a saved card"*) and **step-by-step** when the exact sequence matters (*"the wizard advances only after every required field is filled"*).
</Tip>

## Running a test case

Test cases run in the [**Test Runner**](/essentials/test-runner). Open it, set your **Target URL**, load the case from your library, and click **Run**. Scout spins up a browser, executes the case, and reports pass or fail with the supporting evidence.

You can also re-run a case directly from the Test Cases list once it has a recorded script (see below).

## Deterministic replay with Playwright

The first time a step-by-step case passes in the Test Runner, Scout automatically records a **deterministic Playwright script** of exactly what it did. After that, the case shows a **Re-run with Playwright** action in the list.

* **Re-run with Playwright** replays the saved script verbatim—no AI, fully repeatable, fast. Ideal for regression checks.
* **View script** opens the recorded script, and **Download** saves it so you can run it in your own pipeline.

<Note>
  A script is only recorded on a **passing** run. If a case has never passed, the replay and view-script actions stay disabled until it does.
</Note>

## Managing test cases

From the Test Cases list you can **Edit**, **Delete**, and see each case's **Last run** time at a glance. Editing a case applies to all future runs; deleting one removes it permanently but leaves any [suites](/essentials/test-suites) it belonged to intact.
