fix(接口自动化): 修复由 失败继续 这个功能引起不能执行的问题。

This commit is contained in:
fit2-zhao 2021-06-17 16:09:44 +08:00 committed by fit2-zhao
parent c2157e48d9
commit e01e140df1
3 changed files with 5 additions and 2 deletions

View File

@ -785,6 +785,7 @@ public class ApiAutomationService {
group.setLabel(item.getName());
group.setName(reportId);
MsScenario scenario = JSONObject.parseObject(item.getScenarioDefinition(), MsScenario.class);
group.setOnSampleError(scenario.isOnSampleError());
this.preduceMsScenario(scenario);
if (planEnvMap.size() > 0) {
scenario.setEnvironmentMap(planEnvMap);
@ -828,6 +829,7 @@ public class ApiAutomationService {
group.setLabel(apiScenario.getName());
group.setName(apiScenario.getName());
group.setEnableCookieShare(scenario.isEnableCookieShare());
group.setOnSampleError(scenario.isOnSampleError());
group.setHashTree(new LinkedList<MsTestElement>() {{
this.add(scenario);
}});
@ -1066,6 +1068,7 @@ public class ApiAutomationService {
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
JSONObject element = JSON.parseObject(item.getScenarioDefinition());
MsScenario scenario = JSONObject.parseObject(item.getScenarioDefinition(), MsScenario.class);
group.setOnSampleError(scenario.isOnSampleError());
this.preduceMsScenario(scenario);
// 多态JSON普通转换会丢失内容需要通过 ObjectMapper 获取
if (element != null && StringUtils.isNotEmpty(element.getString("hashTree"))) {

View File

@ -658,7 +658,7 @@ public class ApiTestCaseService {
MsThreadGroup group = new MsThreadGroup();
group.setLabel(testCaseWithBLOBs.getName());
group.setName(testCaseWithBLOBs.getId());
group.setOnSampleError(true);
LinkedList<MsTestElement> hashTrees = new LinkedList<>();
hashTrees.add(element);
group.setHashTree(hashTrees);

View File

@ -969,7 +969,7 @@ public class TestPlanService {
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
JSONObject element = JSON.parseObject(item.getScenarioDefinition());
MsScenario scenario = JSONObject.parseObject(item.getScenarioDefinition(), MsScenario.class);
group.setOnSampleError(scenario.isOnSampleError());
// 多态JSON普通转换会丢失内容需要通过 ObjectMapper 获取
if (element != null && StringUtils.isNotEmpty(element.getString("hashTree"))) {
LinkedList<MsTestElement> elements = mapper.readValue(element.getString("hashTree"),