问题
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