首页 文章

空手道:在场景步骤中未能使用'eval'

提问于
浏览
3

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

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

但它表明:

“step'eval如果.....'没有胶水代码” .

如果我使用:

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

这一步很好 .

步骤使用 eval 有什么问题?

1 回答

  • 1

    很确定你是旧版的空手道 . eval 在0.7.0中引入

相关问题