fix(接口测试): 脚本内容为空则不生成此步骤
--bug=1045251 --user=赵勇 [接口测试] github#32654接口脚本中添加了后置脚本,如果不写内容的话,控制台会报错 https://www.tapd.cn/55049933/s/1576615 Signed-off-by: fit2-zhao <yong.zhao@fit2cloud.com>
This commit is contained in:
parent
bfc17f9eeb
commit
45dc407345
|
@ -33,16 +33,21 @@ public class MsJSR223PostProcessor extends MsTestElement {
|
|||
@Override
|
||||
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, MsParameter msParameter) {
|
||||
ParameterConfig config = (ParameterConfig) msParameter;
|
||||
if (StringUtils.isBlank(this.script)) {
|
||||
return;
|
||||
}
|
||||
// 非导出操作,且不是启用状态则跳过执行
|
||||
if (!config.isOperating() && !this.isEnable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ScriptFilter.verify(this.getScriptLanguage(), this.getName(), script);
|
||||
if (config.isOperating()) {
|
||||
if (StringUtils.isNotEmpty(script) && script.startsWith(JMeterVars.class.getCanonicalName())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// 非导出操作,且不是启用状态则跳过执行
|
||||
if (!config.isOperating() && !this.isEnable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.setEnvironmentId(ElementUtil.getScriptEnv(this.getEnvironmentId(), config, this.getProjectId()));
|
||||
|
||||
TestElement processor = new BeanShellPostProcessor();
|
||||
|
|
|
@ -37,6 +37,11 @@ public class MsJSR223PreProcessor extends MsTestElement {
|
|||
if (!config.isOperating() && !this.isEnable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(this.script)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (config.isOperating()) {
|
||||
if (StringUtils.isNotEmpty(script) && script.startsWith(JMeterVars.class.getCanonicalName())) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue