空手道模拟是否支持contains
语法以匹配特定条件?
我有一个类似Account Id
包含"789"
的要求,然后发送所需的响应文件。
我已经尝试过,但是面临语法问题。
def RespFile = (AccountId == "909090" ?
'Failure.xml' :
(AccountId contains ["359"] ? 'Succes.xml' : 'nomatch.xml'))
请帮助我以上
答案 0 :(得分:0)
不。使用纯JS逻辑。或者,您可以尝试查看karate.match()
API。
类似这样的东西:
* def accountId = 'some string'
* def response = accountId.contains('foo') ? read('foo.json') : {}