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 95c91d1468..ea51280cdd 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportStructureService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportStructureService.java @@ -141,21 +141,24 @@ public class ApiScenarioReportStructureService { } private void scenarioCalculate(List dtoList, AtomicLong isError, AtomicLong isErrorReport) { + /** + * 判断场景步骤的执行状态 + * 失败状态的优先级最高,其次是误报 + */ for (StepTreeDTO step : dtoList) { if (step.getValue() != null) { - if (StringUtils.isNotEmpty(step.getErrorCode())) { - isErrorReport.set(isErrorReport.longValue() + 1); - } else if (step.getValue().getError() > 0 || !step.getValue().isSuccess()) { + if (step.getValue().getError() > 0 || !step.getValue().isSuccess()) { isError.set(isError.longValue() + 1); + } else if (StringUtils.isNotEmpty(step.getErrorCode())) { + isErrorReport.set(isErrorReport.longValue() + 1); } } else if (CollectionUtils.isNotEmpty(step.getChildren())) { AtomicLong isChildrenError = new AtomicLong(); AtomicLong isChildrenErrorReport = new AtomicLong(); - stepChildrenErrorCalculate(step.getChildren(), isChildrenError,isChildrenErrorReport); + stepChildrenErrorCalculate(step.getChildren(), isChildrenError, isChildrenErrorReport); if (isChildrenError.longValue() > 0) { isError.set(isError.longValue() + 1); - } - if(isChildrenErrorReport.longValue() > 0){ + } else if (isChildrenErrorReport.longValue() > 0) { isErrorReport.set(isErrorReport.longValue() + 1); } } @@ -309,12 +312,11 @@ public class ApiScenarioReportStructureService { private void stepChildrenErrorCalculate(List dtoList, AtomicLong isError, AtomicLong isErrorReport) { for (StepTreeDTO step : dtoList) { if (step.getValue() != null && step.getValue().getError() > 0) { - if (StringUtils.isNotEmpty(step.getErrorCode())) { - isErrorReport.set(isErrorReport.longValue() + 1); - } else if (step.getValue().getError() > 0 || !step.getValue().isSuccess()) { + if (step.getValue().getError() > 0 || !step.getValue().isSuccess()) { isError.set(isError.longValue() + 1); + } else if (StringUtils.isNotEmpty(step.getErrorCode())) { + isErrorReport.set(isErrorReport.longValue() + 1); } - break; } else if (CollectionUtils.isNotEmpty(step.getChildren())) { stepChildrenErrorCalculate(step.getChildren(), isError, isErrorReport); } diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue index 8aa4e7bf07..2f941f7c46 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue @@ -203,6 +203,7 @@ export default { resultMap: new Map([ ['success', this.$t('test_track.plan_view.execute_result') + ':' + this.$t('test_track.plan_view.pass')], ['error', this.$t('test_track.plan_view.execute_result') + ':' + this.$t('api_test.home_page.detail_card.execution_failed')], + ['errorReportResult', this.$t('test_track.plan_view.execute_result') + ':' + this.$t('error_report_library.option.name')], ['default', this.$t('test_track.plan_view.execute_result') + ':' + this.$t('api_test.home_page.detail_card.unexecute')] ]), isXpack: false, diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index b8d7a91300..fc88eec584 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit b8d7a91300b411662a3492b08a7ec88b29a05c3d +Subproject commit fc88eec58494a51c04dbc39ee1c7b956f1e16a12