fix(接口定义): 修复有未执行的场景步骤统计错误的缺陷

--bug=1015368 --user=王孝刚 【接口测试】有未执行步骤时,场景报告统计的请求数量不对
https://www.tapd.cn/55049933/s/1212160
This commit is contained in:
wxg0103 2022-07-26 15:55:29 +08:00 committed by f2c-ci-robot[bot]
parent b965e053db
commit a201289f78
1 changed files with 3 additions and 8 deletions

View File

@ -412,8 +412,10 @@ public class ApiScenarioReportStructureService {
List<StepTreeDTO> list = dtoList.stream().filter(e -> e.getValue() != null && e.getValue().getStartTime() != 0).collect(Collectors.toList());
list = list.stream().sorted(Comparator.comparing(x -> x.getValue().getStartTime())).collect(Collectors.toList());
unList = unList.stream().sorted(Comparator.comparing(x -> x.getIndex())).collect(Collectors.toList());
unList.addAll(steps);
List<StepTreeDTO> mergeList = unList.stream().distinct().collect(Collectors.toList());
// 处理请求结果开始时间为0的数据
for (StepTreeDTO unListDTO : unList) {
for (StepTreeDTO unListDTO : mergeList) {
int index = unListDTO.getIndex();
if (index > 0) {
list.add(index - 1, unListDTO);
@ -422,13 +424,6 @@ public class ApiScenarioReportStructureService {
for (int index = 0; index < list.size(); index++) {
list.get(index).setIndex((index + 1));
}
// 处理步骤为空的数据
for (StepTreeDTO step : steps) {
int index = step.getIndex();
if (index > 0) {
list.add(index - 1, step);
}
}
dtoList.clear();
dtoList.addAll(list);
} catch (Exception e) {