mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-02 12:09:13 +08:00
fix(接口测试): 修复场景变量参数值为空的时候执行报错的缺陷
--bug=1027469 --user=王孝刚 【接口测试】场景详情-场景变量值为空-未引用场景变量-调试场景报错 https://www.tapd.cn/55049933/s/1388281
This commit is contained in:
parent
fd72714a7b
commit
17238af777
@ -738,7 +738,8 @@ public class ElementUtil {
|
||||
variables.stream()
|
||||
.filter(ScenarioVariable::isConstantValid).forEach(keyValue ->
|
||||
arguments.addArgument(keyValue.getName(),
|
||||
keyValue.getValue().replaceAll("[\r\n]",""), "="));
|
||||
StringUtils.isNotBlank(keyValue.getValue())
|
||||
? keyValue.getValue().replaceAll("[\r\n]","") : keyValue.getValue(), "="));
|
||||
List<ScenarioVariable> variableList = variables.stream()
|
||||
.filter(ScenarioVariable::isListValid).collect(Collectors.toList());
|
||||
variableList.forEach(item -> {
|
||||
@ -761,7 +762,9 @@ public class ElementUtil {
|
||||
arguments.addArgument(keyValue.getName(),
|
||||
keyValue.getValue() != null && keyValue.getValue().startsWith("@")
|
||||
? ScriptEngineUtils.buildFunctionCallString(keyValue.getValue())
|
||||
: keyValue.getValue().replaceAll("[\r\n]",""), "="));
|
||||
: (StringUtils.isNotBlank(keyValue.getValue())
|
||||
? keyValue.getValue().replaceAll("[\r\n]","")
|
||||
: keyValue.getValue()), "="));
|
||||
// List类型的变量
|
||||
List<ScenarioVariable> variableList = config.getConfig().get(projectId).getCommonConfig().getVariables().stream()
|
||||
.filter(ScenarioVariable::isListValid)
|
||||
|
Loading…
Reference in New Issue
Block a user