我正在尝试遍历空手道特征文件中的数组值。在Feature1.feature-Scenario1中,数组[“ UUID1”,“ UUID2”,“ UUID3”]中有一些值,并且我想调用另一个功能文件(Feature2.feature)(具有用于调用DELETE端点的代码) )的服务
Feature2.feature:
@ignore
Feature: Delete
Background:
* url baseUrl
* headers {content-type:'application/json'}
Scenario: Delete Test Assets
Given headers {uid: '#(UId)', cid:'#(CId)'}
And path 'type', Type, 'id', AssetId
When method delete
Then status 204
我应该对Feature1.feature使用哪种方法来循环调用Feature2.feature?
* def data = ["UUID1","UUID2","UUID3"]
* def data = karate.mapWithKey(data, 'uid')
* call read('second.feature') data
并且在second.feature
中:
* headers { uid: '#(uid)' }
当然,如果需要,请阅读call
的文档:https://github.com/intuit/karate#data-driven-features