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);