From dbf4f07935fdfab13211da5182e1a7fe26b0351d Mon Sep 17 00:00:00 2001 From: zhangdahai112 Date: Wed, 21 Sep 2022 20:35:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(UI=E8=87=AA=E5=8A=A8=E5=8C=96):=20=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E8=AE=A1=E5=88=92UI=E6=8A=A5=E5=91=8A=E6=9C=AA?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E5=AE=8C=E6=AF=95=E4=B8=8D=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E5=A4=B1=E8=B4=A5=E5=81=9C=E6=AD=A2?= =?UTF-8?q?=E5=8F=91=E9=80=81=E6=B6=88=E6=81=AF=E7=BB=9F=E8=AE=A1=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1016930 --user=张大海 【项目设置】消息通知,接口用例、场景、UI用例未执行数量显示错误,UI成功失败数量显示错误 https://www.tapd.cn/55049933/s/1248555 --bug=1016819 --user=张大海 【测试跟踪】测试计划里有UI用例,不过没执行,测试计划报告里就没显示UI用例 https://www.tapd.cn/55049933/s/1249382 --- .../api/service/ApiExecutionQueueService.java | 15 +++++++++++---- .../api/service/ApiScenarioReportService.java | 2 +- .../comonents/report/detail/TestPlanUiReport.vue | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) 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 91b0bc03d8..5b30ecdb85 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiExecutionQueueService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiExecutionQueueService.java @@ -24,6 +24,7 @@ import io.metersphere.commons.utils.BeanUtils; import io.metersphere.commons.utils.CommonBeanFactory; import io.metersphere.commons.utils.LogUtil; import io.metersphere.constants.RunModeConstants; +import io.metersphere.constants.SystemConstants; import io.metersphere.dto.ResultDTO; import io.metersphere.dto.RunModeConfigDTO; import io.metersphere.track.service.TestPlanReportService; @@ -222,9 +223,15 @@ public class ApiExecutionQueueService { } } } else { - ApiDefinitionExecResult result = apiDefinitionExecResultMapper.selectByPrimaryKey(executionQueue.getCompletedReportId()); - if (result != null && StringUtils.equalsIgnoreCase(result.getStatus(), "Error")) { - isError = true; + if (StringUtils.startsWith(executionQueue.getRunMode(), SystemConstants.TestTypeEnum.UI.name())) { + //UI 失败停止 + isError = ApiScenarioReportService.getUiErrorSize(dto) > 0; + } else { + + ApiDefinitionExecResult result = apiDefinitionExecResultMapper.selectByPrimaryKey(executionQueue.getCompletedReportId()); + if (result != null && StringUtils.equalsIgnoreCase(result.getStatus(), "Error")) { + isError = true; + } } } if (isError) { @@ -232,7 +239,7 @@ public class ApiExecutionQueueService { example.createCriteria().andQueueIdEqualTo(dto.getQueueId()); if (StringUtils.isNotEmpty(dto.getTestPlanReportId())) { - CommonBeanFactory.getBean(TestPlanReportService.class).finishedTestPlanReport(dto.getTestPlanReportId(), "Stopped"); + this.testPlanReportTestEnded(dto.getTestPlanReportId()); } // 更新未执行的报告状态 List details = executionQueueDetailMapper.selectByExample(example); 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 fc01ba54c6..088a466246 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java @@ -988,7 +988,7 @@ public class ApiScenarioReportService { * @param dto * @return */ - private long getUiErrorSize(ResultDTO dto) { + public static long getUiErrorSize(ResultDTO dto) { int errorSize = 0; int successSize = 0; try { diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanUiReport.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanUiReport.vue index cf053c253a..5feabd5812 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanUiReport.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanUiReport.vue @@ -21,7 +21,7 @@