From 053dfa3bd9b4a3aa182b08198a4e9e0db86c49c1 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Fri, 18 Feb 2022 11:13:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=BA=E6=99=AF=E8=B0=83=E8=AF=95=E5=88=9D?= =?UTF-8?q?=E6=AC=A1=E4=B8=8A=E4=BC=A0csv=E6=96=87=E4=BB=B6=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E5=AD=98=E5=9C=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1010383 --user=赵勇 【接口自动化】首次成功上传csv文件,点击调试,提示‘csv文件不存在’ https://www.tapd.cn/55049933/s/1105607 --- .../api/exec/scenario/ApiScenarioExecuteService.java | 4 ++-- .../business/components/api/automation/scenario/DebugRun.vue | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java b/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java index 31ae197225..5166af453d 100644 --- a/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java +++ b/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java @@ -316,6 +316,8 @@ public class ApiScenarioExecuteService { } HashTree hashTree = null; try { + uploadBodyFiles(request.getBodyFileRequestIds(), bodyFiles); + FileUtils.createBodyFiles(request.getScenarioFileIds(), scenarioFiles); this.testElement(request); hashTree = request.getTestElement().generateHashTree(config); LogUtil.info(request.getTestElement().getJmx(hashTree)); @@ -350,8 +352,6 @@ public class ApiScenarioExecuteService { } apiScenarioReportMapper.insert(report); } - uploadBodyFiles(request.getBodyFileRequestIds(), bodyFiles); - FileUtils.createBodyFiles(request.getScenarioFileIds(), scenarioFiles); String runMode = StringUtils.isEmpty(request.getRunMode()) ? ApiRunMode.SCENARIO.name() : request.getRunMode(); // 调用执行方法 JmeterRunRequestDTO runRequest = new JmeterRunRequestDTO(request.getId(), request.getId(), runMode, hashTree); diff --git a/frontend/src/business/components/api/automation/scenario/DebugRun.vue b/frontend/src/business/components/api/automation/scenario/DebugRun.vue index a87b2f5e61..16c6920187 100644 --- a/frontend/src/business/components/api/automation/scenario/DebugRun.vue +++ b/frontend/src/business/components/api/automation/scenario/DebugRun.vue @@ -75,6 +75,9 @@ export default { scenarioId: this.runData.id, testElement: testPlan, projectId: getCurrentProjectID(), environmentMap: 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', {}); saveScenario('/api/automation/run/debug', reqObj, this.runData.hashTree, this, (response) => { this.runId = response.data;