From c89260ce864b6c16078faf939f3f0bada66c9315 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Mon, 27 Dec 2021 17:38:16 +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=BE=AA=E7=8E=AF=E6=8E=A7=E5=88=B6=E5=99=A8?= =?UTF-8?q?=E5=8D=95=E7=8B=AC=E6=89=A7=E8=A1=8C=E6=94=B6=E4=B8=8D=E5=88=B0?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/definition/RunDefinitionRequest.java | 2 + .../scenario/ApiScenarioExecuteService.java | 4 +- .../api/automation/scenario/DebugRun.vue | 3 +- .../scenario/component/ApiComponent.vue | 16 +-- .../scenario/component/LoopController.vue | 132 +++++------------- 5 files changed, 47 insertions(+), 110 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/RunDefinitionRequest.java b/backend/src/main/java/io/metersphere/api/dto/definition/RunDefinitionRequest.java index 8ca56e0aaa..786e6f5c0a 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/RunDefinitionRequest.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/RunDefinitionRequest.java @@ -14,6 +14,8 @@ public class RunDefinitionRequest { private String reportId; + private String runMode; + private boolean isDebug; private boolean saved; 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 f993372ce8..754fdc7e45 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 @@ -374,9 +374,9 @@ public class ApiScenarioExecuteService { } 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(), ApiRunMode.SCENARIO.name(), hashTree); + JmeterRunRequestDTO runRequest = new JmeterRunRequestDTO(request.getId(), request.getId(), runMode, hashTree); runRequest.setDebug(true); jMeterService.run(runRequest); return request.getId(); diff --git a/frontend/src/business/components/api/automation/scenario/DebugRun.vue b/frontend/src/business/components/api/automation/scenario/DebugRun.vue index 9954520769..c4e7756604 100644 --- a/frontend/src/business/components/api/automation/scenario/DebugRun.vue +++ b/frontend/src/business/components/api/automation/scenario/DebugRun.vue @@ -12,6 +12,7 @@ export default { components: {}, props: { environment: Map, + runMode: String, debug: Boolean, reportId: String, runData: Object, @@ -69,7 +70,7 @@ export default { testPlan.hashTree.push(threadGroup); this.sort(testPlan.hashTree); let reqObj = { - id: this.reportId, reportId: this.reportId, scenarioName: this.runData.name, saved: this.saved, + id: this.reportId, reportId: this.reportId, scenarioName: this.runData.name, saved: this.saved, runMode: this.runMode, scenarioId: this.runData.id, testElement: testPlan, projectId: getCurrentProjectID(), environmentMap: strMapToObj(map), environmentType: this.environmentType, environmentGroupId: this.environmentGroupId, environmentJson: JSON.stringify(strMapToObj(map)) }; diff --git a/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue b/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue index c8c91768ca..cb26976a4a 100644 --- a/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue @@ -89,16 +89,7 @@