refactor(UI自动化): 失败重试日志打印优化

This commit is contained in:
zhangdahai112 2022-09-16 18:40:37 +08:00 committed by f2c-ci-robot[bot]
parent da140013c2
commit ec07e6f5e1
1 changed files with 6 additions and 0 deletions

View File

@ -987,6 +987,7 @@ public class ApiScenarioReportService {
*/ */
private long getUiErrorSize(ResultDTO dto) { private long getUiErrorSize(ResultDTO dto) {
int errorSize = 0; int errorSize = 0;
int successSize = 0;
try { try {
boolean success; boolean success;
String processType; String processType;
@ -1007,12 +1008,17 @@ public class ApiScenarioReportService {
cmdName = Optional.ofNullable(stepResult.getString("cmdName")).orElse(""); cmdName = Optional.ofNullable(stepResult.getString("cmdName")).orElse("");
if (!success && (StringUtils.equalsIgnoreCase("MAIN", processType) || cmdName.startsWith("verify") || cmdName.startsWith("assert"))) { if (!success && (StringUtils.equalsIgnoreCase("MAIN", processType) || cmdName.startsWith("verify") || cmdName.startsWith("assert"))) {
errorSize++; errorSize++;
} else {
successSize++;
} }
} }
} }
} catch (Exception e) { } catch (Exception e) {
errorSize = 1; errorSize = 1;
} }
if (successSize == 0 && errorSize == 0) {
return 1;
}
return errorSize; return errorSize;
} }