refactor(接口测试): 修复接口测试报告中如果最后出现未执行的步骤在组装报告时会报错的问题

修复接口测试报告中如果最后出现未执行的步骤在组装报告时会报错的问题
This commit is contained in:
song-tianyang 2023-04-02 00:12:10 +08:00 committed by fit2-zhao
parent 60acf8f718
commit 10131cc9a4

View File

@ -401,7 +401,12 @@ public class ApiScenarioReportStructureService {
for (StepTreeDTO unListDTO : mergeList) {
int index = unListDTO.getIndex();
if (index > 0) {
list.add(index - 1, unListDTO);
if (list.size() < (index - 1)) {
list.add(unListDTO);
} else {
list.add(index - 1, unListDTO);
}
}
}
for (int index = 0; index < list.size(); index++) {