I need to do clean up after running my karate tests and invoke a clean up endpoint for all objects i created . Something of the sort of:
for all objects i created:
invoke rest endpoint path/object.id
I followed Can we loop feature files and execute using multiple login users in karate
And also checked https://github.com/intuit/karate/blob/master/karate-demo/src/test/java/demo/callarray/call-json-array.feature
They allow to pass param in the request but not in the path param. I tried doing:
def result = call read(clean-up.feature) ids
But this fails as the clean-up.feature needs two params path and id
Given Path resourcePath , resourceId
I also tried
Given id: '#(ids)'
And path resourcePath, id
and
Given path resourcePath,id: '#(ids)'
But that doesn't work. Is there a way to do that?
ids
looks like? – Babu Sekaran