From 2bcd6c50896cb76d23e840818a65b705ed083b15 Mon Sep 17 00:00:00 2001 From: zhangdahai112 Date: Thu, 24 Nov 2022 12:06:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=A1=E9=AA=8C=E6=B5=8B=E8=AF=95=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E6=98=AF=E5=90=A6=E6=9C=89=E5=8F=AF=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1020120 --user=张大海 【UI测试】禁用本地执行资源池-测试计划-只关联了UI用例-执行计划提示“请选择资源池” https://www.tapd.cn/55049933/s/1303312 --- .../metersphere/controller/TestPlanController.java | 7 ++++++- .../io/metersphere/plan/service/TestPlanService.java | 12 +++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) 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("; "); } }