> For the complete documentation index, see [llms.txt](https://docs.testfirst.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.testfirst.com/test-case-library/test-case-library/test-cases.md).

# Test Cases

A **Test Case** is the core testing unit in TestFirst. It describes how a specific feature or behavior should be tested.

A test case typically includes:

* **Precondition** – conditions that must be met before the test starts
* **Action / Steps** – the steps required to perform the test
* **Expected Result** – the expected outcome after performing the actions

Test cases can be **automated** using the Recorder or **written manually**.

### Where Test Cases Fit in the Test Case Library

Test cases are stored in the **Test Case Library**, which is organized in a hierarchical structure.

{% hint style="info" %}
Test cases can be created at **any level of the library tree**.
{% endhint %}

***

## Create a Test Case

Test cases can be created in multiple ways in TestFirst.

They can be:

* **Generated automatically** when using **Test Scopes**
* **Created manually** in the **Test Case Library**
* **Created** from the **Mini Test Case Library** inside the **Test Case Editor**

This section explains how to create a test case manually in the Test Case Library.

{% hint style="info" %}
To create a test case, the user must have: **Create/Edit permission for Test Case**

See [**Roles and Permissions**](/administration/roles-and-permissions.md) for more information.
{% endhint %}

### Create a Test Case M**anually in the Test Case Library**

1. Open **Test Case Library**.
2. Locate the node where you want to create the test case.\
   \&#xNAN;*<mark style="color:$info;">A test case can be created under any level of the library tree: Test Project/ Suite/ Section/ Subsection</mark>*
3. **Right-click** the node.
4. Click **Add Test Case**.
5. The **Add Test Case** dialog will appear.
6. Enter the **Test Case Title**.
7. Click **Create**.

The test case will be created and can then be opened in the **Test Case Editor**.

### Next Step: Complete the Test Case in Test Case Editor

After creating a test case, you should **open it in the Test Case Editor** to define the test logic.

In the editor, you can:

* Automate the test using the **Recorder**
* Write test steps using **Gherkin**
* Create **manual test steps**

See [**Test Case Editor**](broken://spaces/ErSaU4WjIuLC7zfVEh8L/pages/aEXqsZpDhGC03MuwgBbm) for more details.

***

## Copy a Test Case Link

You can share a direct link to a test case.

#### Steps

1. Right-click the test case
2. Click **Copy Link**

The link will be copied to your clipboard and can be shared with other users.

***

## Delete a Test Case

Deleting a test case permanently removes it from the Test Case Library.

#### Steps

1. Right-click the test case
2. Click **Delete**
3. Confirm the deletion in the confirmation dialog

{% hint style="warning" %}
**Warning**

Deleted test cases **cannot be restored**.

If the test case is referenced in a Test Scope, it will no longer appear there.
{% endhint %}
