我正在使用Karate框架(最新版本0.9.6(开发POC,我遇到了以下问题:
* match each response.bar contains { id:"#uuid ? _ != ''", name: "#notnull", foo: "#[] #object"}
我注意到,当foo是一个空数组时,它不会使步骤失败。如果数组为空,是否可以在上述步骤中添加长度验证以失败?
提前谢谢。
是的,请阅读文档:https://github.com/intuit/karate#schema-验证
* match each response.bar contains { id:"#uuid ? _ != ''", name: "#notnull", foo: "#[_ > 0] #object"}