for e.g.
* def products = [{"ProductCode":"a","UnitPrice":100.0},{ {"ProductCode":"b","UnitPrice":200.0}]
* def inventory = [{"ProductCode":"b","UnitPrice":200.0},{ {"ProductCode":"a","UnitPrice":100.0}]
* match products == inventory
This fails as the order of elements in the array are not matching. How can I tell karate to ignore the order?
Please read the docs: https://github.com/intuit/karate#match-contains
* def products = [{"ProductCode":"a","UnitPrice":100.0},{"ProductCode":"b","UnitPrice":200.0}]
* def inventory = [{"ProductCode":"b","UnitPrice":200.0},{"ProductCode":"a","UnitPrice":100.0}]
* match products contains only inventory
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With