# Version History

ContextQA automatically tracks changes to your test cases over time. The **Version History** tab on the test case details screen lets you browse previous versions, inspect what changed, compare any two versions side by side, and restore an earlier version when needed.

## Overview

Every time you modify a test case — whether by editing steps, updating configuration, or importing changes — ContextQA creates a new version. Each version captures:

* **Version number** — Sequential identifier (v1, v2, v3, ...)
* **Change type** — How the version was created (Create, Update, Restore, or Import)
* **Change summary** — Brief description of what changed
* **Author** — The team member who made the change
* **Timestamp** — When the change occurred
* **Detailed changes** — Field-level before/after values grouped by category

## Opening version history

1. Navigate to **Test Development** and open any test case.
2. On the test case details screen, click the **Version History** tab in the main content tab bar.

The version history view loads with two panels: a **version list** on the left and a **detail panel** on the right.

## Version list

The left panel displays all versions for the test case, ordered from newest to oldest. Each entry shows:

| Field              | Description                                                      |
| ------------------ | ---------------------------------------------------------------- |
| **Version number** | Label such as `v12`, `v11`, etc.                                 |
| **Current badge**  | Indicates the active version of the test case.                   |
| **Change type**    | Badge showing Create, Update, Restore, or Import.                |
| **Change summary** | Short description of the changes in this version.                |
| **Author**         | Avatar initials and name of the team member who made the change. |
| **Relative time**  | How long ago the version was created (e.g., "2 hours ago").      |

Click any version to view its details in the right panel. The list supports infinite scroll — additional versions load automatically as you scroll down.

## Version detail view

When you select a version, the right panel displays:

* **Version header** — Version number, "Current" badge (if applicable), author name, and exact date.
* **Change summary** — The description of changes for this version.
* **Grouped changes** — Changes organized by category.

### Change categories

Changes are grouped into the following categories:

| Category                  | What it tracks                                                  |
| ------------------------- | --------------------------------------------------------------- |
| **Step changes**          | Steps added, removed, or modified (with step number reference). |
| **Logic changes**         | Updates to loops, conditions, and control flow.                 |
| **Configuration changes** | Test case settings and AI configuration changes.                |
| **Test case changes**     | Metadata changes such as name, tags, URL, or priority.          |

Each individual change displays:

* **Operation badge** — Added (green), Removed (red), or Changed (amber).
* **Field name** — Which field was affected.
* **Before value** — The previous value (for Changed and Removed operations).
* **After value** — The new value (for Changed and Added operations).

## Comparing versions

To compare any two versions side by side:

1. Select a version from the list (any version other than the current one).
2. Click **Compare with Current** in the detail panel header.
3. The comparison view opens with the selected version on one side and the current version on the other.

In the comparison view, you can:

* **Select different versions** — Use the dropdown selectors to compare any two versions, not only the selected version and the current one.
* **Swap sides** — Click the swap icon to reverse the comparison direction.
* **View the difference summary** — Badges at the top show the total count of added, modified, removed, and unchanged items.

The comparison displays two sections:

* **Test case changes** — Field-level differences in test case metadata, shown as before/after cards.
* **Step changes** — Step-level differences with step number references and before/after cards.

Click **Close** to return to the standard detail view.

## Restoring a previous version

To revert a test case to an earlier state:

1. Select the version you want to restore from the version list.
2. Click **Restore this Version** in the detail panel header.
3. A confirmation dialog appears explaining that restoring creates a new version based on the selected version.
4. Click **Restore** to confirm.

ContextQA creates a new version (with change type "Restore") that contains the state of the selected version. The original version history is preserved — restoring does not delete any previous versions.

> **Important**: Restoring a version updates the test case steps, configuration, and metadata to match the selected version. Review the version details or use the comparison view before restoring to confirm the changes.

## Related documentation

* [Creating Test Cases](https://learning.contextqa.com/web-testing/creating-test-cases) — Test case creation workflow and details screen overview
* [Test Steps Editor](https://learning.contextqa.com/web-testing/test-steps-editor) — Detailed guide to all available step actions
* [Test Data Management](https://learning.contextqa.com/web-testing/test-data-management) — Variables, CSV imports, and data-driven testing
