# Run tests

URL: https://testmode.ai/docs/run-tests/

> A Testmode run executes test cases in cloud browsers. Start one for all tests, a plan or a single test, check its credit cost, and re-run it.

You start a run from the **Run tests** dialog: pick an environment, pick what to run, check the credit cost and click **Run**. Testmode runs each test in its own cloud browser and takes you straight to the run's page, where results come in.

**Before you start:** you need the Editor role or above, at least one environment, and at least one enabled test case with steps or an Expected Outcome.

## Open the Run tests dialog

Use whichever is closest:

- Click **Run test** at the top right of any page while a project is selected.
- Press `Cmd+R` on Mac or `Ctrl+R` on Windows and Linux.
- Open the command palette with `Cmd+K` or `Ctrl+K` and choose **Run test**.
- Choose **Run** in the row menu of a test case or a test plan. That test case or plan is preselected.

Clicking **Run test** on a plan's page also preselects that plan, as long as it is enabled and not empty.

A test case with no steps and no Expected Outcome shows **Run (add a step first)** in its row menu, and the item is disabled. Add a step to run it.

**Note**

While a project is selected, `Cmd+R` and `Ctrl+R` open the Run tests dialog instead of reloading the page. To reload, use your browser's reload button or `F5`. For Viewers, who cannot start runs, the shortcut reloads the page as usual.

## Choose an environment

Under **Environment**, pick where the tests run. The project's default environment is selected for you.

Production environments carry a **PROD** badge. The badge is a label only: Testmode does not block or warn before a run on production. Tests that place orders or send forms do that for real, so run them only against environments meant for testing. See [Environments](https://testmode.ai/docs/environments/).

## Choose what to run

Under **What to run**, pick one of three options:

| Option | What runs | Run name |
| --- | --- | --- |
| **All test cases** | Every enabled test case in the project. The number next to the option counts them. | `All Test Cases` |
| **Test plan** | Every enabled test case in the plan you select | The plan name |
| **Single test** | The one test case you select | The test case name |

**Test plan** appears only when the project has at least one enabled plan. Each plan in the list shows its test count, for example `Storefront smoke (5 tests)`. That count includes disabled test cases and test cases without steps, which are left out of the run.

Credential overrides set in a plan apply only when the plan runs, as a **Test plan** run or on a schedule. **All test cases** and **Single test** use each test case's own credential. See [Group tests into test plans](https://testmode.ai/docs/test-plans/).

### Test cases without steps are skipped

A test case with no steps and no Expected Outcome gives the agent nothing to check. Testmode leaves it out of the run and does not charge for it.

- In the **Single test** list, such a test case is marked "(no steps)".
- When your choice includes any, an amber notice says so, for example "1 of 5 test cases has no steps or expected outcome and will be skipped."
- For a single test, the notice reads "This test has no steps or expected outcome to check. Add at least one step."
- When nothing runnable is left, **Run** is disabled.

## Check the cost

The dialog footer shows what the run will cost and what your organization has, as "Uses N credits · M available". Each test case costs one credit per step you wrote in it, and at least one credit. Skipped test cases are not counted. Until there is something to run, the footer reads "One credit per test step".

[Screenshot: Run tests dialog with Production selected, Test plan chosen with Storefront smoke, and the credits the run uses and the balance in the footer. Caption: Pick an environment and what to run; the footer shows the credits the run will use.]

If the run costs more than the balance, the line turns amber and **Run** is disabled. Owners and Admins see a **Buy credits** link. Other roles see "ask an organization admin to buy credits".

Click **Run** to start. The dialog closes and you land on the run's page. Each test waits in `Queued` until a browser is free, and the run page says what it is waiting for. See [Read run results](https://testmode.ai/docs/read-run-results/#watch-a-run-live).

Testmode checks the cost and the test cases again when you click **Run**. If something changed since you opened the dialog, you see "Not enough credits" or "Failed to start test run" with the reason. See [How credits work](https://testmode.ai/docs/how-credits-work/) for when credits come back.

## Re-run a previous run

On the **Runs** page, or in **Recent runs** on Overview, open a run's row menu and choose **Re-run**.

- For a plan run, Testmode runs the plan as it is now, on the same environment. Test cases added to or removed from the plan since then are reflected.
- For any other run, it runs the same test cases on the same environment. Test cases disabled since then, or left without steps, are left out.

Re-run starts straight away, with no dialog and no cost preview, and takes you to the new run. If it cannot start, you see "Failed to re-run" with the reason, for example that the organization does not have enough credits or that none of the test cases has steps.

The same menu has **View details** and **Copy link**. **Copy link** copies the run's address, which only members of your organization can open.

[Screenshot: Runs list with search and status filters, and passed and failed runs, one of them scheduled, where failed runs show a red summary line, each with who started it, its time and a Production badge. Caption: Runs lists every run with who started it, its status, when it ran and its environment.]

## Stop a run

You cannot stop a run once it has started. Every test in it runs until it reaches a verdict. The status filter on the Runs page lists `Canceled`, but runs do not end in that status today.

## Re-run only the failed tests

There is no way to re-run only the failed tests of a run: **Re-run** repeats the whole run. To retry one failed test, open the Run tests dialog and start a **Single test** run for that test case.

## Who can start runs

Starting runs needs the Editor role or above. Everyone in the organization can open the Runs page and read results. See [Roles and permissions](https://testmode.ai/docs/roles-and-permissions/).

For Viewers:

- The **Run test** button and the command palette's **Run test** are hidden.
- `Cmd+R` or `Ctrl+R` reloads the page.
- **Re-run** still appears in the Runs row menu, but Testmode refuses it with "Failed to re-run" and "Viewers cannot start test runs".

## Related

  - [Read run results](https://testmode.ai/docs/read-run-results/): Watch the browser live and see why each test passed or failed.
  - [How credits work](https://testmode.ai/docs/how-credits-work/): What a run costs and when credits come back.
  - [Group tests into test plans](https://testmode.ai/docs/test-plans/): Build the plans you run together.
  - [Keyboard shortcuts](https://testmode.ai/docs/keyboard-shortcuts/): Open Run tests and move around without the mouse.
