variants | exampleContext | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
This file demonstrates how to use the REST echo API and at the same time is used to run automated tests.
The endpoint supports both unsecure HTTP and HTTPs.
I should be able to generate a new random ID so I can use it for my own data. The response returns a UUIDv4.
When I POST to ${variant.protocol}://${domainName}/new
Soon the response status code should be 201
And the response body should be a string matching
^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$
Given I store response.body
into randomID
When I PUT to ${variant.protocol}://${domainName}/${randomID}
with
Content-type: <variant.contentType>
connect:anything
Soon the response status code should be 202
When I GET ${variant.protocol}://${domainName}/${randomID}
Soon the response status code should be 200
And the response body should be a string matching ^connect:anything$
When I DELETE ${variant.protocol}://${domainName}/${randomID}
Soon the response status code should be 202
When I GET ${variant.protocol}://${domainName}/${randomID}
Soon the response status code should be 404