Given
我已经定义了数组
* def array = [
{"code": "codeA", "boolValue": false, "a": 5, "c": false},
{"code": "codeA", "boolValue": true, "a": 7, "c": true},
{"code": "codeB", "boolValue": true, "a": 1, "c": false}
]
和变量
* def expected = { "code": "codeB", "boolValue": true }
Issues
在最后一个元素中array
有expected
价值。
但它包含一些附加值,这就是为什么我每次尝试检查它都失败的原因。
如何检查数组是否包含预期内容?
这将在 0.9.6.RC4 中工作:
* match array contains deep expected
在之前的版本中:
* match array contains '#(^expected)'
请阅读文档:https://github.com/intuit/karate/tree/develop#schema-validation https://github.com/intuit/karate/tree/develop#schema-validation
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)