diff --git a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportStructureService.java b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportStructureService.java index 5c9a8a4fca..b1d30b5356 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportStructureService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportStructureService.java @@ -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 selectReportContent(String stepId, Class clazz) { diff --git a/frontend/src/business/components/api/automation/report/components/RequestResult.vue b/frontend/src/business/components/api/automation/report/components/RequestResult.vue index b641896427..1a90b32590 100644 --- a/frontend/src/business/components/api/automation/report/components/RequestResult.vue +++ b/frontend/src/business/components/api/automation/report/components/RequestResult.vue @@ -213,6 +213,7 @@ export default { }, watch: { isActive() { + this.loadRequestInfoExpand(); this.showActive = this.isActive; }, errorCode() { diff --git a/frontend/src/business/components/api/automation/report/components/ScenarioResults.vue b/frontend/src/business/components/api/automation/report/components/ScenarioResults.vue index e81ca4c94b..6e4e11442b 100644 --- a/frontend/src/business/components/api/automation/report/components/ScenarioResults.vue +++ b/frontend/src/business/components/api/automation/report/components/ScenarioResults.vue @@ -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) }, } }