The best conditional logic for match and match each case

瘦欲@ 提交于 2021-01-28 22:49:18

问题


so, I want to use conditional logic in my code, which the condition is when I got response.response_code == '00' so it will run

And match response == res_3[0]
And match each response.data.bills == res_3[1]

And if response.response_code != '00' , it will run

And match response == res_3
And match each response.data.bills == res_3

so, what is the best conditional logic for this case ??


回答1:


Read the docs please: https://github.com/intuit/karate#conditional-logic

Use a second feature file:

* eval if (response.response_code != '00') karate.call('it-will-run.feature')

Note: you can't use match where JavaScript is expected, refer: https://stackoverflow.com/a/53961806/143475



来源:https://stackoverflow.com/questions/54524997/the-best-conditional-logic-for-match-and-match-each-case

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!