fix(接口测试): 修复场景报告导出时误报信息为空的缺陷
--bug=1014516 --user=王孝刚 【接口测试】场景报告-查看详情-导出报告,中间的步骤统计没有误报 https://www.tapd.cn/55049933/s/1193718
This commit is contained in:
parent
7533d68578
commit
67b8b664ae
|
@ -280,6 +280,7 @@ public class ApiScenarioReportStructureService {
|
||||||
result = JSON.parseObject(new String(reportResults.get(i).getContent(), StandardCharsets.UTF_8), RequestResult.class);
|
result = JSON.parseObject(new String(reportResults.get(i).getContent(), StandardCharsets.UTF_8), RequestResult.class);
|
||||||
}
|
}
|
||||||
step.setValue(result);
|
step.setValue(result);
|
||||||
|
step.setTotalStatus(reportResult.getStatus());
|
||||||
step.setErrorCode(reportResults.get(i).getErrorCode());
|
step.setErrorCode(reportResults.get(i).getErrorCode());
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
dtoList.add(step);
|
dtoList.add(step);
|
||||||
|
@ -296,7 +297,7 @@ public class ApiScenarioReportStructureService {
|
||||||
dto.setValue(new RequestResultExpandDTO(dto.getLabel(), ExecuteResult.API_SUCCESS.getValue()));
|
dto.setValue(new RequestResultExpandDTO(dto.getLabel(), ExecuteResult.API_SUCCESS.getValue()));
|
||||||
} else if (dto.getValue() instanceof RequestResultExpandDTO && StringUtils.isNotEmpty(((RequestResultExpandDTO) dto.getValue()).getStatus())) {
|
} else if (dto.getValue() instanceof RequestResultExpandDTO && StringUtils.isNotEmpty(((RequestResultExpandDTO) dto.getValue()).getStatus())) {
|
||||||
dto.setTotalStatus(((RequestResultExpandDTO) dto.getValue()).getStatus());
|
dto.setTotalStatus(((RequestResultExpandDTO) dto.getValue()).getStatus());
|
||||||
} else if (dto.getValue() != null) {
|
} else if (dto.getValue() != null && StringUtils.isEmpty(dto.getTotalStatus())) {
|
||||||
if (dto.getValue().getError() > 0 || BooleanUtils.isNotTrue(dto.getValue().isSuccess())) {
|
if (dto.getValue().getError() > 0 || BooleanUtils.isNotTrue(dto.getValue().isSuccess())) {
|
||||||
dto.setTotalStatus(ExecuteResult.FAIL.getValue());
|
dto.setTotalStatus(ExecuteResult.FAIL.getValue());
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue