# Group tests into test plans

URL: https://testmode.ai/docs/test-plans/

> A test plan is a named group of test cases you run together. Create plans, add or remove tests, override logins per plan, and duplicate or delete plans.

A test plan groups related test cases so you can run them together, by hand or on a schedule. You pick the test cases once, and Testmode runs every enabled one that has steps or an Expected Outcome each time the plan runs.

At Pellbrook Digital, the Toolshop Storefront project has a **Storefront smoke** plan for search, catalog and cart checks, and a **Checkout regression** plan for the signed-in cart and checkout flows.

**Before you start:** you need the Editor role or above to create or change plans. Everyone in the organization can see them.

Viewers see the plans without edit controls. The Test Plans list has no **New Test Plan** button, no **Edit**, **Duplicate** or **Delete** in the row menu, and a disabled **Enabled** switch. A plan's page has no **Add Test Case** button, no controls on its test cases and no **Settings** or **Delete** menu.

## Create a test plan

1. In the sidebar, click **Test Plans**.

2. Click **New Test Plan**, or press `C` on the Test Plans page.

3. Enter a name, for example `Checkout regression`.

4. Optionally add a **Description**, such as `Cart and checkout flows for a signed-in customer`.

5. Under **Test Cases**, tick the test cases the plan should run. Search by name or tag to narrow the list. Only enabled test cases appear here.

6. Leave **Enabled** on, then click **Create Test Plan**.

The plan appears in the Test Plans list with its **Test Cases** count and **Last Run**. You can also create an empty plan and add test cases later.

To rename a plan or change its description, choose **Edit** in the plan's row menu, or **Settings** in the menu on the plan's page, then click **Save Changes**.

## Add and remove test cases

Open a plan to see its **Test Cases** tab.

[Screenshot: Test Cases tab of the Storefront smoke plan, with Add Test Case and five test cases. The hovered row, Add a product to the cart, shows its Required switch, the settings button and a red X to remove it. Caption: A plan's Test Cases tab lists its test cases; hover a row to reach its Required switch, settings and remove button.]

1. Click **Add Test Case**.

2. In the **Add Test Cases** dialog, tick one or more test cases. The list shows enabled test cases that are not in the plan yet.

3. Click **Add (n)**, where n is the number you ticked.

To remove a test case, hover its row and click the X. It is removed straight away, with no confirmation. The test case itself is kept, and so is its place in any other plan.

If Testmode refuses a change to a plan, it shows an error such as "You don't have permission to change this test plan" instead of a confirmation.

You can also manage plan membership from the test case side, and create a new plan in the same step. See [Organize test cases](https://testmode.ai/docs/organize-test-cases/).

**Note: Good to know**

- A test case can be in a plan only once, and in any number of plans.
- Tests in a plan have no set order. When the plan runs, they are all queued at once, each in its own browser, and you cannot reorder them.
- The **Test Cases** count includes disabled test cases. Disabled test cases are left out when the plan runs.
- Test cases with no steps and no Expected Outcome are skipped when the plan runs. Each shows a **No steps** marker, and the tab says how many, for example "1 without steps will be skipped when the plan runs". See [Test cases marked No steps](https://testmode.ai/docs/organize-test-cases/#test-cases-marked-no-steps).

## Override the login for one test case

A test case with a **Login Credential** normally logs in with that credential. In a plan, you can make it log in with a different credential, only when it runs as part of this plan.

1. On the plan's **Test Cases** tab, hover the test case and click the settings icon (two sliders), between the **Required** switch and the X.

2. In **Configure Test Case**, open **Credential Override**.

3. Choose a credential. **Use default** keeps the test case's own credential, shown in brackets.

4. Click **Save**.

The row now shows an **Override** badge, and its "Login:" line names the credential the test will use.

[Screenshot: Configure Test Case dialog for Sign-in lands on My account, with the Credential Override list open on Use default (Jane Doe – demo customer), the credentials Jane Doe – demo customer and Unregistered customer below it, and Cancel and Save buttons. Caption: A credential override changes the login for one test case, only when it runs as part of this plan.]

The override applies whenever the plan runs, including scheduled runs. Running the same test case with **Single test** or **All test cases** uses the test case's own credential. If the override credential is deleted later, the override is cleared and the test case's own credential is used again. See [Credentials and automatic login](https://testmode.ai/docs/credentials-and-automatic-login/).

## The Required switch

Each test case in a plan has a **Required** switch, on the row when you hover it and in **Configure Test Case**. Turning it off shows an **Optional** badge.

**Note**

The Required switch does not currently change how a plan runs or how results are counted. Every enabled test case in the plan runs, and any failed test makes the whole run `Failed`, including one marked Optional.

## Enable or disable a plan

Use the **Enabled** switch in the Test Plans list, or in the plan's edit dialog. A disabled plan is dimmed in the list, shows a "Disabled" badge on its page, and is hidden from the plan list in the [Run tests dialog](https://testmode.ai/docs/run-tests/).

**Caution**

Disabling a plan does not stop its schedules. To stop scheduled runs, open the plan's **Schedules** tab and switch off each schedule.

## Duplicate or delete a plan

Both actions are in the plan's row menu in the Test Plans list.

- **Duplicate** creates a copy with " (copy)" added to the name. It copies the description, the enabled state, and every test case with its credential override and Required setting. It does not copy schedules or run history.
- **Delete** asks you to confirm, then permanently deletes the plan. You can also delete from the menu on the plan's page.

**Caution**

Deleting a plan also deletes all of its schedules, even though the confirmation dialog does not mention them. The test cases are kept, and past runs of the plan stay on the Runs page.

## Related

  - [Schedule test plans](https://testmode.ai/docs/schedule-test-plans/): Run a plan hourly, daily, weekly or monthly on one environment.
  - [Run tests](https://testmode.ai/docs/run-tests/): Start a run of a plan, all test cases or a single test.
  - [Credentials and automatic login](https://testmode.ai/docs/credentials-and-automatic-login/): Store logins that tests use to sign in first.
  - [Organize test cases](https://testmode.ai/docs/organize-test-cases/): Tags, filters and plan membership from the Test Cases page.
