Skip to content

Instantly share code, notes, and snippets.

@cades
Created March 20, 2015 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cades/a5cbc52f60e415152906 to your computer and use it in GitHub Desktop.
Save cades/a5cbc52f60e415152906 to your computer and use it in GitHub Desktop.
a HTTP server testing DSL proposal
Feature: I can test request response features
Scenario Outline: response code
When I request "GET" "http://httpbin.org/status/<code>"
Then the response code should be <code>
Examples:
| code |
| 200 |
| 411 |
| 518 |
| 302 |
Scenario Outline: header
Given header contains "<field>" as "<value>"
And header contains "<field2>" as "<value2>"
When I request "GET" "http://httpbin.org/headers"
Then the response json should have "headers.<field>" to match "<value>"
Examples:
| field | value | field2 | value2 |
| my-header | my-value | yaheader | yavalue |
| amazing | leah | wants | tomato |
| yoda | charles | bringus | bugful-Z3 |
Scenario Outline: query
Given query string contains "<field>" as "<value>"
And query string contains "<field2>" as "<value2>"
When I request "GET" "http://httpbin.org/get"
Then the response json should have "headers.<field>" to match "<value>"
Examples:
| field | value | field2 | value2 |
| my-header | my-value | yaheader | yavalue |
| amazing | leah | wants | tomato |
| yoda | charles | bringus | bugful-Z3 |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment