fix(UI自动化): 失败重试增加grid是否启动判断防止死循环

This commit is contained in:
zhangdahai112 2022-09-16 01:31:13 +08:00 committed by f2c-ci-robot[bot]
parent 1f1b96fb52
commit bf4aa4e8c8
1 changed files with 16 additions and 14 deletions

View File

@ -992,20 +992,22 @@ public class ApiScenarioReportService {
*/ */
private long getUiErrorSize(ResultDTO dto) { private long getUiErrorSize(ResultDTO dto) {
int errorSize = 0; int errorSize = 0;
boolean success = false; boolean success;
String processType = null; String processType;
String cmdName = null; String cmdName;
for (RequestResult r : dto.getRequestResults()) { RequestResult r = null;
if (StringUtils.isNotEmpty(r.getResponseResult().getHeaders())) { if (CollectionUtils.isNotEmpty(dto.getRequestResults())) {
JSONArray responseArr = JSONArray.parseArray(r.getResponseResult().getHeaders()); r = dto.getRequestResults().get(dto.getRequestResults().size() - 1);
for (int i = 0; i < responseArr.size(); i++) { }
JSONObject stepResult = responseArr.getJSONObject(i); if (StringUtils.isNotEmpty(r.getResponseResult().getHeaders())) {
success = Optional.ofNullable(stepResult.getBoolean("success")).orElse(Boolean.FALSE); JSONArray responseArr = JSONArray.parseArray(r.getResponseResult().getHeaders());
processType = Optional.ofNullable(stepResult.getString("processType")).orElse(""); for (int i = 0; i < responseArr.size(); i++) {
cmdName = Optional.ofNullable(stepResult.getString("cmdName")).orElse(""); JSONObject stepResult = responseArr.getJSONObject(i);
if (!success && (StringUtils.equalsIgnoreCase("MAIN", processType) || cmdName.startsWith("verify") || cmdName.startsWith("assert"))) { success = Optional.ofNullable(stepResult.getBoolean("success")).orElse(Boolean.FALSE);
errorSize++; processType = Optional.ofNullable(stepResult.getString("processType")).orElse("");
} cmdName = Optional.ofNullable(stepResult.getString("cmdName")).orElse("");
if (!success && (StringUtils.equalsIgnoreCase("MAIN", processType) || cmdName.startsWith("verify") || cmdName.startsWith("assert"))) {
errorSize++;
} }
} }
} }