如何将"OR"置于空手道API断言语句中的运算符 [英] How to put "OR" operator in Karate API assertion statement
本文介绍了如何将"OR"置于空手道API断言语句中的运算符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在空手道API中对断言语句使用或"运算符.
I would like to use "OR" operator for assertion statement in Karate API.
这是我第一次尝试对空手道API进行或"运算符:
This is the first time I am trying to OR operator in Karate API:
match response.items[0].type == 'Purchase'
我想使用OR运算符,例如:
I would like to use an OR operator like:
match response.items[0].type == 'Purchase' or 'Freeplay'
我无法使用或语句成功执行
I have not been able to successfully execute with or statement
推荐答案
有时 assert
是最简单的选项:
Sometimes assert
is the simplest option:
* def itemType = response.items[0].type
* assert (itemType == 'Purchase') || (itemType == 'Freeplay')
还有其他方法,请参见: https://stackoverflow.com/a/57377284/143475
There are other ways, see: https://stackoverflow.com/a/57377284/143475
这篇关于如何将"OR"置于空手道API断言语句中的运算符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文