From cc3bd51d70ae837223b051148fd747a3dcf3798f Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Fri, 10 Jun 2022 13:17:27 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E6=A0=B9=E6=8D=AE=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9E=9A=E4=B8=BE=E5=8F=98=E9=87=8F=E5=90=8D?= =?UTF-8?q?=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根据代码规范优化枚举变量名称 --- .../ApiDefinitionExecResultService.java | 2 +- .../api/service/ApiExecutionQueueService.java | 2 +- .../ApiScenarioReportResultService.java | 4 +-- .../api/service/ApiScenarioReportService.java | 24 ++++++++--------- .../ApiScenarioReportStructureService.java | 16 +++++------ .../commons/constants/ExecuteResult.java | 27 ++++++++++++------- .../commons/utils/ErrorReportLibraryUtil.java | 6 ++--- .../commons/utils/ResponseUtil.java | 8 +++--- .../commons/utils/TestPlanUtils.java | 2 +- .../track/service/TestPlanApiCaseService.java | 2 +- .../track/service/TestPlanReportService.java | 4 +-- .../service/TestPlanScenarioCaseService.java | 4 +-- .../track/service/TestPlanService.java | 4 +-- .../business/components/task/TaskCenter.vue | 4 +-- 14 files changed, 59 insertions(+), 50 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java index d91861208d..7eed6bc54f 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java @@ -444,7 +444,7 @@ public class ApiDefinitionExecResultService { saveResult.setId(reportId); //对响应内容进行进一步解析。如果有附加信息(比如误报库信息),则根据附加信息内的数据进行其他判读 RequestResultExpandDTO expandDTO = ResponseUtil.parseByRequestResult(item); - String status = item.isSuccess() ? ExecuteResult.success.name() : ExecuteResult.error.name(); + String status = item.isSuccess() ? ExecuteResult.API_SUCCESS.toString() : ExecuteResult.API_ERROR.toString(); if (MapUtils.isNotEmpty(expandDTO.getAttachInfoMap())) { if (StringUtils.isNotEmpty(expandDTO.getStatus())) { status = expandDTO.getStatus(); diff --git a/backend/src/main/java/io/metersphere/api/service/ApiExecutionQueueService.java b/backend/src/main/java/io/metersphere/api/service/ApiExecutionQueueService.java index a5af48ffb1..261c54b8b6 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiExecutionQueueService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiExecutionQueueService.java @@ -180,7 +180,7 @@ public class ApiExecutionQueueService { if (StringUtils.contains(dto.getRunMode(), ApiRunMode.SCENARIO.name())) { if (StringUtils.equals(dto.getReportType(), RunModeConstants.SET_REPORT.toString())) { ApiScenarioReportResultExample example = new ApiScenarioReportResultExample(); - example.createCriteria().andReportIdEqualTo(dto.getReportId()).andStatusEqualTo(ExecuteResult.Error.name()); + example.createCriteria().andReportIdEqualTo(dto.getReportId()).andStatusEqualTo(ExecuteResult.SCENARIO_ERROR.toString()); long error = apiScenarioReportResultMapper.countByExample(example); isError = error > 0; } else { diff --git a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportResultService.java b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportResultService.java index d3a64fbecf..43beb26745 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportResultService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportResultService.java @@ -122,11 +122,11 @@ public class ApiScenarioReportResultService { ApiScenarioReportResultWithBLOBs report = newScenarioReportResult(reportId, resourceId); report.setTotalAssertions(Long.parseLong(result.getTotalAssertions() + "")); report.setPassAssertions(Long.parseLong(result.getPassAssertions() + "")); - String status = result.getError() == 0 ? ExecuteResult.Success.name() : ExecuteResult.Error.name(); + String status = result.getError() == 0 ? ExecuteResult.SCENARIO_SUCCESS.toString() : ExecuteResult.SCENARIO_ERROR.toString(); if (CollectionUtils.isNotEmpty(errorCodeDTO.getErrorCodeList())) { report.setErrorCode(errorCodeDTO.getErrorCodeStr()); } - if (StringUtils.equalsIgnoreCase(errorCodeDTO.getRequestStatus(), ExecuteResult.errorReportResult.name())) { + if (StringUtils.equalsIgnoreCase(errorCodeDTO.getRequestStatus(), ExecuteResult.ERROR_REPORT_RESULT.toString())) { status = errorCodeDTO.getRequestStatus(); } report.setStatus(status); diff --git a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java index 81b24a991a..0df3c4d628 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java @@ -374,13 +374,13 @@ public class ApiScenarioReportService { hasUnExecute = true; }else { for (String status : reportStatus) { - if (StringUtils.equalsIgnoreCase(status, ExecuteResult.Error.name())) { + if (StringUtils.equalsIgnoreCase(status, ExecuteResult.SCENARIO_ERROR.toString())) { hasError = true; - } else if (StringUtils.equalsIgnoreCase(status, ExecuteResult.errorReportResult.name())) { + } else if (StringUtils.equalsIgnoreCase(status, ExecuteResult.ERROR_REPORT_RESULT.toString())) { hasErrorReport = true; - } else if (StringUtils.equalsIgnoreCase(status, ExecuteResult.STOP.name())) { + } else if (StringUtils.equalsIgnoreCase(status, ExecuteResult.STOP.toString())) { hasStop = true; - } else if (StringUtils.equalsIgnoreCase(status, ExecuteResult.unexecute.name())) { + } else if (StringUtils.equalsIgnoreCase(status, ExecuteResult.UN_EXECUTE.toString())) { hasUnExecute = true; } else { hasOtherStatus = true; @@ -394,9 +394,9 @@ public class ApiScenarioReportService { } return hasError ? ScenarioStatus.Error.name() : - hasErrorReport ? ExecuteResult.errorReportResult.name() : - hasStop ? ExecuteResult.STOP.name() : - hasUnExecute ? ExecuteResult.unexecute.name() : ScenarioStatus.Success.name(); + hasErrorReport ? ExecuteResult.ERROR_REPORT_RESULT.toString() : + hasStop ? ExecuteResult.STOP.toString() : + hasUnExecute ? ExecuteResult.UN_EXECUTE.toString() : ScenarioStatus.Success.name(); } public void margeReport(String reportId, String runMode, String console) { @@ -447,7 +447,7 @@ public class ApiScenarioReportService { scenario = apiScenarioMapper.selectByPrimaryKey(report.getScenarioId()); } if (scenario != null) { - if (StringUtils.equalsAnyIgnoreCase(status, ExecuteResult.errorReportResult.name())) { + if (StringUtils.equalsAnyIgnoreCase(status, ExecuteResult.ERROR_REPORT_RESULT.toString())) { scenario.setLastResult(status); } else { scenario.setLastResult(errorSize > 0 ? "Fail" : ScenarioStatus.Success.name()); @@ -488,7 +488,7 @@ public class ApiScenarioReportService { scenario = uiScenarioMapper.selectByPrimaryKey(report.getScenarioId()); } if (scenario != null) { - if (StringUtils.equalsAnyIgnoreCase(status, ExecuteResult.errorReportResult.name())) { + if (StringUtils.equalsAnyIgnoreCase(status, ExecuteResult.ERROR_REPORT_RESULT.toString())) { scenario.setLastResult(status); } else { scenario.setLastResult(errorSize > 0 ? "Fail" : ScenarioStatus.Success.name()); @@ -905,7 +905,7 @@ public class ApiScenarioReportService { for (ApiScenarioReportResult result : requestResults) { if (StringUtils.equalsIgnoreCase(result.getStatus(), ScenarioStatus.Error.name())) { errorSize++; - } else if (StringUtils.equalsIgnoreCase(result.getStatus(), ExecuteResult.errorReportResult.name())) { + } else if (StringUtils.equalsIgnoreCase(result.getStatus(), ExecuteResult.ERROR_REPORT_RESULT.toString())) { errorReportResultSize++; } } @@ -913,9 +913,9 @@ public class ApiScenarioReportService { if (errorSize > 0) { status = ScenarioStatus.Error.name(); } else if (errorReportResultSize > 0) { - status = ExecuteResult.errorReportResult.name(); + status = ExecuteResult.ERROR_REPORT_RESULT.toString(); } else { - status = requestResults.isEmpty() ? ExecuteResult.unexecute.name() : ScenarioStatus.Success.name(); + status = requestResults.isEmpty() ? ExecuteResult.UN_EXECUTE.toString() : ScenarioStatus.Success.name(); } if (dto != null && dto.getArbitraryData() != null && dto.getArbitraryData().containsKey("TIMEOUT") && (Boolean) dto.getArbitraryData().get("TIMEOUT")) { 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 492e4fd985..95bb3dd61b 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportStructureService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportStructureService.java @@ -217,7 +217,7 @@ public class ApiScenarioReportStructureService { totalScenario.set(totalScenario.longValue() + 1); if (StringUtils.equalsIgnoreCase(step.getTotalStatus(), "fail")) { scenarioError.set(scenarioError.longValue() + 1); - } else if (StringUtils.equalsAnyIgnoreCase(step.getTotalStatus(), "errorCode", ExecuteResult.errorReportResult.name())) { + } else if (StringUtils.equalsAnyIgnoreCase(step.getTotalStatus(), "errorCode", ExecuteResult.ERROR_REPORT_RESULT.toString())) { errorReport.set(errorReport.longValue() + 1); } else if (!StringUtils.equalsIgnoreCase(step.getTotalStatus(), "success")) { unExecute.set(unExecute.longValue() + 1); @@ -372,7 +372,7 @@ public class ApiScenarioReportStructureService { //当有多个子步骤结果时,如果当前步骤不是场景,则:失败>误报>未执行>成功>未执行; 如果是场景:误报>失败>成功>未执行 if (failCount == 0 && errorReportCount == 0 && successCount == 0) { - dto.setTotalStatus(ExecuteResult.unexecute.name()); + dto.setTotalStatus(ExecuteResult.UN_EXECUTE.toString()); } else if (successCount == dto.getChildren().size() || (successCount > 0 && errorReportCount == 0 && failCount == 0)) { dto.setTotalStatus("success"); } else { @@ -396,7 +396,7 @@ public class ApiScenarioReportStructureService { } } if (StringUtils.isEmpty(dto.getTotalStatus())) { - dto.setTotalStatus(ExecuteResult.unexecute.name()); + dto.setTotalStatus(ExecuteResult.UN_EXECUTE.toString()); } else if (StringUtils.equalsAnyIgnoreCase(dto.getTotalStatus(), "error")) { dto.setTotalStatus("fail"); } @@ -420,7 +420,7 @@ public class ApiScenarioReportStructureService { // 非正常执行结束的请求结果 List unList = dtoList.stream().filter(e -> e.getValue() != null && ((StringUtils.equalsIgnoreCase(e.getType(), "DubboSampler") && e.getValue().getStartTime() == 0) - || StringUtils.equalsIgnoreCase(e.getTotalStatus(), ExecuteResult.unexecute.name()))) + || StringUtils.equalsIgnoreCase(e.getTotalStatus(), ExecuteResult.UN_EXECUTE.toString()))) .collect(Collectors.toList()); // 有效数据按照时间排序 @@ -487,7 +487,7 @@ public class ApiScenarioReportStructureService { } if (vo.getRequestResult() == null) { RequestResultExpandDTO requestResultExpandDTO = new RequestResultExpandDTO(); - requestResultExpandDTO.setStatus(ExecuteResult.unexecute.name()); + requestResultExpandDTO.setStatus(ExecuteResult.UN_EXECUTE.toString()); requestResultExpandDTO.setName(item.getName()); vo.setRequestResult(requestResultExpandDTO); } @@ -524,7 +524,7 @@ public class ApiScenarioReportStructureService { if (CollectionUtils.isNotEmpty(reportResults)) { reportDTO.setTotal(reportResults.size()); reportDTO.setError(reportResults.stream().filter(e -> StringUtils.equalsAnyIgnoreCase(e.getStatus(), "Error")).collect(Collectors.toList()).size()); - reportDTO.setUnExecute(reportResults.stream().filter(e -> StringUtils.equalsAnyIgnoreCase(e.getStatus(), "STOP", ExecuteResult.unexecute.name())).collect(Collectors.toList()).size()); + reportDTO.setUnExecute(reportResults.stream().filter(e -> StringUtils.equalsAnyIgnoreCase(e.getStatus(), "STOP", ExecuteResult.UN_EXECUTE.toString())).collect(Collectors.toList()).size()); reportDTO.setErrorCode(reportResults.stream().filter(e -> StringUtils.equalsAnyIgnoreCase(e.getStatus(), "errorReportResult")).collect(Collectors.toList()).size()); reportDTO.setPassAssertions(reportResults.stream().mapToLong(ApiDefinitionExecResultVo::getPassAssertions).sum()); reportDTO.setTotalAssertions(reportResults.stream().mapToLong(ApiDefinitionExecResultVo::getTotalAssertions).sum()); @@ -606,7 +606,7 @@ public class ApiScenarioReportStructureService { reportDTO.setTotal(reportResults.size()); reportDTO.setError(reportResults.stream().filter(e -> StringUtils.equals(e.getStatus(), "Error")).collect(Collectors.toList()).size()); - reportDTO.setErrorCode(reportResults.stream().filter(e -> StringUtils.equals(e.getStatus(), ExecuteResult.errorReportResult.name())).collect(Collectors.toList()).size()); + reportDTO.setErrorCode(reportResults.stream().filter(e -> StringUtils.equals(e.getStatus(), ExecuteResult.ERROR_REPORT_RESULT.toString())).collect(Collectors.toList()).size()); reportDTO.setPassAssertions(reportResults.stream().mapToLong(ApiScenarioReportResult::getPassAssertions).sum()); reportDTO.setTotalAssertions(reportResults.stream().mapToLong(ApiScenarioReportResult::getTotalAssertions).sum()); @@ -692,7 +692,7 @@ public class ApiScenarioReportStructureService { for (StepTreeDTO step : stepList) { if (step.getValue() != null) { if (step.getValue() instanceof RequestResultExpandDTO - && StringUtils.equalsIgnoreCase(((RequestResultExpandDTO) step.getValue()).getStatus(), ExecuteResult.unexecute.name())) { + && StringUtils.equalsIgnoreCase(((RequestResultExpandDTO) step.getValue()).getStatus(), ExecuteResult.UN_EXECUTE.toString())) { allUnExecute.set(allUnExecute.longValue() + 1); } } diff --git a/backend/src/main/java/io/metersphere/commons/constants/ExecuteResult.java b/backend/src/main/java/io/metersphere/commons/constants/ExecuteResult.java index 95b0f99798..3dd8418706 100644 --- a/backend/src/main/java/io/metersphere/commons/constants/ExecuteResult.java +++ b/backend/src/main/java/io/metersphere/commons/constants/ExecuteResult.java @@ -2,17 +2,26 @@ package io.metersphere.commons.constants; public enum ExecuteResult { //误报状态 - errorReportResult, - + ERROR_REPORT_RESULT("errorReportResult"), + //停止状态 + STOP("STOP"), //接口执行状态(兼容旧数据) - success, error, STOP, - + API_SUCCESS("success"), API_ERROR("error"), //未执行状态 - unexecute, - + UN_EXECUTE("unexecute"), //场景执行状态(兼容旧数据) - Success, Error, - + SCENARIO_SUCCESS("Success"), SCENARIO_ERROR("Error"), //测试计划执行状态(兼容旧数据) - PREPARE, RUNNING, SUCCESS, FAILD + TEST_PLAN_PREPARE("PREPARE"), TEST_PLAN_RUNNING("RUNNING"); + private String value; + + ExecuteResult(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + } diff --git a/backend/src/main/java/io/metersphere/commons/utils/ErrorReportLibraryUtil.java b/backend/src/main/java/io/metersphere/commons/utils/ErrorReportLibraryUtil.java index 71e9253eda..8aa373a4e3 100644 --- a/backend/src/main/java/io/metersphere/commons/utils/ErrorReportLibraryUtil.java +++ b/backend/src/main/java/io/metersphere/commons/utils/ErrorReportLibraryUtil.java @@ -147,12 +147,12 @@ public class ErrorReportLibraryUtil { if(MapUtils.isNotEmpty(errorReportAssertionMap)){ if (MapUtils.isNotEmpty(errorAssertionMap)) { if(higherThanError){ - result.requestStatus = ExecuteResult.errorReportResult.name(); + result.requestStatus = ExecuteResult.ERROR_REPORT_RESULT.toString(); } }else if(higherThanSuccess){ - result.requestStatus = ExecuteResult.errorReportResult.name(); + result.requestStatus = ExecuteResult.ERROR_REPORT_RESULT.toString(); }else if(MapUtils.isEmpty(successAssertionMap)){ - result.requestStatus = ExecuteResult.errorReportResult.name(); + result.requestStatus = ExecuteResult.ERROR_REPORT_RESULT.toString(); } } } diff --git a/backend/src/main/java/io/metersphere/commons/utils/ResponseUtil.java b/backend/src/main/java/io/metersphere/commons/utils/ResponseUtil.java index b076309e2b..f2573806b8 100644 --- a/backend/src/main/java/io/metersphere/commons/utils/ResponseUtil.java +++ b/backend/src/main/java/io/metersphere/commons/utils/ResponseUtil.java @@ -24,13 +24,13 @@ public class ResponseUtil { if (CollectionUtils.isNotEmpty(errorCodeDTO.getErrorCodeList())) { Map expandMap = new HashMap<>(); - expandMap.put(ExecuteResult.errorReportResult.name(), errorCodeDTO.getErrorCodeStr()); - if (StringUtils.equalsIgnoreCase(errorCodeDTO.getRequestStatus(), ExecuteResult.errorReportResult.name())) { - expandMap.put("status", ExecuteResult.errorReportResult.name()); + expandMap.put(ExecuteResult.ERROR_REPORT_RESULT.toString(), errorCodeDTO.getErrorCodeStr()); + if (StringUtils.equalsIgnoreCase(errorCodeDTO.getRequestStatus(), ExecuteResult.ERROR_REPORT_RESULT.toString())) { + expandMap.put("status", ExecuteResult.ERROR_REPORT_RESULT.toString()); } expandDTO.setAttachInfoMap(expandMap); } - if (StringUtils.equalsIgnoreCase(errorCodeDTO.getRequestStatus(), ExecuteResult.errorReportResult.name())) { + if (StringUtils.equalsIgnoreCase(errorCodeDTO.getRequestStatus(), ExecuteResult.ERROR_REPORT_RESULT.toString())) { expandDTO.setStatus(errorCodeDTO.getRequestStatus()); } return expandDTO; diff --git a/backend/src/main/java/io/metersphere/commons/utils/TestPlanUtils.java b/backend/src/main/java/io/metersphere/commons/utils/TestPlanUtils.java index fc396a579d..30b1378d07 100644 --- a/backend/src/main/java/io/metersphere/commons/utils/TestPlanUtils.java +++ b/backend/src/main/java/io/metersphere/commons/utils/TestPlanUtils.java @@ -53,7 +53,7 @@ public class TestPlanUtils { addToReportStatusResultList(resultMap, statusResult, "SUCCESS"); addToReportStatusResultList(resultMap, statusResult, "STOP"); addToReportStatusResultList(resultMap, statusResult, TestPlanTestCaseStatus.Prepare.name()); - addToReportStatusResultList(resultMap, statusResult, ExecuteResult.errorReportResult.name()); + addToReportStatusResultList(resultMap, statusResult, ExecuteResult.ERROR_REPORT_RESULT.toString()); } /** diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanApiCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanApiCaseService.java index 52bf21125c..8ee9b450e0 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanApiCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanApiCaseService.java @@ -456,7 +456,7 @@ public class TestPlanApiCaseService { } public List getErrorReportCases(String planId) { - List apiTestCases = extTestPlanApiCaseMapper.getFailureList(planId, ExecuteResult.errorReportResult.name()); + List apiTestCases = extTestPlanApiCaseMapper.getFailureList(planId, ExecuteResult.ERROR_REPORT_RESULT.toString()); return buildCases(apiTestCases); } diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java index 994ce6be92..6578bfadf0 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java @@ -433,7 +433,7 @@ public class TestPlanReportService { } if (testPlanReport != null) { boolean isSendMessage = false; - if (StringUtils.equalsIgnoreCase(testPlanReport.getStatus(), ExecuteResult.RUNNING.name())) { + if (StringUtils.equalsIgnoreCase(testPlanReport.getStatus(), ExecuteResult.TEST_PLAN_RUNNING.toString())) { isSendMessage = true; } //初始化测试计划包含组件信息 @@ -683,7 +683,7 @@ public class TestPlanReportService { if (sendMessage && testPlan != null && StringUtils.equalsAny(report.getTriggerMode(), ReportTriggerMode.MANUAL.name(), ReportTriggerMode.API.name(), - ReportTriggerMode.SCHEDULE.name()) && !StringUtils.equalsIgnoreCase(report.getStatus(), ExecuteResult.RUNNING.name()) + ReportTriggerMode.SCHEDULE.name()) && !StringUtils.equalsIgnoreCase(report.getStatus(), ExecuteResult.TEST_PLAN_RUNNING.toString()) ) { //发送通知 testPlanMessageService.sendMessage(testPlan, report, testPlan.getProjectId()); diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanScenarioCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanScenarioCaseService.java index a831a3bfb1..dfa8702e9b 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanScenarioCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanScenarioCaseService.java @@ -478,7 +478,7 @@ public class TestPlanScenarioCaseService { List stepResult = new ArrayList<>(); getScenarioCaseReportStatusResultDTO(TestPlanTestCaseStatus.Failure.name(), stepCount.getScenarioStepError(), stepResult); getScenarioCaseReportStatusResultDTO(TestPlanTestCaseStatus.Pass.name(), stepCount.getScenarioStepSuccess(), stepResult); - getScenarioCaseReportStatusResultDTO(ExecuteResult.errorReportResult.name(), stepCount.getScenarioStepErrorReport(), stepResult); + getScenarioCaseReportStatusResultDTO(ExecuteResult.ERROR_REPORT_RESULT.toString(), stepCount.getScenarioStepErrorReport(), stepResult); getScenarioCaseReportStatusResultDTO(TestPlanTestCaseStatus.Underway.name(), stepCount.getScenarioStepTotal() - stepCount.getScenarioStepSuccess() - stepCount.getScenarioStepError() - stepCount.getScenarioStepErrorReport() + underwayStepsCounts, stepResult); apiResult.setApiScenarioData(statusResult); @@ -604,7 +604,7 @@ public class TestPlanScenarioCaseService { public List getErrorReportCases(String planId) { List apiTestCases = - extTestPlanScenarioCaseMapper.getFailureList(planId, ExecuteResult.errorReportResult.name()); + extTestPlanScenarioCaseMapper.getFailureList(planId, ExecuteResult.ERROR_REPORT_RESULT.toString()); return buildCases(apiTestCases); } diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java index b089aa7954..dac7113a3a 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -1617,7 +1617,7 @@ public class TestPlanService { for (TestPlanFailureScenarioDTO scenario : scenarios) { if (StringUtils.equalsAnyIgnoreCase(scenario.getLastResult(), "Fail", "Error")) { failureScenarios.add(scenario); - } else if (StringUtils.equalsIgnoreCase(scenario.getLastResult(), ExecuteResult.errorReportResult.name())) { + } else if (StringUtils.equalsIgnoreCase(scenario.getLastResult(), ExecuteResult.ERROR_REPORT_RESULT.toString())) { errorReportScenarios.add(scenario); } else if (StringUtils.equalsAnyIgnoreCase(scenario.getLastResult(), "stop", "unexecute")) { unExecuteScenarios.add(scenario); @@ -1643,7 +1643,7 @@ public class TestPlanService { for (TestPlanFailureApiDTO apiDTO : apiAllCases) { if (StringUtils.equalsIgnoreCase(apiDTO.getExecResult(), "error")) { apiFailureCases.add(apiDTO); - } else if (StringUtils.equalsIgnoreCase(apiDTO.getExecResult(), ExecuteResult.errorReportResult.name())) { + } else if (StringUtils.equalsIgnoreCase(apiDTO.getExecResult(), ExecuteResult.ERROR_REPORT_RESULT.toString())) { apiErrorReportCases.add(apiDTO); } else if (StringUtils.equalsAnyIgnoreCase(apiDTO.getExecResult(), "stop", "unexecute")) { apiUnExecuteCases.add(apiDTO); diff --git a/frontend/src/business/components/task/TaskCenter.vue b/frontend/src/business/components/task/TaskCenter.vue index a99e9c2df3..f2df30e5a5 100644 --- a/frontend/src/business/components/task/TaskCenter.vue +++ b/frontend/src/business/components/task/TaskCenter.vue @@ -125,7 +125,7 @@ - unexecute + Unexecuted @@ -205,7 +205,7 @@ export default { {id: 'success', label: 'Success'}, {id: 'waiting', label: 'Waiting'}, {id: 'fail', label: 'Fail'}, - {id: 'unexecute', label: 'unexecute'}, + {id: 'unexecute', label: 'Unexecuted'}, {id: 'stop', label: 'Stopped'} ], condition: {triggerMode: "", executionStatus: ""},