After upgrade to latest version of karate (1.1.0 to 1.4.1) this line is no longer working
<code>And Match each response[*].foos[*].bars == "#notpresent"
</code>
<code>And Match each response[*].foos[*].bars == "#notpresent"
</code>
And Match each response[*].foos[*].bars == "#notpresent"
foos
and bars
are arrays
I want to assert that in foos array each object do not contain an array field bars
It failed
<code>match failed: EACH_EQUALS
$ | match each failed, empty array / list (LIST:STRING)
[]
'#notpresent'
</code>
<code>match failed: EACH_EQUALS
$ | match each failed, empty array / list (LIST:STRING)
[]
'#notpresent'
</code>
match failed: EACH_EQUALS
$ | match each failed, empty array / list (LIST:STRING)
[]
'#notpresent'
Please read the release notes: https://github.com/karatelabs/karate/releases/tag/v1.4.1
I think your assertion is wrong and the change actually forces you to correct your test. I recommend something like this:
<code>* match each response.foos !contains { bars: '#present' }
</code>
<code>* match each response.foos !contains { bars: '#present' }
</code>
* match each response.foos !contains { bars: '#present' }
If you really want to revert to the old behavior (which I don’t think is right in your case) you can do this:
<code>* configure matchEachEmptyAllowed = true
</code>
<code>* configure matchEachEmptyAllowed = true
</code>
* configure matchEachEmptyAllowed = true