fix(测试跟踪): 导入场景全局环境变量失效问题
【【测试跟踪】github#34733,重新导入场景,全局前置脚本不执行】 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001050667
This commit is contained in:
parent
2cc45e88cb
commit
c0660e8827
|
@ -166,8 +166,7 @@ public class MsScenario extends MsTestElement {
|
|||
&& (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)) {
|
||||
private void setConfig(ParameterConfig config, HashTree scenarioTree, boolean isPre) {
|
||||
config.getConfig().forEach((k, environmentConfig) -> {
|
||||
if (environmentConfig != null) {
|
||||
EnvJSR223Processor envProcessor = isPre ? environmentConfig.getPreStepProcessor() : environmentConfig.getPostStepProcessor();
|
||||
|
@ -190,6 +189,16 @@ public class MsScenario extends MsTestElement {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void setGlobProcessor(ParameterConfig config, HashTree scenarioTree, boolean isPre) {
|
||||
if (config.getConfig() != null) {
|
||||
if (StringUtils.equals(this.getId(), config.getScenarioId())) {
|
||||
setConfig(config, scenarioTree, isPre);
|
||||
} else if (this.variableEnable == null || this.variableEnable) {
|
||||
setConfig(config, scenarioTree, isPre);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private boolean setRefScenario(List<MsTestElement> hashTree) {
|
||||
|
@ -222,7 +231,7 @@ public class MsScenario extends MsTestElement {
|
|||
return false;
|
||||
}
|
||||
|
||||
private void setNewConfig( ParameterConfig newConfig) {
|
||||
private void setNewConfig(ParameterConfig newConfig) {
|
||||
Map<String, EnvironmentConfig> envConfig = new HashMap<>();
|
||||
if (this.isEnvironmentEnable()) {
|
||||
ApiScenarioMapper apiScenarioMapper = CommonBeanFactory.getBean(ApiScenarioMapper.class);
|
||||
|
|
Loading…
Reference in New Issue