fix(测试跟踪): 修复测试试试报告中执行失败的场景用例不显示的问题

--bug=1010005 --user=宋天阳 【测试跟踪】测试计划 - 报告统计,失败用例没显示失败的场景
https://www.tapd.cn/55049933/s/1099026
This commit is contained in:
song-tianyang 2022-01-26 14:50:26 +08:00 committed by xiaomeinvG
parent 493ed748f9
commit 4c0f8d2f94
2 changed files with 5 additions and 2 deletions

View File

@ -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}
<if test="status != null">
<if test="status != null and status != 'Fail'">
and t.last_result = #{status}
</if>
<if test="status == 'Fail'">
and t.last_result in ('Fail','Error')
</if>
where t.test_plan_id = #{planId}
</select>

View File

@ -1571,7 +1571,7 @@ public class TestPlanService {
List<TestPlanFailureScenarioDTO> failureScenarios = new ArrayList<>();
List<TestPlanFailureScenarioDTO> 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);