diff --git a/backend/src/main/java/io/metersphere/api/controller/APITestController.java b/backend/src/main/java/io/metersphere/api/controller/APITestController.java index 032ce87665..83a35bc70a 100644 --- a/backend/src/main/java/io/metersphere/api/controller/APITestController.java +++ b/backend/src/main/java/io/metersphere/api/controller/APITestController.java @@ -242,6 +242,8 @@ public class APITestController { for (ExecuteResultCountDTO execResult : apiCaseExecResultList) { if (StringUtils.isEmpty(execResult.getExecResult())) { unexecuteCount += execResult.getCount(); + } else if (StringUtils.equalsAnyIgnoreCase(execResult.getExecResult(), "Underway", ExecuteResult.TEST_PLAN_PREPARE.toString())) { + unexecuteCount += execResult.getCount(); } else if (StringUtils.equalsIgnoreCase(execResult.getExecResult(), ExecuteResult.API_SUCCESS.toString())) { executionPassCount += execResult.getCount(); } else if (StringUtils.equalsAnyIgnoreCase(execResult.getExecResult(), ExecuteResult.ERROR_REPORT_RESULT.toString(), ExecuteResult.ERROR_REPORT.toString())) { diff --git a/backend/src/main/java/io/metersphere/api/dto/datacount/response/ApiDataCountDTO.java b/backend/src/main/java/io/metersphere/api/dto/datacount/response/ApiDataCountDTO.java index 41c37f622d..f47eff9743 100644 --- a/backend/src/main/java/io/metersphere/api/dto/datacount/response/ApiDataCountDTO.java +++ b/backend/src/main/java/io/metersphere/api/dto/datacount/response/ApiDataCountDTO.java @@ -184,7 +184,7 @@ public class ApiDataCountDTO { public void countRunResult(List countResultByRunResult) { for (ApiDataCountResult countResult : countResultByRunResult) { - if ("notRun".equals(countResult.getGroupField())) { + if (StringUtils.equalsAnyIgnoreCase(countResult.getGroupField(), "notRun", "unexecute")) { this.unexecuteCount += countResult.getCountNumber(); } else if ("Fail".equals(countResult.getGroupField())) { this.executionFailedCount += countResult.getCountNumber(); diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml index 71c2c31efa..57793fb6f1 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml @@ -277,7 +277,7 @@ and (api_scenario.status is null or api_scenario.status != 'Trash') - and api_scenario.last_result IS NULL + and (api_scenario.last_result IS NULL or api_scenario.last_result = 'unexecute') and api_scenario.last_result = 'Fail' diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml index 13acf35ae0..848f3b4a52 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml @@ -429,7 +429,7 @@ - and (t1.status IS NULL or t1.status = '') + and (t1.status IS NULL or t1.status = '' or t1.status = 'Prepare' or t1.status = 'Underway') and t1.status = 'success'