Free template

Free test case template (CSV and Markdown)

A test case template that works in a spreadsheet, in Git and in a test management tool. Ten columns, one row per step, and a filled example for a checkout feature.

By the TestPlum teamChecked

Short answer

A test case template gives every test the same fields: an ID, a title, a section, a priority, preconditions, numbered steps each with an expected result, the requirement it proves and its automation ID. Download it as CSV for a spreadsheet, or as Markdown to keep tests in Git next to your code.

What this test case template is for

A test case is a short script that proves one behaviour works: what must be true first, what to do, and what should happen after each action. A template makes every test look the same, so anyone on the team can run anyone else's test without asking questions.

Use it when you start writing tests for a new feature, when you move tests out of a document or a wiki, or when you want a clean format to import into a tool later. The CSV opens in Excel, Google Sheets or Numbers. The Markdown file is one test per file, ready to keep in a repository.

If you are new to the wider picture of cases, runs and results, read what is test management first.

Every field explained

The CSV uses one row per step. The first row of a test holds all its fields. Each further step goes on its own row with only Step and Expected result filled, so the file stays easy to sort and easy to import.

The columns of the test case template
ColumnWhat to writeExample
IDA short, stable key. Never reuse one, even after a test is deleted.CHK-1
TitleThe behaviour being proven, as a short statement.Pay with a saved card
SectionWhere the test lives. Use > for subfolders.Checkout > Payment
PriorityCritical, High, Medium or Low. Critical means a failure stops the release.High
PreconditionsWhat must be true before step 1: account, data, settings.Signed in with a saved Visa card
StepOne action a tester can do and see.Select Pay now
Expected resultWhat should happen after that step, specific enough to fail.The confirmation page shows an order number
RequirementThe requirement or story this test proves.REQ-12
Automation IDThe automated test that covers it, if any.checkout.spec.ts > pays with a saved card
NotesAnything else: browsers, known quirks, test data tips.Run on Chrome and Safari

A filled example for a checkout

The download holds four tests for a checkout, eight rows in all. Here is the first test, which has three steps. Notice that rows two and three leave every column empty except the step and its expected result.

Test CHK-1 written with the template, one row per step
IDTitlePriorityStepExpected resultRequirement
CHK-1Pay with a saved cardHighOpen the cart and select CheckoutThe checkout page opens with the saved card preselectedREQ-12
Select Pay nowThe confirmation page shows an order number and the total charged
Open Orders from the account menuThe new order is listed with the status Paid

Good and weak test cases

A test is only as useful as its expected results. If a tester cannot say clearly whether a step passed, the result means little.

Weak test case fields next to stronger versions
FieldWeakBetterWhy
TitleTest paymentDeclined card shows an error and keeps the cartSays which behaviour is proven, so a failure is clear from the title.
StepDo checkoutEnter a test card the provider declines and select Pay nowOne action per step, so a failure points at one place.
Expected resultWorks correctly“Your card was declined” appears next to the card fieldSomething a tester can see and compare.
Preconditions(empty)Signed in. The cart holds two items. Payment provider in test mode.Another tester can set up the same state.
PriorityHigh for everythingCritical only where a failure stops the releasePriority guides what runs first when time is short.

Common mistakes

  • Several behaviours in one test. If step 4 fails, you cannot tell whether payment or discounts are broken. Split it.
  • Expected results only at the end. Give every step its own expected result, so a tester records which step failed.
  • Hidden test data. Write the codes, accounts and amounts into the preconditions, or link to where they live.
  • IDs that change. Renumbering tests breaks every link from requirements, bugs and old results.
  • No link to a requirement. Without it you cannot tell which promises are tested. See the requirements traceability matrix template.
  • Copying the code into words. Steps describe what a user does and sees, not which function is called.

Keep it in a spreadsheet or in Git

In a spreadsheet, freeze the header row, filter by Section or Priority, and keep one tab per feature area if the file grows. Add a Result column per test run, or better, keep runs separate so the test itself stays clean.

In Git, use the Markdown version: one file per test, with the folders the file sits in as the test's folders. The fields go in front matter between two --- lines; the text goes under ## Preconditions, ## Steps and ## Notes. Each step is a numbered line with an indented Expected: line under it. Changes to tests are then reviewed in pull requests, next to the code they test.

This is the format TestPlum's tests as code sync reads, so the file in the download can be pushed as it is. Lines starting with # in the front matter are comments; they are for you, and a later pull writes the file without them.

The Markdown test case template (abridged)
---
title: Pay with a saved card
priority: high
tags: [checkout, payments, smoke]
refs: [REQ-12]
automation_id: "checkout.spec.ts > pays with a saved card"
estimate: 5
---

## Preconditions
- Signed in as a customer with a saved Visa card.

## Steps
1. Open the cart and select **Checkout**
   Expected: The checkout page opens with the saved card preselected
2. Select **Pay now**
   Expected: The confirmation page shows an order number and the total charged

When a spreadsheet stops scaling

A spreadsheet is fine for one person testing one product. It starts to hurt when several people run the same tests, when you need results from past releases, or when someone asks which requirements were tested before a release. Edits overwrite each other, results get pasted over, and nobody knows which version of a test was run.

TestPlum keeps the same fields with a version for every edit, runs that remember the version they ran, and coverage worked out from real results. To move this template in, use the CSV import. Here is what it reads today, stated plainly:

  • It reads Title, Section (with > for subfolders), Priority, Preconditions, Step and Expected result. A row with only Step and Expected result filled continues the test above it.
  • Add a Folder column to choose the top folder; without one, tests go into a folder called General.
  • ID, Requirement and Automation ID are not read by the CSV import. Rename Notes to Description to keep it. Link requirements in TestPlum after the import.
  • The file is checked first and nothing is saved unless every test is valid; errors name the row.
  • Coming from another tool? TestPlum also imports TestRail, Xray and Zephyr Scale exports. See migrating to TestPlum.

Download

Frequently asked questions

What should a test case template include?

At least an ID, a title, a priority, preconditions, numbered steps and an expected result for each step. Adding the requirement it proves and the ID of any automated test that covers it makes coverage and reporting much easier later.

Should each step have its own expected result?

Yes. When every step has an expected result, a tester can record exactly which step failed, and the bug report writes itself. A single expected result at the end hides where things went wrong.

Why is the CSV one row per step?

So each step and its expected result sit in their own cells, which keeps them readable, sortable and easy to import. Only the first row of a test carries its title and other fields; the rows after it hold just the next step and expected result.

Can I import this template into TestPlum?

Yes. The CSV import reads Title, Section, Priority, Preconditions, Step and Expected result, and treats a row with only a step and an expected result as the next step of the test above. ID, Requirement and Automation ID are not read by the import; link requirements in TestPlum afterwards.

Can I keep test cases in Git?

Yes. The Markdown version is one test per file, with fields in front matter and steps as a numbered list with Expected: lines. TestPlum's command line tool pulls, checks and pushes files in this format, and reports a conflict instead of overwriting a test changed in both places.

How detailed should test steps be?

Detailed enough that a new team member can run the test without asking anything, and no more. One visible action per step, with the data written down, is usually the right level.

Find out whether your next release is ready

Create a workspace, import your tests or write a few, and record a run. Everything on this site is in the product today.