Skip to content
Igor Gursky edited this page Sep 26, 2016 · 3 revisions

Asserting response properties

.....
Then status code is 200
And response contains property "id" with value other than "2000"
And response contains property "name" with value "Nexus 9"
And response contains property "owner.name" with value "Ned"
And response contains property "owner.surname" with value "Flanders"
And response contains property "owner.age" with value "43"
And response contains property "createdDate" of type "long"
And response does not contain property "updatedDate"

Asserting response arrays

.....
Then status code is 200
And response contains an array "devices" of size "5"

Finding property with condition

.....
Then response contains property "devices.find{devices->device.id=="12345"}.type" with value "PHONE"

Asserting Response body from file

When the client performs GET request on /gadgets/12345
Then response contains properties from file gadgets/responses/createdGadget.json

In the mentioned example, Gadget with ID 12345 is returned in the response and all properties from createdGadget.json are searched in response body, values are asserted to be equal.

Clone this wiki locally