I have a feature file that has both scenario and scenario outline. I am trying to integrate the karate test with Zephyr and update the test status based on the tag value. This works fine with Scenario as it has only one tag associated. But, when it comes to scenario outline as below, I am unable to fetch the correct tag for each run. Please note that, I am trying to update the test status in Zephyr in afterScenario, which will be called after each scenario.
@TestCaseKey=T123,T124,T125
Scenario Outline: Add two numbers <num1> & <num2>
Given I have a calculator
When I add <num1> and <num2>
Then the result should be <total>
Examples:
| num1 | num2 | total |
| -2 | 3 | 1 |
| 10 | 15 | 25 |
| 99 | -99 | 0 |
`* configure afterScenario =
"""
function() {
var info = karate.info;
karate.log(info);
var tagVal = karate.tagValues.TestCaseKey;
var status = (info.errorMessage) ? 'Fail':'Pass';
karate.call ('classpath:Package/Update_Zephyr.feature', {testCaseKey:tagVal, statusName:status});
}
"""`
I would like to fetch the correct tag to run the correct scenario. for eg, for tag value T123, execute | -2 | 3| for tag value T124, execute | 10 | 15 |