diff --git a/test-track/backend/src/main/java/io/metersphere/controller/TestPlanController.java b/test-track/backend/src/main/java/io/metersphere/controller/TestPlanController.java index d4bb1ca2d1..e59184c84c 100644 --- a/test-track/backend/src/main/java/io/metersphere/controller/TestPlanController.java +++ b/test-track/backend/src/main/java/io/metersphere/controller/TestPlanController.java @@ -296,9 +296,14 @@ public class TestPlanController { return schedule; } + /*** + * 只检查是否有API,性能用例 + * @param id + * @return + */ @GetMapping("/have/exec/case/{id}") public boolean haveExecCase(@PathVariable String id) { - return testPlanService.haveExecCase(id); + return testPlanService.haveExecCase(id, true); } /** diff --git a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java index a028ee01d0..7c7c37fbf1 100644 --- a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java +++ b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java @@ -1556,7 +1556,7 @@ public class TestPlanService { public String runPlan(TestPlanRunRequest testplanRunRequest) { //检查测试计划下有没有可以执行的用例; - if (!haveExecCase(testplanRunRequest.getTestPlanId())) { + if (!haveExecCase(testplanRunRequest.getTestPlanId(), false)) { MSException.throwException(Translator.get("plan_warning")); } String envType = testplanRunRequest.getEnvironmentType(); @@ -1626,7 +1626,7 @@ public class TestPlanService { testPlanMapper.updateByPrimaryKeySelective(testPlan); } - public boolean haveExecCase(String planId) { + public boolean haveExecCase(String planId, boolean ignoreUI) { if (StringUtils.isBlank(planId)) { return false; } @@ -1639,6 +1639,12 @@ public class TestPlanService { return true; } + if (!ignoreUI) { + if (planTestPlanUiScenarioCaseService.haveUiCase(planId)) { + return true; + } + } + return planTestPlanLoadCaseService.haveExecCase(planId); } @@ -1781,7 +1787,7 @@ public class TestPlanService { append.append("/"); } } - if (!haveExecCase(planList.get(i).getId())) { + if (!haveExecCase(planList.get(i).getId(), false)) { haveExecCaseBuilder.append(planList.get(i).getName()).append("; "); } }