From 997be02950771f3b447cafd697aedbe9f3943e50 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 24 Dec 2020 17:51:53 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96):=20=E4=BF=AE=E5=A4=8D=E5=9C=BA=E6=99=AF=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/dto/definition/request/MsScenario.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java index db3cbf8834..b70b2f703a 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java @@ -84,7 +84,7 @@ public class MsScenario extends MsTestElement { } // εœΊζ™―ε˜ι‡ if (CollectionUtils.isNotEmpty(this.getVariables())) { - tree.add(arguments()); + tree.add(arguments(config)); } if (CollectionUtils.isNotEmpty(hashTree)) { @@ -95,7 +95,7 @@ public class MsScenario extends MsTestElement { } - private Arguments arguments() { + private Arguments arguments(ParameterConfig config) { Arguments arguments = new Arguments(); arguments.setEnabled(true); arguments.setName(name + "Variables"); @@ -104,7 +104,12 @@ public class MsScenario extends MsTestElement { variables.stream().filter(KeyValue::isValid).filter(KeyValue::isEnable).forEach(keyValue -> arguments.addArgument(keyValue.getName(), keyValue.getValue(), "=") ); + if (config != null && config.getConfig() != null && config.getConfig().getCommonConfig() != null + && CollectionUtils.isNotEmpty(config.getConfig().getCommonConfig().getVariables())) { + config.getConfig().getCommonConfig().getVariables().stream().filter(KeyValue::isValid).filter(KeyValue::isEnable).forEach(keyValue -> + arguments.addArgument(keyValue.getName(), keyValue.getValue(), "=") + ); + } return arguments; } - }