是否可以使用空手道比赛'内部条件陈述?

时间:2018-05-15 11:06:22

标签: conditional karate

在此处查找示例。

def a = condition ? " karate match statement " : "karate match statement"

是否可以做这样的事情?

1 个答案:

答案 0 :(得分:0)

这是非常糟糕的测试练习,因为Ionic social sharing plugin

那就是说,如果你真的坚持这样做,即将推出的空手道版本将允许你通过JS做match。您可以在0.8.0.RC3

中试用

以下是一个例子:

* def foo = { hello: 'world' }
* def result = true ? karate.match(foo, { hello: '#string'}) : {}
* match result == { pass: true, message: null }
* eval if (result.pass) karate.log('*** passed')

karate.match()的结果将以{ pass: '#boolean', message: '#string' }

的形式返回JSON
相关问题