refactor(接口测试): 场景变量机制优化,当所有优先规则不选时,默认过程变量优先
This commit is contained in:
parent
230a3b3c2c
commit
e5fb2ad237
|
@ -127,8 +127,7 @@ public class MsScenario extends MsTestElement {
|
|||
// 这里加入自定义变量解决ForEach循环控制器取值问题,循环控制器无法从vars中取值
|
||||
if (BooleanUtils.isTrue(this.variableEnable) || BooleanUtils.isTrue(this.mixEnable)) {
|
||||
scenarioTree.add(ElementUtil.argumentsToUserParameters(valueSupposeMock));
|
||||
} else if (config != null
|
||||
&& (StringUtils.equals(this.getId(), config.getScenarioId()) || config.isApi())) {
|
||||
} else if (config != null && (this.isAllEnable() || config.isApi())) {
|
||||
scenarioTree.add(valueSupposeMock);
|
||||
}
|
||||
}
|
||||
|
@ -166,6 +165,11 @@ public class MsScenario extends MsTestElement {
|
|||
this.setGlobProcessor(this.isEnvironmentEnable() ? newConfig : config, scenarioTree, false);
|
||||
}
|
||||
|
||||
private boolean isAllEnable() {
|
||||
return (this.variableEnable == null || BooleanUtils.isFalse(this.variableEnable))
|
||||
&& (this.mixEnable == null || BooleanUtils.isFalse(this.mixEnable));
|
||||
}
|
||||
|
||||
private void setGlobProcessor(ParameterConfig config, HashTree scenarioTree, boolean isPre) {
|
||||
if (config.getConfig() != null && (this.variableEnable == null || this.variableEnable)) {
|
||||
config.getConfig().forEach((k, environmentConfig) -> {
|
||||
|
|
Loading…
Reference in New Issue