如何在空手道反应中进行条件检查?
How to do conditional check in karate response?
有没有办法检查对象是否为空然后确定如果不是然后检查它是否匹配固定结构?
我的意思是,类似于:
* def expectedDelayEntries = response.delayEntries == "{}" ? {} : '#(delayEntries)'
是的。参考文档:https://github.com/intuit/karate#conditional-logic
分两步完成。
* def expected = condition ? { foo: '#string' } : { bar: '#number' }
* match response == expected
有没有办法检查对象是否为空然后确定如果不是然后检查它是否匹配固定结构?
我的意思是,类似于:
* def expectedDelayEntries = response.delayEntries == "{}" ? {} : '#(delayEntries)'
是的。参考文档:https://github.com/intuit/karate#conditional-logic
分两步完成。
* def expected = condition ? { foo: '#string' } : { bar: '#number' }
* match response == expected