This hook lets you create/link a Defect to Test Records based on information specified in the Test Result comments (Verdict). It also lets you adjust the Test Run so that it points to the Head revision of a Test Case if it is edited. (Letting you to modify/add Test Steps to a Test Case during the Test execution.)
This Hook requires the Work Item Action Interceptor Framework (WIAIF) extension to run.
Hook Features
Create/Link a Defect based on a Verdict
This feature lets you create a new Defect (or link to one that already exists) for a Test Record (if Failed) based on the information specified in a Verdict field. (Test Result Comment).
Available options:
- @D:NEW - Creates a new Defect and adds it to a Test Record by linking it to the Test Case using the "triggered_by" link role. (The Defect's Description will contain information about the Test execution: Test Run, Test Case, Executed, Test Steps.)
- @D:U - Updates an already existing Defect (from a previous Test execution) in a Test Case by copying the current Defect Description to a Comment and updating it.
- @D:DEFECT_ID - Adds the information about an already existing Defect to the Test Records and links the Defect to the Test Case (if not already linked). The Test execution information is added as a new Comment. (The Description is not changed).
Adjust Test Run
This feature lets you adjust an existing Test Run so that it points to the Head revision of a Test Case if the Test Case was edited. This lets you modify/add Test Steps to a Test Case during the Test execution.
How to Install
- Copy the test_execution.jar file to WIAIF's "hooks" folder.
- Reload the plugin from the WIAIF Interceptor Management page or restart Polarion.
- Make sure that the configuration of the Polarion Project you are using allows users to link a Defect with a Test Case via the link role with the triggered_by ID.
- Add the hook to the WIAIF Properties file (hook.properties) to define which Polarion Projects, Work Item Types, and Fields should be affected (as comma-separated values):
TestExecutionHook.DEFECT_CREATION_FROM_VERICT_PROJECTS=Project_ID1,Project_ID2,...
TestExecutionHook.TC_REVISION_REPOINTING_PROJECTS=Project_ID1,Project_ID2,...
How to Use
Create/Link Defect based on a Verdict
- Start the Test execution either via the Execute Test button of the Properties panel or with the modern Execution Table.
- (Optional) Mark the Test Step results.
If you are going to fail the execution and need to manage the linked Defect then:
- Before marking the Test Case Verdict as Failed (by saving the execution result), add one of the following tags to the Verdict Comment: @D:NEW, @D:U, @D:DEFECT_ID.
- Save the execution result (while marking it as Failed).
Polarion will either create a new or update/link an existing Defect to the Test Case and the Test execution record according to the tag added to the Comment.
Adjust Test Run
- Start the Test execution either via the Execute Test button of the Properties panel or with the modern Execution Table.
- (Optional) Mark the Test Step results.
If you need to update some of the Test Steps or add new ones:
- Click on Pause Test Case.
- If executed from the Execution Table, open the Test Case's Head revision in a new tab.
- Click on Edit to modify the Test Case.
- Modify the Test Steps or add new ones. (DO NOT delete any steps.)
- Save the Test Case.
- Click on Refresh to reload the Test Case in the Execution Panel.
- Click on Resume to continue with the Test execution.
(Both the added and updated Test Steps are now available to be marked.)