“!包含"可以“比较"吗?空手道中的弦与弦? [英] Does '!contains' can "compare" String with String in Karate?
本文介绍了“!包含"可以“比较"吗?空手道中的弦与弦?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们非常仔细地阅读了github仓库,但找不到是否可以这样做: 'foo'!包含'bar'.示例仅显示: * match foo!contains {huh:'#notnull'}> json * match foo!包含4> int * match foo!包含[5,6]>数组
We read very carefully the github repo, but we can't find if we can do: 'foo' !contains 'bar'. Exemples show only: * match foo !contains { huh: '#notnull' } > json * match foo !contains 4 > int * match foo !contains [5, 6] > array
我们可以用String吗?
Can we do it with String?
推荐答案
Great question, this is indeed not possible today, but we opened a ticket for this: https://github.com/intuit/karate/issues/201
与此同时,您可以通过assert
和JavaScript进行此操作:
Meanwhile you can do this via an assert
and JavaScript:
* def foo = 'Hello World'
* assert foo.indexOf('blah') == -1
这篇关于“!包含"可以“比较"吗?空手道中的弦与弦?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文