Skip to content
Igor Gursky edited this page Sep 23, 2016 · 7 revisions

Variables

Setting and Reading a value

Given let variable "gadgetId" equal to "12345"
When the client performs GET request on /gadgets/{(gadgetId)}

Accessing Response HTTP headers as a variable

When the client performs GET request on /gadgets
Then response contains property "gadgets[0].id" of value "{(header.GadgetId)}"

Copying a value from Response HTTP header

Given request body from file gadgets/requests/newGadget.json
When the client performs POST request on /gadgets
Then let variable "gadgetURL" equal to header "Location" value

Copying a value from property from Response body

Given request body from file gadgets/requests/newGadget.json
When the client performs POST request on /gadgets
Then let variable "gadgetOwner" equal to property "owner" value

Then response contains property "prop[0].long" not matching pattern "{(header.Custom-Header)}"
Clone this wiki locally