fix(接口测试): 检查并赋值测试报告查询方法参数中的必填项
--bug=1015725 --user=宋天阳 【接口测试】接口测试报告-全选接口报告-批量删除,会把场景报告也都删掉,全选场景报告也是 https://www.tapd.cn/55049933/s/1221535
This commit is contained in:
parent
bc7e9571a7
commit
214b5e5503
|
@ -578,6 +578,7 @@ public class ApiAutomationService {
|
|||
List<String> ids = list.stream().map(ApiScenarioReport::getId).collect(Collectors.toList());
|
||||
APIReportBatchRequest reportRequest = new APIReportBatchRequest();
|
||||
reportRequest.setIds(ids);
|
||||
reportRequest.setCaseType(ReportTypeConstants.SCENARIO.name());
|
||||
apiReportService.deleteAPIReportBatch(reportRequest);
|
||||
}
|
||||
|
||||
|
|
|
@ -183,6 +183,10 @@ public class ApiScenarioReportService {
|
|||
request = this.initRequest(request);
|
||||
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
|
||||
//检查必填参数caseType
|
||||
if (request.getIsUi()) {
|
||||
//ui报告对应的用例类型也是scenario
|
||||
request.setCaseType(ReportTypeConstants.SCENARIO.name());
|
||||
}
|
||||
if (StringUtils.equalsAny(request.getCaseType(), ReportTypeConstants.API.name(), ReportTypeConstants.SCENARIO.name())) {
|
||||
return extApiScenarioReportMapper.idList(request);
|
||||
} else {
|
||||
|
@ -605,6 +609,7 @@ public class ApiScenarioReportService {
|
|||
APIReportBatchRequest reportRequest = new APIReportBatchRequest();
|
||||
reportRequest.setIsUi(request.getIsUi());
|
||||
reportRequest.setIds(list);
|
||||
reportRequest.setCaseType(ReportTypeConstants.SCENARIO.name());
|
||||
this.deleteAPIReportBatch(reportRequest);
|
||||
}
|
||||
}
|
||||
|
@ -653,19 +658,12 @@ public class ApiScenarioReportService {
|
|||
}
|
||||
|
||||
public void deleteAPIReportBatch(APIReportBatchRequest reportRequest) {
|
||||
if (reportRequest.getIsUi()) {
|
||||
//ui报告对应的用例类型也是scenario
|
||||
reportRequest.setCaseType(ReportTypeConstants.SCENARIO.name());
|
||||
}
|
||||
if (StringUtils.isNotBlank(reportRequest.getCaseType())) {
|
||||
List<String> ids = getIdsByDeleteBatchRequest(reportRequest);
|
||||
ids = batchDeleteReportResource(reportRequest, ids, true);
|
||||
|
||||
//处理报告关联数据
|
||||
if (!ids.isEmpty()) {
|
||||
deleteScenarioReportByIds(ids);
|
||||
deleteApiDefinitionResultByIds(ids);
|
||||
}
|
||||
List<String> ids = getIdsByDeleteBatchRequest(reportRequest);
|
||||
ids = batchDeleteReportResource(reportRequest, ids, true);
|
||||
//处理报告关联数据
|
||||
if (!ids.isEmpty()) {
|
||||
deleteScenarioReportByIds(ids);
|
||||
deleteApiDefinitionResultByIds(ids);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -904,12 +902,19 @@ public class ApiScenarioReportService {
|
|||
|
||||
public void cleanUpReport(long time, String projectId) {
|
||||
List<String> ids = extApiScenarioReportMapper.selectByProjectIdAndLessThanTime(projectId, time);
|
||||
List<String> definitionExecIds = extApiDefinitionExecResultMapper.selectByProjectIdAndLessThanTime(projectId, time);
|
||||
ids.addAll(definitionExecIds);
|
||||
if (CollectionUtils.isNotEmpty(ids)) {
|
||||
APIReportBatchRequest request = new APIReportBatchRequest();
|
||||
request.setIds(ids);
|
||||
request.setSelectAllDate(false);
|
||||
request.setCaseType(ReportTypeConstants.SCENARIO.name());
|
||||
deleteAPIReportBatch(request);
|
||||
}
|
||||
List<String> definitionExecIds = extApiDefinitionExecResultMapper.selectByProjectIdAndLessThanTime(projectId, time);
|
||||
if (CollectionUtils.isNotEmpty(definitionExecIds)) {
|
||||
APIReportBatchRequest request = new APIReportBatchRequest();
|
||||
request.setIds(definitionExecIds);
|
||||
request.setSelectAllDate(false);
|
||||
request.setCaseType(ReportTypeConstants.API.name());
|
||||
deleteAPIReportBatch(request);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue