Moving, Copying & Deleting Test Cases
TestRail makes it easy to streamline your test design and test planning phases with reusable test cases. Test cases are the basic building blocks of the test management workflow in TestRail. You can view your test cases under the Test Cases tab within your TestRail project. This article describes some of the more advanced ways you can work with Test Cases, such as moving and copying them within your Test Cases repository, as well as deleting/restoring your test cases.
Moving and copying test cases
Moving and copying test cases (or entire sections) is often useful to duplicate or rearrange your test suites and test cases. There are two ways to copy and move test cases within TestRail, described below.
Copy/move from another test suite (for projects with multiple test suites)
If you want to copy or move test cases or entire sections from another test suite, simply open the Copy or Move dialog from the toolbar of a test suite. You can also use this dialog to duplicate entire test suites.
Copy/move within the same test suite
To copy or move test cases and entire sections within a test suite, you can drag & drop cases and sections. To do this, simply drag the little grip icon on the left of the checkboxes. If you want to copy test cases instead of moving them, simply press the Shift key before and during the operation.
Deleting and Restoring Test Cases
Deleting test cases will delete any associated tests from open test runs and plans. Users can delete test cases by marking them as deleted, or permanently and immediately deleting them. Test cases marked as deleted will be hidden from TestRail, but will be restorable for 7, 14, or 30 days. This can be configured by a TestRail administrator inside Administration > Site Settings > User Interface. Test cases permanently deleted will be immediately removed from the TestRail database and cannot be recovered without a full database restore.
Please Note: To avoid losing test data, we recommend closing test runs and plans as outlined here and restricting the permission to permanently delete test cases.
When marking test cases as deleted, the test cases are placed in a deleted state, removing them from test runs and plans, but keeping them in the TestRail database. You can show or hide these deleted test cases in the UI by toggling the button shown here:
From the time test cases are marked as deleted and until the configured retention period passes, Test cases in this deleted state can be restored in a few ways:
- By opening the bulk edit screen for deleted test cases.
- By viewing a deleted test case and clicking on the restore or edit button.
- Using the TestRail API and updating the is_deleted field.
How to Bulk Restore Cases Marked as Deleted
If you have marked test cases as deleted and they have not been deleted permanently yet, you can restore them in bulk through the following process.
- In your test case repository, toggle on “Display Deleted Test Cases”
- Select the test cases in your repository that have been marked as deleted by click the checkboxes on the left
- With the test cases you want to restore selected, click the Edit button in the toolbar at the top of your test case respository, then select Edit Selected
- A pop-up will appear prompting you to confirm that you would like to restore the cases marked as deleted. Click OK.
- Your cases have now been restored! 🎉
- After your cases are restored, you will automatically be redirected to the bulk edit cases page for the cases you had selected. If you want to make any bulk changes to those cases, you can do so now. Otherwise, simply click Cancel to navigate back to your test case repository.