From 1e0010a0b000bc71dd7350bf6815b1204e26c673 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Wed, 1 Jun 2022 17:22:19 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E6=AC=A1=E6=95=B0=E5=BE=AA=E7=8E=AF=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=99=A8=E6=94=AF=E6=8C=81=E5=8F=98=E9=87=8F=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1013431 --user=赵勇 【接口测试】github#5872循环控制器的次数不支持变量 https://www.tapd.cn/55049933/s/1171792 --- .../io/metersphere/api/dto/automation/parse/MsJmeterParser.java | 2 +- .../api/dto/definition/request/controller/MsLoopController.java | 2 +- .../dto/definition/request/controller/loop/CountController.java | 2 +- .../api/automation/scenario/component/LoopController.vue | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java b/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java index d66e580fcf..c3cae551de 100644 --- a/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java +++ b/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java @@ -793,7 +793,7 @@ public class MsJmeterParser extends ApiImportAbstractParser { ((MsLoopController) elementNode).setLoopType(LoopConstants.LOOP_COUNT.name()); LoopController loopController = (LoopController) key; CountController countController = new CountController(); - countController.setLoops(loopController.getLoops()); + countController.setLoops(String.valueOf(loopController.getLoops())); countController.setProceed(true); ((MsLoopController) elementNode).setCountController(countController); } diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsLoopController.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsLoopController.java index 5fe2118ad1..cfbb7095a5 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsLoopController.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsLoopController.java @@ -135,7 +135,7 @@ public class MsLoopController extends MsTestElement { loopController.setProperty(TestElement.TEST_CLASS, LoopController.class.getName()); loopController.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("LoopControlPanel")); loopController.setLoops(countController.getLoops()); - if (countController.getLoops() > 0) { + if (StringUtils.isNotEmpty(countController.getLoops())) { loopController.setContinueForever(true); } return loopController; diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/loop/CountController.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/loop/CountController.java index 20780ce295..9e97142d89 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/loop/CountController.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/loop/CountController.java @@ -4,7 +4,7 @@ import lombok.Data; @Data public class CountController { - private int loops; + private String loops; private long interval; private boolean proceed; private Object requestResult; diff --git a/frontend/src/business/components/api/automation/scenario/component/LoopController.vue b/frontend/src/business/components/api/automation/scenario/component/LoopController.vue index 3c192a0970..e8f3aac5be 100644 --- a/frontend/src/business/components/api/automation/scenario/component/LoopController.vue +++ b/frontend/src/business/components/api/automation/scenario/component/LoopController.vue @@ -23,7 +23,7 @@ {{ $t('loop.loops') }} - +