fix(测试跟踪): 修复case列表执行报告页面一直loading的缺陷

--bug=1021859 --user=王孝刚 【测试跟踪】测试计划详情里执行接口用例,状态是stopped的在执行的结果弹框里会一直转圈
https://www.tapd.cn/55049933/s/1326150
This commit is contained in:
wxg0103 2023-01-11 15:11:15 +08:00 committed by wxg0103
parent 87766e3919
commit c7112fbd32
3 changed files with 6 additions and 4 deletions

View File

@ -166,7 +166,7 @@ public class MsDebugListener extends AbstractListenerElement implements SampleLi
transactionResult.getResponseResult().setConsole(console); transactionResult.getResponseResult().setConsole(console);
//对响应内容进行进一步解析和处理 //对响应内容进行进一步解析和处理
RequestResultExpandDTO expandDTO = ResponseUtil.parseByRequestResult(transactionResult); RequestResultExpandDTO expandDTO = ResponseUtil.parseByRequestResult(transactionResult);
if (StringUtils.equals(dto.getRunMode(), ApiRunMode.DEFINITION.name())) { if (StringUtils.equalsAnyIgnoreCase(dto.getRunMode(), ApiRunMode.DEFINITION.name(), ApiRunMode.API_PLAN.name())) {
apiDefinitionEnvService.setEnvAndPoolName(transactionResult, expandDTO); apiDefinitionEnvService.setEnvAndPoolName(transactionResult, expandDTO);
} }
dto.setContent("result_" + JSON.toJSONString(expandDTO)); dto.setContent("result_" + JSON.toJSONString(expandDTO));
@ -176,7 +176,7 @@ public class MsDebugListener extends AbstractListenerElement implements SampleLi
requestResult.getResponseResult().setConsole(console); requestResult.getResponseResult().setConsole(console);
//对响应内容进行进一步解析和处理 //对响应内容进行进一步解析和处理
RequestResultExpandDTO expandDTO = ResponseUtil.parseByRequestResult(requestResult); RequestResultExpandDTO expandDTO = ResponseUtil.parseByRequestResult(requestResult);
if (StringUtils.equals(dto.getRunMode(), ApiRunMode.DEFINITION.name())) { if (StringUtils.equalsAnyIgnoreCase(dto.getRunMode(), ApiRunMode.DEFINITION.name(), ApiRunMode.API_PLAN.name())) {
apiDefinitionEnvService.setEnvAndPoolName(requestResult, expandDTO); apiDefinitionEnvService.setEnvAndPoolName(requestResult, expandDTO);
} }
dto.setContent("result_" + JSON.toJSONString(expandDTO)); dto.setContent("result_" + JSON.toJSONString(expandDTO));

View File

@ -74,7 +74,7 @@ public class MsKafkaListener {
LoggerUtil.info("接收到执行结果:", record.key()); LoggerUtil.info("接收到执行结果:", record.key());
if (ObjectUtils.isNotEmpty(record.value()) && WebSocketUtil.has(record.key().toString())) { if (ObjectUtils.isNotEmpty(record.value()) && WebSocketUtil.has(record.key().toString())) {
MsgDTO dto = JSONUtil.parseObject(record.value(), MsgDTO.class); MsgDTO dto = JSONUtil.parseObject(record.value(), MsgDTO.class);
if (StringUtils.equals(ApiRunMode.DEFINITION.name(), dto.getRunMode()) && dto.getContent().startsWith("result_")) { if (StringUtils.equalsAnyIgnoreCase(dto.getRunMode(), ApiRunMode.DEFINITION.name(), ApiRunMode.API_PLAN.name()) && dto.getContent().startsWith("result_")) {
ApiDefinitionEnvService apiDefinitionEnvService = CommonBeanFactory.getBean(ApiDefinitionEnvService.class); ApiDefinitionEnvService apiDefinitionEnvService = CommonBeanFactory.getBean(ApiDefinitionEnvService.class);
apiDefinitionEnvService.setEnvAndPoolName(dto); apiDefinitionEnvService.setEnvAndPoolName(dto);
} }

View File

@ -593,7 +593,9 @@ export default {
// websock // websock
// websock // websock
this.$refs.apiCaseResult.open(reportId); this.$refs.apiCaseResult.open(reportId);
run(row.id, reportId); setTimeout(() => {
run(row.id, reportId);
}, 3000);
}, },
handleTestEnd(reportId) { handleTestEnd(reportId) {
if (this.runningReport.has(reportId)) { if (this.runningReport.has(reportId)) {