如何在空手道中使用eval进行if和else情况?

时间:2018-08-23 17:53:49

标签: karate

现在仅需要与此有关的小帮助,我有一个返回数据price": { "pretax_price": 7002.84, "rack_rate": 8140.82, "wallet_deductable_amount": 0, "voucher_amount": 0, "total_discount_percent": 92.75, "net_payable_amount": 4131.68, }的api。现在,我要尝试的操作是* def pretax =price.pretax_price仅在* def valueFromDB == true时才应调用valueFromDB来自数据库

1 个答案:

答案 0 :(得分:0)

请。读。的。文件:https://github.com/intuit/karate#conditional-logic

* def pretax = valueFromDB ? price.pretax_price : pretax