refactor(接口测试): 场景调试失败后及时恢复调试状态和预加载调试数据

This commit is contained in:
fit2-zhao 2022-06-06 15:29:13 +08:00 committed by f2c-ci-robot[bot]
parent 9becbe564d
commit ca778d44c9
2 changed files with 14 additions and 7 deletions

View File

@ -198,12 +198,17 @@ public class ApiAutomationController {
@PostMapping(value = "/run/debug")
@MsAuditLog(module = OperLogModule.API_AUTOMATION, type = OperLogConstants.DEBUG, title = "#request.scenarioName", sourceId = "#request.scenarioId", project = "#request.projectId")
public void runDebug(@RequestPart("request") RunDefinitionRequest request,
public String runDebug(@RequestPart("request") RunDefinitionRequest request,
@RequestPart(value = "bodyFiles", required = false) List<MultipartFile> bodyFiles, @RequestPart(value = "scenarioFiles", required = false) List<MultipartFile> scenarioFiles) {
try {
if (StringUtils.isEmpty(request.getExecuteType())) {
request.setExecuteType(ExecuteType.Debug.name());
}
apiAutomationService.debugRun(request, bodyFiles, scenarioFiles);
} catch (Exception e) {
return e.getMessage();
}
return "SUCCESS";
}
@PostMapping(value = "/run")

View File

@ -26,7 +26,6 @@ export default {
return {
result: {},
loading: false,
runId: "",
reqNumber: 0,
}
},
@ -87,7 +86,10 @@ export default {
url = '/ui/automation/run/debug';
}
saveScenario(url, reqObj, this.runData.hashTree, this, (response) => {
this.runId = response.data;
if(response.data !== "SUCCESS"){
this.$error(response.data ? response.data : this.$t('commons.run_fail'));
this.$emit('errorRefresh');
}
});
},
}