I'm trying to use retry, to check if an object containing a given ID is present in the answer.
Here is one of the attempts I made :
Background:
* url 'https://jsonplaceholder.typicode.com'
Scenario: get all users and then get the first user by id
Given path 'users'
When method get
Then status 200
* def first = response[0]
Given path 'users'
And retry until response[0].id == first.id
When method get
Then status 200
Given path 'users'
And retry until response[*].id == first.id
When method get
Then status 200
The first retry works, but the second one generates an error because [*] cannot be used with the retry command. But how can I check that first.id is present in at least one of the objects in the response array, while using retry
and not a javascript function?