空手道:无法在场景步骤中使用 'eval'

karate: failed to use 'eval' in scenario step

我需要在场景中调用一个.feature文件,但不关心结果。所以我像这样使用 eval:

eval if (gw == 'YES') karate.call('GatewayAuth.feature', authInfo)

但它表明:

"step 'eval if .....' doesn't have a glue code".

如果我使用:

def result = (gw == 'YES' ? karate.call('GatewayAuth.feature', authInfo) : null)

该步骤工作正常。

步骤使用有什么问题eval

很确定您使用的是旧版空手道。 eval 是在 0.7.0

中引入的