如何通过传递 id 列表来迭代它。我在 foo 变量中有多个 id,我想调用删除项目.feature对于该 foo 变量中可用的每个 id。
项目.特征
* def foo = get response.data[*].id
* def del = call read('delete_project.feature')
删除项目.feature
Given path 'project', id
When method DELETE
Then status 200
Then match response.status == 'success'
通过将 id 列表作为输入传递给功能,您实际上可以多次调用迭代功能。
* def foo = get response.data[*].id
* def createId = function(x) {return {"id" :x}}
* def ids = karate.map(foo,createId)
* def del = call read('delete_project.feature') ids
Refer 数据驱动功能 https://github.com/intuit/karate#data-driven-features在空手道中
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)