From 4c0f8d2f94fcbd74a791979eb3dd9c2873bb3cfa Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Wed, 26 Jan 2022 14:50:26 +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=E5=A4=8D=E6=B5=8B=E8=AF=95=E8=AF=95=E8=AF=95=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E4=B8=AD=E6=89=A7=E8=A1=8C=E5=A4=B1=E8=B4=A5=E7=9A=84?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E7=94=A8=E4=BE=8B=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1010005 --user=宋天阳 【测试跟踪】测试计划 - 报告统计,失败用例没显示失败的场景 https://www.tapd.cn/55049933/s/1099026 --- .../base/mapper/ext/ExtTestPlanScenarioCaseMapper.xml | 5 ++++- .../java/io/metersphere/track/service/TestPlanService.java | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.xml index ebdf307a69..d880c58ad8 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.xml @@ -248,9 +248,12 @@ api_scenario c on t.api_scenario_id = c.id and (c.status != 'Trash' or c.status is null) and t.test_plan_id = #{planId} - + and t.last_result = #{status} + + and t.last_result in ('Fail','Error') + where t.test_plan_id = #{planId} 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 115ede53b2..90690813b5 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -1571,7 +1571,7 @@ public class TestPlanService { List failureScenarios = new ArrayList<>(); List errorReportScenarios = new ArrayList<>(); for (TestPlanFailureScenarioDTO scenario : scenarios) { - if (StringUtils.equalsIgnoreCase(scenario.getLastResult(), "Fail")) { + if (StringUtils.equalsAnyIgnoreCase(scenario.getLastResult(), "Fail", "Error")) { failureScenarios.add(scenario); } else if (StringUtils.equalsIgnoreCase(scenario.getLastResult(), ExecuteResult.errorReportResult.name())) { errorReportScenarios.add(scenario);