Reference Test Cases and Test Step reuse #792788/v3916 |
Tags:
not added yet
Table of Contents
Easier Maintenance of Tests using Reusable Test Cases and Test StepsReusable Test Cases is a tool to improve re-usability and maintainability of Test Management by reducing redundancy between Test Cases in projects. Often the Test scenarios require that some Test Steps, Pre- or Post-Actions of Test Cases contain repeated or similar actions performed during a Testing cycle. Just copying Test descriptions between Test Cases may result in lots of duplications and difficulty in maintenance when a wrong or outdated test-description appears several times in the Test Case hierarchy. To improve this situation in codeBeamer 7.8 we have introduced two new features:
Additionally, as of codebeamer 21.04 (Dorothy), you can also benefit from reusable Pre- and Post-Actions, which similarly to Reference Test Steps, can be used to reuse Pre- and Post-Actions while automatically keeping it in sync with the original item. Reusing Test StepsDefining a new Test Case with reusing Test StepsWhen editing a Test Case and defining its Test Steps users may want to reuse existing Test Steps defined as part other Test Cases. For that the Test Cases' editor's right side shows the Test Case tree and When a user Drag-and-Drops one or more Test Steps from Reference Test Case on the right side into the Test Case the user is going to be asked about the following options:
The difference between the copy and reference mode is: Copy of Test StepsWhen using the Copy option the original and the copied Test Steps will have no relationship or connection between them, so if the original Test Step changes the copy will not change. Also the copied Test Step can be modified any time without restrictions, and such modification won't affect the original Test Step at all. Reference Test StepsWhen creating a Reference Test Step then the newly created Test Step will hold and maintain a reference to the original Test Step, which means that whenever the original Test Step changes the reference Test Step is automatically and immediately kept synchronized with the changes. This also means that the text ("Action", "Expected Result) inside Reference Test Step can not be modified, as that would make the reference logic invalid. Therefore the reference Test Steps will appear as read-only on the UI. However if the user needs they can break this strong reference relation, and turn a Reference Test Step to an simple copy later on by editing it. (See below...) Creating Reference or Copy Test StepsAs mentioned earlier the on the Test Case editor page users can drag-and-drop Test Steps from other Test Cases. Once dropped the user can choose if the system creates a Copy or a Reference of the original. This screenshot illustrates that:
Or use the "Add Steps!" button on the right panel which will add all Steps of the selected Test Case into the edited Test Case. The rules are:
Management of Reference Test StepsWhen doing a simple "Copy" of a Test Step is not very different from creating a new one and just typing in the text manually: there won't be any restriction later on how the Test Step behaves, and the "Action" and "Expected Result" will be always editable by the user. On the other hand an Reference Test Step behaves differently:
Navigating between the Reference and Referenced Test StepsTo identify the Reference Test Steps these will appear with a light yellow background color showing here. This can also be recognized by the up-right arrow icon. The link next to the icon shows the target/Referenced Test Case, and clicking on it will open a new window and scroll to the target Test Step (and highlights and focuses that Step too...). This makes it easy to jump to the target Test Step.
When user is viewing or editing a Test Case with Test Steps which are Referenced/Reused by other Test Steps then the UI will highlight those target Steps using light blue background color . The screenshot below shows that:
Such Reused/Referenced Test Cases will appear as:
As there might be multiple references into a Test Step there might be multiple links listed here. By clicking on each link the UI will open the downstream/Referring Test Case in a new window, hightlight and focus to the step which is referencing. So the links between the source/Reference and target/Reused Test Steps makes it easy to see where and how each Test Case is being reused or referenced. Tracing Test Step referencesThe TestCase "A".TestStep1->TestCase "B".TestStep reuse references are stored in an "derived" associaton between the TestCase "A" and "B" - thes association(s) are "automatically" maintained (added/removed/updated) by the TestCase editor when such a TestCase is changed. This is how such an association looks like:
You can "trace" these associations in the Traceability browser. All you need to do is to uncheck the "Do not show related items" checkbox. Like this:
Editing Reference Test StepsWhen working with Reference Test Steps the following rules apply: Editing Referring Test StepsThe Test Step which refers/reuses other Test Step (source side) can not be edited. This happens because such Test Steps are just live references of other Test Steps. The UI will show a warning and controls are always read-only. However if the user wants to modify this Test Step he can break the reference, and then the editing will be possible. The UI will show the "Break Reference" button for breaking the reference. After pressing that the Test Step will be editable and after save the reference-connection will be finally broken. While editing the Test Step the user can change his mind and reset/rebuild the original reference using the "Reset Reference" button. This only works until the first save.
Editing Referenced Test StepsWhen editing a Test Case with Referenced Test Steps these target Steps are editable, however the UI will warn the user about that these changes will affect other Test Cases too ! So when user starts to edit a reused Test Step this warning appears:
When user tries to save an Test Case with such modifications also a second warning appears:
When deleting a reused Test Step also a warning appears. Deleting reused Test Steps means:
Missing References and Error handling in Test RunnerWhile codeBeamer tries to maintain the references between the Referencing Test Steps it may happen that some of these references becoming are broken. This can happen if:
In both cases the Test Case editor and view pages will show a warning about this fact. This can be corrected by editing the Test Case or correcting the permissions. However if such error happens during a Test Run then the Test Runner UI will show an error message about this. Because such Test Case definition is considered invalid the Test Runner will automatically mark all Test Steps as blocked and will force a "blocked" outcome of the Test Case. This can be corrected after fixing the Test Case and by rerunning the broken Test Cases.
How the broken Test Cases appear in Test Runner:
Test Case librariesTest Case libraries is a tool to help to manage Step-reuses between TestCases. When editing a TestCase the Test Case libraries will appear on the right side of the editor: and it will contain those Test Cases from those Trackers which are marked by the user previously as Test Case libraries. So practically if you want you can store those TestCases which are part of your "library" for reuse in one/few selected Trackers and pick only those TestCases from there ! It looks like this:
Reusable Test CasesReusable Test Case is a tool to improve the re-usability and maintainability but reduce the redundancy between Test Cases in projects. A user is able to define as many Reusable Test Cases as they want. A new field is added to Test Cases called Reusable, which is used to be able to distinguish the Reusable Test Cases from normal Test Cases. When editing any Test Case the user can mark a Test Case as Reusable by setting the Reusable field to true. An example:
Finding and filtering for any "Reusable" Test Cases is easy by using a special filter option, which appears above the Test Case and Any Reusable Test Cases is indicated by the a down-arrow next to the Test Case's name (see mark #2 on screenshot below).
Adding Reusable Test Cases support to legacy TrackersIf you're upgrading from older codeBeamer versions (before 7.8) you can still add support of Reusable Test Cases to your existing Test Case Trackers. For that go and customize Test Case tracker(s) and add a new Boolean custom field named "Reusable".
Detecting and automatically converting Test Step duplicates to Step-reusesA new feature is available since CB version 10: which can automatically find duplicated Steps and convert them to Step-Reuses. This feature can be used in two cases:
Converting Test Step Duplicates during importThe importer will scan the imported Test-Cases for duplicated Steps and will automatically create Step-Reuses between the duplicated Steps. This feature can be turned off or configured on the importer GUI-wizard like this: The rules for the creation of Step-reuse is:
Converting Test Step Duplicates using REST APIUsing For more information about the parameters of this REST call please check the Swagger editor for this functionality by opening this url in your codeBeamer instance: http://localhost:8080/cb/v2/swagger/editor.spr#/Test%20Case/autoApplyStepReuses
Reusing Pre- and Post-ActionsAs of codebeamer 21.04 (Dorothy), the Test Case edit functionality has been extended with reuseable Pre- and Post-Actions. As of this version, there is a tabbed selector that you can use to switch between Test Steps, Pre-Action and Post-Action reuse. The new Pre-Action and Post-Action tabs (depending on your permissions) preview the given field of the selected test case. Click on the "Add field!" button to reuse the selected field in the test case you are editing.
Alternatively, you can also drag & drop test cases from the test case selector to the highlighted area of the Pre-Action and Post-Action fields.
Once you click "Add field!" or drop a test case to a field, a popup appears with the available reuse options.
Pre-/Post-Action reuse via CopySelecting "Copy" on the "Add field!" overlay simply copies the content from the respective Pre- or Post-Action field of the selected Test Case ("source field") over to the related field of the test case being edited ("target field").
In case target field is not empty at the time of the copy, codebeamer offers you to either Overwrite or Append the field with the content of the source field.
Opting for Append adds the content of the source field to the end of the target field, while Overwrite simply replaces the content of the target field with that of the source field.
Reference Test CaseSelecting the "Use it as reference" option on the Pre-/Post-Action reuse overlay creates a reference from edited test case to the referred one in scope of the given Pre- or Post-Action field. codebeamer uses this reference to keep the content of the target field in sync with the source field as the source changes. Once the test case is saved, the reuse reference is visible on tracker item details screen of both the referring and the referred test case.
This functionality also makes the target field read only, as it is meant to always reflects the content of the source field. The reference to a reused field can be broken anytime using the "Break Reference" button, which makes the field editable again.
Pre-/Post-Action reuse via Global StereotypeYou can also use
Selecting "Reuse via stereotype" adds a [<<pre-action>>|ISSUE:12345] markup to the target field with the item ID of the source item, thus making it easier to reference global stereotypes. In case the target field is not empty when applying this reuse, it prompts the same Overwrite/Append options as in case of a simple copy. |
Fast Links
![]() codebeamer Overview codebeamer Knowledge Base Services by Intland Software |
This website stores cookies on your computer. These cookies are used to improve your browsing experience, constantly optimize the functionality and content of our website, and help us understand your interests and provide more personalized services to you, both on this website and through other media. With your permission, we and our partners may use precise geolocation data and identification through device scanning. You may click accept to consent to our and our partners’ processing as described above. Please be aware that some processing of your personal data may not require your consent, but you have a right to object to such processing. By using our website, you acknowledge this notice of our cookie practices. By accepting and continuing to browse this site, you agree to this use. Your preferences will apply to this website only.
Note that user-behavior analytics are being captured on this server to improve the Codebeamer user experience.