fix(UI 自动化): ui 报告集合图片兼容v2.1版本
This commit is contained in:
parent
7474a12661
commit
cc1d7ca5ab
|
@ -298,8 +298,7 @@ public class ApiScenarioReportStructureService {
|
||||||
RequestResult result = new RequestResultExpandDTO(reportResult);
|
RequestResult result = new RequestResultExpandDTO(reportResult);
|
||||||
if (reportResult.getContent() != null) {
|
if (reportResult.getContent() != null) {
|
||||||
if (reportType.startsWith(SystemConstants.TestTypeEnum.UI.name())) {
|
if (reportType.startsWith(SystemConstants.TestTypeEnum.UI.name())) {
|
||||||
result = JSON.parseObject(new String(reportResults.get(i).getContent(), StandardCharsets.UTF_8), UiCommandResult.class);
|
result = getUIRequestResult(reportResults, i, result);
|
||||||
((UiCommandResult)result).calTime();
|
|
||||||
} else {
|
} else {
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
@ -398,6 +397,25 @@ public class ApiScenarioReportStructureService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ui 的报告内容不进行懒加载,统一从 content 中取,由于 v2.1 中合并图片存在 baseInfo
|
||||||
|
* 这里做一个兼容处理
|
||||||
|
*
|
||||||
|
* @param reportResults
|
||||||
|
* @param i
|
||||||
|
* @param result
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private RequestResult getUIRequestResult(List<ApiScenarioReportResultWithBLOBs> reportResults, int i, RequestResult result) {
|
||||||
|
String combinationImg = ((RequestResultExpandDTO) result).getCombinationImg();
|
||||||
|
result = JSON.parseObject(new String(reportResults.get(i).getContent(), StandardCharsets.UTF_8), UiCommandResult.class);
|
||||||
|
((UiCommandResult) result).calTime();
|
||||||
|
if (StringUtils.isNotBlank(combinationImg)) {
|
||||||
|
((UiCommandResult) result).setCombinationImg(combinationImg);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 循环步骤请求从新排序
|
* 循环步骤请求从新排序
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue