-
Notifications
You must be signed in to change notification settings - Fork 66
Variables
Igor Gursky edited this page Sep 23, 2016
·
7 revisions
Given let variable "gadgetId" equal to "12345"
When the client performs GET request on /gadgets/{(gadgetId)}
When the client performs GET request on /gadgets
Then response contains property "gadgets[0].id" of value "{(header.GadgetId)}"
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
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
If reading request from file, Cukes-REST will automatically substitute variable placeholders with appropriate values if defined.
Example:
{
"name" : "{(gadgetName)}"
}
and scenario
Given request body from file gadgets/requests/newGadget.json
And let variable "gadgetName" equal to "iPhone"
When the client performs POST request on /gadgets