空手道:无法在方案步骤中使用“评估" [英] karate: failed to use 'eval' in scenario step

查看:31
本文介绍了空手道:无法在方案步骤中使用“评估"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这种情况下,我需要调用.feature文件,但不在乎结果.所以我用这样的eval:

I need to call a .feature file in the scenario but don't care about the result. So I used eval like this:

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

但是它表明:

如果没有.....',则执行'eval步骤'.

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

如果我使用:

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

该步骤工作正常.

使用 eval 的步骤出了什么问题?

What's wrong with the step use eval?

推荐答案

请确保您使用的是空手道的旧版本. eval 在0.7.0中引入

Pretty sure you are on an old version of Karate. eval was introduced in 0.7.0

这篇关于空手道:无法在方案步骤中使用“评估"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆