如何通过单独的功能文件迭代参数列表?

How to iterate list of params through separate feature file?

如何通过传递 ID 列表来迭代它。我在 foo 变量中有多个 ID,我想为该 foo 变量中可用的每个 ID 调用 delete_project.feature

project.feature

* def foo = get response.data[*].id
* def del = call read('delete_project.feature') 

delete_project.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

参考空手道 data driven feature