我需要根据我在运行时动态从应用程序获取的标志跳过运行方案,该标志告知是否启用了要测试的功能。我不想抛出任何异常。
示例代码:
if (JIRA_Integration.equalsIgnoreCase("yes")) {
status = zapi.getTestExecutionStatusInJIRA(scenario.getName());
if(status.equalsIgnoreCase("pass")){
isScenarioAlreadyExecuted = true;
}else {
isScenarioAlreadyExecuted = false;
}
} else {
logger.info("Currently JIRA_Integration is disabled, enable it to update test scenario execution status in JIRA");
}
}
if(isScenarioAlreadyExecuted){
logger.info("Scenario: \"" + scenario.getName() + "\" is already passed in the previous test cycle");
throw new AssumptionViolatedException("Scenario: \"" + scenario.getName() + "\" is already passed in the previous test cycle");
}