fix(接口测试): 修复场景调试初次上传csv文件提示不存在问题

--bug=1010383 --user=赵勇 【接口自动化】首次成功上传csv文件,点击调试,提示‘csv文件不存在’ https://www.tapd.cn/55049933/s/1105607
This commit is contained in:
fit2-zhao 2022-02-18 11:13:13 +08:00 committed by 刘瑞斌
parent 845cd97e00
commit 053dfa3bd9
2 changed files with 5 additions and 2 deletions

View File

@ -316,6 +316,8 @@ public class ApiScenarioExecuteService {
} }
HashTree hashTree = null; HashTree hashTree = null;
try { try {
uploadBodyFiles(request.getBodyFileRequestIds(), bodyFiles);
FileUtils.createBodyFiles(request.getScenarioFileIds(), scenarioFiles);
this.testElement(request); this.testElement(request);
hashTree = request.getTestElement().generateHashTree(config); hashTree = request.getTestElement().generateHashTree(config);
LogUtil.info(request.getTestElement().getJmx(hashTree)); LogUtil.info(request.getTestElement().getJmx(hashTree));
@ -350,8 +352,6 @@ public class ApiScenarioExecuteService {
} }
apiScenarioReportMapper.insert(report); apiScenarioReportMapper.insert(report);
} }
uploadBodyFiles(request.getBodyFileRequestIds(), bodyFiles);
FileUtils.createBodyFiles(request.getScenarioFileIds(), scenarioFiles);
String runMode = StringUtils.isEmpty(request.getRunMode()) ? ApiRunMode.SCENARIO.name() : request.getRunMode(); String runMode = StringUtils.isEmpty(request.getRunMode()) ? ApiRunMode.SCENARIO.name() : request.getRunMode();
// 调用执行方法 // 调用执行方法
JmeterRunRequestDTO runRequest = new JmeterRunRequestDTO(request.getId(), request.getId(), runMode, hashTree); JmeterRunRequestDTO runRequest = new JmeterRunRequestDTO(request.getId(), request.getId(), runMode, hashTree);

View File

@ -75,6 +75,9 @@ export default {
scenarioId: this.runData.id, testElement: testPlan, projectId: getCurrentProjectID(), environmentMap: strMapToObj(map), scenarioId: this.runData.id, testElement: testPlan, projectId: getCurrentProjectID(), environmentMap: strMapToObj(map),
environmentType: this.environmentType, environmentGroupId: this.environmentGroupId, environmentJson: JSON.stringify(strMapToObj(map)) environmentType: this.environmentType, environmentGroupId: this.environmentGroupId, environmentJson: JSON.stringify(strMapToObj(map))
}; };
if (this.runData.variables) {
reqObj.variables = this.runData.variables;
}
this.$emit('runRefresh', {}); this.$emit('runRefresh', {});
saveScenario('/api/automation/run/debug', reqObj, this.runData.hashTree, this, (response) => { saveScenario('/api/automation/run/debug', reqObj, this.runData.hashTree, this, (response) => {
this.runId = response.data; this.runId = response.data;