空手道 - 匹配响应大于或小于

Karate - match response for greater or less than

对于我的空手道测试,我确实在某些情况下需要比较大于或小于等于的整数结果。截至目前,对于 match 操作,只有 '==' or '!='.

有没有办法验证 'Greater than equal to ' 或 'Less than' 类型的运算符?

是的,有多种方法:

* def foo = 5
* assert foo <= 6

* def bar = { a: 1 }
* match bar == { a: '#? _ > 0' }

参考: assert | 'self' expressions