My scenario is very common: I create certain objects using the POST method. At the end of the feature I want to delete all the objects that I have retrieved from a GET operation
Feature:
Scenario: create cat
Given url demoBaseUrl
And path 'cats'
And request { name: '#(name)' } ## using table created many cats
When method post
Then status 200
Scenario: get all the cats
Given url demoBaseUrl
When method get
Then status 200
* def createdcats = $.cats[*].id
## this gives lets say 4 values Cat1,Cat2,Cat3,Cat4
##Now I want to use the DELETE method to delete the said cats, the DELETE operation takes a path param
Given url demoBaseUrl
And path 'cats'
When method delete
Then status 204
what is the parameter to be passed for looping over an array of createdcats
I had an idea of having a JS function, but then it will mean calling a feature from with js. Is it the right way to do it?