fix(接口自动化): 修复由 失败继续 这个功能引起不能执行的问题。
This commit is contained in:
parent
c2157e48d9
commit
e01e140df1
|
@ -785,6 +785,7 @@ public class ApiAutomationService {
|
||||||
group.setLabel(item.getName());
|
group.setLabel(item.getName());
|
||||||
group.setName(reportId);
|
group.setName(reportId);
|
||||||
MsScenario scenario = JSONObject.parseObject(item.getScenarioDefinition(), MsScenario.class);
|
MsScenario scenario = JSONObject.parseObject(item.getScenarioDefinition(), MsScenario.class);
|
||||||
|
group.setOnSampleError(scenario.isOnSampleError());
|
||||||
this.preduceMsScenario(scenario);
|
this.preduceMsScenario(scenario);
|
||||||
if (planEnvMap.size() > 0) {
|
if (planEnvMap.size() > 0) {
|
||||||
scenario.setEnvironmentMap(planEnvMap);
|
scenario.setEnvironmentMap(planEnvMap);
|
||||||
|
@ -828,6 +829,7 @@ public class ApiAutomationService {
|
||||||
group.setLabel(apiScenario.getName());
|
group.setLabel(apiScenario.getName());
|
||||||
group.setName(apiScenario.getName());
|
group.setName(apiScenario.getName());
|
||||||
group.setEnableCookieShare(scenario.isEnableCookieShare());
|
group.setEnableCookieShare(scenario.isEnableCookieShare());
|
||||||
|
group.setOnSampleError(scenario.isOnSampleError());
|
||||||
group.setHashTree(new LinkedList<MsTestElement>() {{
|
group.setHashTree(new LinkedList<MsTestElement>() {{
|
||||||
this.add(scenario);
|
this.add(scenario);
|
||||||
}});
|
}});
|
||||||
|
@ -1066,6 +1068,7 @@ public class ApiAutomationService {
|
||||||
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||||
JSONObject element = JSON.parseObject(item.getScenarioDefinition());
|
JSONObject element = JSON.parseObject(item.getScenarioDefinition());
|
||||||
MsScenario scenario = JSONObject.parseObject(item.getScenarioDefinition(), MsScenario.class);
|
MsScenario scenario = JSONObject.parseObject(item.getScenarioDefinition(), MsScenario.class);
|
||||||
|
group.setOnSampleError(scenario.isOnSampleError());
|
||||||
this.preduceMsScenario(scenario);
|
this.preduceMsScenario(scenario);
|
||||||
// 多态JSON普通转换会丢失内容,需要通过 ObjectMapper 获取
|
// 多态JSON普通转换会丢失内容,需要通过 ObjectMapper 获取
|
||||||
if (element != null && StringUtils.isNotEmpty(element.getString("hashTree"))) {
|
if (element != null && StringUtils.isNotEmpty(element.getString("hashTree"))) {
|
||||||
|
|
|
@ -658,7 +658,7 @@ public class ApiTestCaseService {
|
||||||
MsThreadGroup group = new MsThreadGroup();
|
MsThreadGroup group = new MsThreadGroup();
|
||||||
group.setLabel(testCaseWithBLOBs.getName());
|
group.setLabel(testCaseWithBLOBs.getName());
|
||||||
group.setName(testCaseWithBLOBs.getId());
|
group.setName(testCaseWithBLOBs.getId());
|
||||||
|
group.setOnSampleError(true);
|
||||||
LinkedList<MsTestElement> hashTrees = new LinkedList<>();
|
LinkedList<MsTestElement> hashTrees = new LinkedList<>();
|
||||||
hashTrees.add(element);
|
hashTrees.add(element);
|
||||||
group.setHashTree(hashTrees);
|
group.setHashTree(hashTrees);
|
||||||
|
|
|
@ -969,7 +969,7 @@ public class TestPlanService {
|
||||||
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||||
JSONObject element = JSON.parseObject(item.getScenarioDefinition());
|
JSONObject element = JSON.parseObject(item.getScenarioDefinition());
|
||||||
MsScenario scenario = JSONObject.parseObject(item.getScenarioDefinition(), MsScenario.class);
|
MsScenario scenario = JSONObject.parseObject(item.getScenarioDefinition(), MsScenario.class);
|
||||||
|
group.setOnSampleError(scenario.isOnSampleError());
|
||||||
// 多态JSON普通转换会丢失内容,需要通过 ObjectMapper 获取
|
// 多态JSON普通转换会丢失内容,需要通过 ObjectMapper 获取
|
||||||
if (element != null && StringUtils.isNotEmpty(element.getString("hashTree"))) {
|
if (element != null && StringUtils.isNotEmpty(element.getString("hashTree"))) {
|
||||||
LinkedList<MsTestElement> elements = mapper.readValue(element.getString("hashTree"),
|
LinkedList<MsTestElement> elements = mapper.readValue(element.getString("hashTree"),
|
||||||
|
|
Loading…
Reference in New Issue