fix(接口测试): 修复场景测试生成报告步骤顺序不正确的缺陷

--bug=1010641 --user=王孝刚 【接口自动化】github#11021-场景-测试生成报告步骤顺序不正确
https://www.tapd.cn/55049933/s/1110783
This commit is contained in:
wxg0103 2022-02-28 15:35:15 +08:00 committed by 刘瑞斌
parent 82ba1b944a
commit 14247811ce
1 changed files with 2 additions and 4 deletions

View File

@ -245,9 +245,7 @@ public class ApiScenarioReportStructureService {
if (StringUtils.isNotEmpty(dto.getType()) && requests.contains(dto.getType()) && dto.getValue() == null) {
RequestResultExpandDTO requestResultExpandDTO = new RequestResultExpandDTO();
requestResultExpandDTO.setStatus("unexecute");
if (StringUtils.equalsAnyIgnoreCase(dto.getType(), "AbstractSampler")) {
requestResultExpandDTO.setSuccess(true);
}
requestResultExpandDTO.setName(dto.getLabel());
dto.setValue(requestResultExpandDTO);
}
@ -270,7 +268,7 @@ public class ApiScenarioReportStructureService {
}
// 循环步骤请求从新排序
if (dtoList.stream().filter(e -> e.getValue() != null).collect(Collectors.toList()).size() == dtoList.size()) {
List<StepTreeDTO> list = dtoList.stream().sorted(Comparator.comparing(x -> x.getValue().getStartTime())).collect(Collectors.toList());
List<StepTreeDTO> list = dtoList.stream().sorted(Comparator.comparing(x -> x.getAllIndex())).collect(Collectors.toList());
for (int index = 0; index < list.size(); index++) {
list.get(index).setIndex((index + 1));
}