Does '!contains' can “compare” String with String in Karate?

送分小仙女□ 提交于 2021-01-28 06:15:44

问题


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

Can we do it with String?


回答1:


Great question, this is indeed not possible today, but we opened a ticket for this: https://github.com/intuit/karate/issues/201

Meanwhile you can do this via an assert and JavaScript:

* def foo = 'Hello World'
* assert foo.indexOf('blah') == -1


来源:https://stackoverflow.com/questions/46491555/does-contains-can-compare-string-with-string-in-karate

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!