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

This commit is contained in:
wxg0103 2023-04-26 09:57:32 +08:00 committed by fit2-zhao
parent e9e0e54cf1
commit 38cab2f687
5 changed files with 5 additions and 6 deletions

View File

@ -242,7 +242,6 @@ public class ApiTestCaseController {
@PostMapping("/list-execute-res/{goPage}/{pageSize}")
public Pager<List<ApiDefinitionExecResultExpand>> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryAPIReportRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
request.setLimit("LIMIT " + (goPage - 1) * pageSize + "," + pageSize * 50);
return PageUtils.setPageInfo(page, apiDefinitionExecResultService.apiReportList(request));
}

View File

@ -53,7 +53,6 @@ public class ApiScenarioReportController {
@PostMapping("/list/{goPage}/{pageSize}")
public Pager<List<ApiScenarioReportResult>> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryAPIReportRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
request.setLimit("LIMIT " + (goPage - 1) * pageSize + "," + pageSize * 50);
return PageUtils.setPageInfo(page, apiReportService.list(request));
}

View File

@ -400,7 +400,7 @@ public class ApiScenarioReportStructureService {
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());
List<StepTreeDTO> mergeList = unList.stream().distinct().sorted(Comparator.comparing(StepTreeDTO::getIndex)).collect(Collectors.toList());
// 处理请求结果开始时间为0的数据
for (StepTreeDTO unListDTO : mergeList) {
int index = unListDTO.getIndex();

View File

@ -312,9 +312,10 @@ export default {
addTab(tab) {
this.trashEnable = tab.name === 'trash';
if (tab.name === 'default') {
this.$refs.nodeTree.list(this.projectId, tab);
this.$refs.nodeTree.list(this.projectId);
} else if (tab.name === 'trash') {
this.$refs.apiTrashScenarioList.search();
this.$refs.nodeTree.list(this.projectId, tab.name);
}
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
@ -618,7 +619,7 @@ export default {
if (targetName === 'trash') {
this.selectNodeIds = [];
this.trashEnable = false;
this.$refs.nodeTree.list(this.projectId, targetName);
this.$refs.nodeTree.list(this.projectId);
} else {
let message = '';
this.tabs.forEach((tab) => {

View File

@ -200,7 +200,7 @@ export default {
this.result = getModuleByRelevanceProjectId(this.relevanceProjectId).then((response) => {
this.setData(response);
});
} else if (this.isTrashData && !targetName) {
} else if (this.isTrashData && targetName === 'trash') {
this.result = postModuleByTrash(projectId ? projectId : this.projectId, this.param).then((response) => {
this.setData(response);
});