匹配和匹配每种情况的最佳条件逻辑 [英] The best conditional logic for match and match each case

查看:68
本文介绍了匹配和匹配每种情况的最佳条件逻辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我想在代码中使用条件逻辑,条件条件是当我得到response.response_code == '00'时才能运行

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]

如果response.response_code != '00',它将运行

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

那么,这种情况下最好的条件逻辑是什么?

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

推荐答案

请阅读文档: https://github.com/intuit/karate#conditional-logic

使用第二个功能文件:

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

注意:您不能在需要JavaScript的地方使用match,请参考: https://stackoverflow.com/a/53961806/143475

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

这篇关于匹配和匹配每种情况的最佳条件逻辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆