Building Test Cases With Requirements
Please note that building test cases with requirements in DAI requires a license for the Requirements Traceability feature. Please contact our Customer Support to request a Requirements Traceability license. When you have the license, add it on the Adding Licenses on the DAI License page.
In the Test Case Builder, you can quickly create new or update existing test cases. With built-in requirements validation, this no-code, guided process allows any team member to develop test cases from scratch. To save time, you can duplicate an existing test case, and use this as a template.
You can create Model-based test cases and Script-based test cases.
Build a New Test Case With Requirements
Add a Test Case
Start by adding the details of your test case.
- Either go to Designer > Test Cases or if you're editing a model, in the top menu, select Test cases.
- Click + New Test Case.
- Select the type of test case you would like to create - either Model based or Script based.
- In the Test Case box, enter a name for your new test case. Do not use any of the following characters in the name:
" \ ; : {}
. - (Optional) Enter the following details to more easily identify and audit your test case:
- Description: A brief description of the test case.
- Origin: The source of the test case. For example, another test application or auditing system.
- External ID: The unique identifier for the test case in the external system.
- Tags: Add a tag to easily identify a test case, and associated test results, as belonging to a particular category or feature. You can either select an existing tag from the list or type in a new tag name and press Enter.
- If you chose to create a Model-based test case, you will see an option to select your model in the drop-down list. If you chose to create a Script-based test case, you will see an option to choose your test suite in the drop-down list.
- Click Create to begin building your test case. For Model-based test cases, the Test Builder opens with the initial step of the test case, and any global actions are highlighted. For Script-based test cases, the Test Case Builder opens with a drop-down list for you to choose the first script to add to a step.
Define Your Model-based Test Case with Requirements Traceability Feature
Capture the specific path through your model that you want to test. To make sure that you create a valid test case, the Test Case Builder only allows you to select a sequence of states and actions that adhere to the rules built into the model.
-
Select the requirement group you imported for the test case from the Requirement group drop-down list at the top of the section.
-
After selecting the requirement group, you see the requirement drop-down list icon in any new step you add or existing steps (if there are any).
-
Proceed to add any requirement to any step required (up to a maximum of 20 requirements for each step). You can refer to the bottom of the requirement drop-down list, or superscript on the icon itself, to know exactly how many requirements are currently assigned to the test step.
-
After closing the drop-down list, you see the requirements updated with chips for the assigned requirements below the step.
noteTo give you extra control over your requirements, you can perform the following actions from the requirement's chip:
- Click the x button on a requirement chip to remove that requirement from the step.
- Click the requirement chip itself to see a pop-up window with more details about the requirement, including the requirement group name (which you can click and link to the requirement page with the requirement group selected) and descriptions.
- There are 2 buttons within the pop-up window, Remove and Open in Requirements. The Remove option removes a requirement from the current step. The Open in Requirements option opens a new tab that links the Requirement page with the Requirement group and expands the requirement ID in the table.
-
There is a requirement actions button located in the top-right corner of the Step tab. It is only available when the Step tab is active. The actions button is hidden when the Details/Parameters tab is active.
noteThere will be 2 actions available in requirement actions, you can:
- Hide/Show requirement rows: this option is a toggle that shows or hides the Requirements below each step when there are any requirements assigned to the step.
- Clear all requirements: this option clears all the requirements assigned to all the steps in the current test case. When you click this button, you see a confirmation pop-up window prompting you to proceed to clear all the requirements or cancel the clear action.
-
When you're ready, click Save. Then click Run to execute your test case and view the results.
Define Your Script-based Test Case with Requirements Traceability Feature
You can create a Script-based test case with requirements by choosing a suite and scripts within that suite.
-
Select the requirement group you imported for the test case from the Requirement group drop-down list, which is at the same level as the Scripts label.
-
To add a step to the test case, click a script from the list in the left panel.
-
Keep adding steps until you have completed your test case.
-
You can also add all scripts from the list into your test case by clicking the Add all button.
-
If you are looking to add specific scripts, but the list in the left panel is too long, you can filter it by typing in the names of the scripts that you would like to add.
-
Likewise, you can click the Add all button to add all scripts from the filtered list.
-
Proceed to add any requirement to any step required (up to a maximum of 20 requirements for each step). You can refer to the bottom of the requirements drop-down list or superscript on the icon itself to know exactly how many requirements are currently assigned to the test step.
-
After closing the drop-down list, you see the requirements updated with chips for the assigned requirements below the step.
noteTo give you extra control over your requirements, you can perform the following actions from the requirement's chip:
- Click the x button on a requirement chip to remove that requirement from the step.
- Click the requirement chip itself to see a pop-up window with more details about the requirement, including the requirement group name (which you can click and link to the requirement page with the requirement group selected) and descriptions.
- There are 2 buttons within the pop-up window, Remove and Open in Requirements. The Remove option removes a requirement from the current step. The Open in Requirements option opens a new tab that links the Requirement page with the Requirement group and expands the requirement ID in the table.
-
There is a requirement actions button located beside the Requirement group drop-down list.
noteThere will be 2 actions available in requirement actions, you can:
- Hide/Show requirement rows: this option is a toggle that shows or hides the requirements below each step when any are assigned to the step.
- Clear all requirements: this option clears all the requirements assigned to all the steps in the current test case. When you click this button, you see a confirmation pop-up window prompting you to proceed to clear all the requirements or cancel the clear action.
-
Once all scripts are added, you can remove any script individually from the script list in the right panel by clicking on the trash button.
-
You can also remove multiple scripts by checking their checkboxes and clicking the Remove button.
-
The Remove button becomes Remove all if none of the checkboxes are checked and allows you to quickly remove all added scripts.
-
When you're ready, click Save. Then click Run to execute your test case and view the results.
We now support script selection from helper suites that are defined in Eggplant Functional
The maximum number of scripts/steps that DAI allows in a script-based test case is 1,000. You cannot add more than 1,000 scripts/steps to a script-based test case.
Edit an Existing Test Case
It's important to maintain your test cases. A test case can become invalid if you change the name of a state or action in a model, or related parameters, and don't update the affected steps.
To update a test case:
- Go to Designer > Test Cases. Search or filter the list to find the test case you're interested in.
- From the actions menu, select Edit. The test case appears ready for editing. If the test case is already out-of-step with recent model changes, an error appears. In this case, click Edit and follow the on-screen text to resolve the error.
- You can now do the same editing tasks as when you create a new test case, including removing and adding steps, updating parameter values, and changing the Test Case name.
- When you have made all changes, click Save.
- To learn more about viewing, managing, and analyzing existing test cases, see Managing Test Cases.
- To understand more about test cases in Eggplant DAI, and how they influence your test results, see About Test Cases.