fix(接口测试): 修复用例集成报告中未执行报告的筛选错误问题

修复用例集成报告中未执行报告的筛选错误问题
This commit is contained in:
song-tianyang 2022-03-23 14:47:19 +08:00 committed by CountryBuilder
parent d01b9b37be
commit 8c1ac043ba
1 changed files with 3 additions and 1 deletions

View File

@ -401,7 +401,9 @@ public class ApiScenarioReportStructureService {
if (expandDTO.getAttachInfoMap() != null && expandDTO.getAttachInfoMap().get("errorReportResult") != null) { if (expandDTO.getAttachInfoMap() != null && expandDTO.getAttachInfoMap().get("errorReportResult") != null) {
treeDTO.setErrorCode(expandDTO.getAttachInfoMap().get("errorReportResult")); treeDTO.setErrorCode(expandDTO.getAttachInfoMap().get("errorReportResult"));
treeDTO.setTotalStatus("errorCode"); treeDTO.setTotalStatus("errorCode");
vo.setStatus("errorReportResult");
} else if (StringUtils.isNotEmpty(expandDTO.getStatus())) { } else if (StringUtils.isNotEmpty(expandDTO.getStatus())) {
vo.setStatus(expandDTO.getStatus());
treeDTO.setTotalStatus(expandDTO.getStatus()); treeDTO.setTotalStatus(expandDTO.getStatus());
} else { } else {
if (expandDTO.isSuccess()) { if (expandDTO.isSuccess()) {
@ -426,7 +428,7 @@ public class ApiScenarioReportStructureService {
if (CollectionUtils.isNotEmpty(reportResults)) { if (CollectionUtils.isNotEmpty(reportResults)) {
reportDTO.setTotal(reportResults.size()); reportDTO.setTotal(reportResults.size());
reportDTO.setError(reportResults.stream().filter(e -> StringUtils.equalsAnyIgnoreCase(e.getStatus(), "Error")).collect(Collectors.toList()).size()); reportDTO.setError(reportResults.stream().filter(e -> StringUtils.equalsAnyIgnoreCase(e.getStatus(), "Error")).collect(Collectors.toList()).size());
reportDTO.setUnExecute(reportResults.stream().filter(e -> StringUtils.equalsAnyIgnoreCase(e.getStatus(), "STOP")).collect(Collectors.toList()).size()); reportDTO.setUnExecute(reportResults.stream().filter(e -> StringUtils.equalsAnyIgnoreCase(e.getStatus(), "STOP","unexecute")).collect(Collectors.toList()).size());
reportDTO.setErrorCode(reportResults.stream().filter(e -> StringUtils.equalsAnyIgnoreCase(e.getStatus(), "errorReportResult")).collect(Collectors.toList()).size()); reportDTO.setErrorCode(reportResults.stream().filter(e -> StringUtils.equalsAnyIgnoreCase(e.getStatus(), "errorReportResult")).collect(Collectors.toList()).size());
reportDTO.setPassAssertions(reportResults.stream().mapToLong(ApiDefinitionExecResultVo::getPassAssertions).sum()); reportDTO.setPassAssertions(reportResults.stream().mapToLong(ApiDefinitionExecResultVo::getPassAssertions).sum());
reportDTO.setTotalAssertions(reportResults.stream().mapToLong(ApiDefinitionExecResultVo::getTotalAssertions).sum()); reportDTO.setTotalAssertions(reportResults.stream().mapToLong(ApiDefinitionExecResultVo::getTotalAssertions).sum());