如何在空手道的 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。
这里因为kittens.json
是一个数组,所以call
会循环。
* def creator = read('kitten-create.feature')
* def kittens = read('kittens.json')
* def result = call creator kittens
假设我的变量就像
queryParam = [{"coupon_id": 1,"code": "test"},{"coupon_id": 1,"code": "test"}]
现在假设我想用
调用一个特征文件param= {"coupon_id": 1,"code": "test"}
再次使用参数 参数= {"coupon_id": 1,"code": "test"}
实际上我调用了一个带有多个参数的 api。
这里因为kittens.json
是一个数组,所以call
会循环。
* def creator = read('kitten-create.feature')
* def kittens = read('kittens.json')
* def result = call creator kittens