如何在空手道的 for 循环中调用特征文件?

How to call a feature file inside a for loop in karate?

假设我的变量就像

queryParam = [{"coupon_id": 1,"code": "test"},{"coupon_id": 1,"code": "test"}]

现在假设我想用

调用一个特征文件
param= {"coupon_id": 1,"code": "test"}

再次使用参数 参数= {"coupon_id": 1,"code": "test"}

实际上我调用了一个带有多个参数的 api。

参考这个例子:https://github.com/intuit/karate/blob/master/karate-demo/src/test/java/demo/callarray/call-json-array.feature

这里因为kittens.json是一个数组,所以call会循环。

* def creator = read('kitten-create.feature')
* def kittens = read('kittens.json')
* def result = call creator kittens