Created
March 20, 2015 12:40
-
-
Save cades/a5cbc52f60e415152906 to your computer and use it in GitHub Desktop.
a HTTP server testing DSL proposal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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