feat(接口测试): 修复测试计划报告一键展开时数据加载不出来的问题

--bug=1012561 --user=宋天阳 【接口测试】测试报告-失败-批量展开步骤,页面加载不出来
https://www.tapd.cn/55049933/s/1145101
This commit is contained in:
song-tianyang 2022-04-24 11:01:34 +08:00 committed by TIanyang
parent 6738044276
commit 76abd781e2
3 changed files with 16 additions and 8 deletions

View File

@ -228,9 +228,9 @@ public class ApiScenarioReportStructureService {
if (CollectionUtils.isNotEmpty(root.getChildren())) {
stepTotal.set((stepTotal.longValue() + root.getChildren().size()));
for (StepTreeDTO step : root.getChildren()) {
if (StringUtils.equalsIgnoreCase(step.getTotalStatus(), "fail")) {
if (StringUtils.equalsAnyIgnoreCase(step.getTotalStatus(), "fail","error")) {
stepError.set(stepError.longValue() + 1);
} else if (StringUtils.equalsIgnoreCase(step.getTotalStatus(), "errorCode")) {
} else if (StringUtils.equalsAnyIgnoreCase(step.getTotalStatus(), "errorCode","errorReportResult")) {
stepErrorCode.set(stepErrorCode.longValue() + 1);
} else if (!StringUtils.equalsIgnoreCase(step.getTotalStatus(), "success")) {
stepUnExecute.set(stepUnExecute.longValue() + 1);
@ -373,6 +373,8 @@ public class ApiScenarioReportStructureService {
}
if (StringUtils.isEmpty(dto.getTotalStatus())) {
dto.setTotalStatus(ExecuteResult.unexecute.name());
}else if(StringUtils.equalsAnyIgnoreCase(dto.getTotalStatus(),"error")){
dto.setTotalStatus("fail");
}
}
// 循环步骤请求从新排序
@ -678,7 +680,12 @@ public class ApiScenarioReportStructureService {
}
public RequestResult selectReportContent(String stepId) {
return selectReportContent(stepId, RequestResult.class);
RequestResult result = new RequestResult();
try {
result = selectReportContent(stepId, RequestResult.class);
}catch (Exception ignore){
}
return result;
}
public <T> T selectReportContent(String stepId, Class clazz) {

View File

@ -213,6 +213,7 @@ export default {
},
watch: {
isActive() {
this.loadRequestInfoExpand();
this.showActive = this.isActive;
},
errorCode() {

View File

@ -62,7 +62,7 @@ export default {
if (!value) return true;
if (data.value) {
if (value === 'errorReport') {
if (data.errorCode && data.errorCode !== "") {
if (data.errorCode && data.errorCode !== "" && data.value.status === "errorReportResult") {
return true;
}
}else if (value === 'unexecute') {
@ -72,7 +72,7 @@ export default {
}else {
if (this.isUi) {
return data.value.success === false && data.value.startTime > 0;
} else if (!data.errorCode || data.errorCode === "") {
} else {
return data.value.error > 0;
}
}
@ -91,7 +91,7 @@ export default {
node.expanded = !node.expanded;
},
//
changeTreeNodeStatus(node) {
changeTreeNodeStatus(node,expandCount) {
node.expanded = this.expandAll
for (let i = 0; i < node.childNodes.length; i++) {
// expanded
@ -105,13 +105,13 @@ export default {
closeExpansion() {
this.isActive = false;
this.expandAll = false;
this.changeTreeNodeStatus(this.$refs.resultsTree.store.root);
this.changeTreeNodeStatus(this.$refs.resultsTree.store.root,0);
},
openExpansion() {
this.isActive = true;
this.expandAll = true;
//
this.changeTreeNodeStatus(this.$refs.resultsTree.store.root)
this.changeTreeNodeStatus(this.$refs.resultsTree.store.root,0)
},
}
}