Preconditions specify the conditions that need to be fulfilled in order to execute a test.
A Precondition is like defining the step "0" for your tests. This is very useful in many use cases where you have to start by doing exactly the same thing. For example, if you are going to do something on a system, you most probably have to authenticate first, right? But sometimes, you have to do several things (e.g., restore the DB, authenticate) before going through your Test steps. And each of those things may be done and used independently, i.e., some Tests may require just restoring the DB, another may require just to authenticate, and others may require both or more.
There are three default Test Types:
Each of the Test Types has a Kind, the Kind of the Type of a Precondition must be of the same Kind as the Type of the Test it is associated with.
To create a new Precondition issue:
Step 1: Click the Create Issue at the top of the screen to open the Create Issue dialog box / page.
Step 2: Select the Project and on Issue Type select Precondition.
Step 3: Type a Summary for the Precondition and complete all appropriate fields — at least, the required ones which are marked with an asterisk.
Step 4: When you are satisfied with the content of your Precondition, click the Create button. If you selected the Create another check box (above), a new Create Issue dialog appears. This issue is automatically pre-populated with your previous Precondition details, while leaving the Summary field blank.
To Edit an existing Precondition issue using inline edit:
Step 1: On the Precondition page view, hover your mouse over a field and click it to Edit Inline.
Examples:
- You can hover on the actual Precondition Type, click it to enter the edit mode, and choose other available option on the selected field.
- You can hover on the Definition field, click it to enter the edit mode, and modify the contents.
Step 2: To save the changes, just click outside of the field area of click the save button located in the bottom right corner of the editing field.
When the Type of a Precondition is changed both the previous Info details and the associated Tests will be lost.
To associate Tests with a Pre-Condition from the Pre-Condition issue view screen:
Step 1: Open the Pre-Condition you wish to associate a Test with.
Step 2: Click the Add Tests button (under the Tests tab on the view page) to open the Add Tests dialog box.
Step 3: Select or search the Test issues to be associated with the Pre-Condition:
Select Test Issues - In order to select the Tests to be associated you can, under the Select tab:
- Input the desired Test Issue Key on the Tests field
- Click on the Down Arrow on the Tests field and select the Test from its History Search list
- Click on the Search tab to use the Find Jira issues browser (more details here)
Search Test Issues - In order to search for Tests to be associated you can, under the Search tab:
- Browse for the desired Test Project, Type or terms it Contains
- Click on the More button to add more browse fields such as Label, Fix Version, Component, Covering, Covering Fix Version, Saved Filters and Workflow Status
- Click on the Magnifier button after filling the browse fields to get a list of matching entries
- Click on the Advanced button to perform a JQL search (more details here)
Step 4: Click Add Selected to add the tests you have selected or Add All to add all the tests that were filtered by the search parameters.
To remove Tests from a Precondition using the Precondition issue view screen:
Step 1: Open the Pre-Condition you wish to remove a Test.
Step 2: On the Tests table, click on the ... in desired Test row and then click on the Delete option that appears in the drop down menu. You will be prompted with a confirmation dialog.
Xray provides the following bulk operations on the Tests table.
To execute these bulk actions:
Step 1: Open the Precondition issue.
Step 2: A checkbox should be displayed on each Test row and also the bulk actions button in the actions column header should appear after a test is selected.
Step 3: Selected the desired Test issues.
Step 4: Click the bulk actions button located on the actions column header and choose one of the available actions.