Created
February 1, 2019 22:17
-
-
Save davidemoro/05fefed4084025eb256b8e2998a32bc2 to your computer and use it in GitHub Desktop.
This file contains 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
test_data: | |
- category: dev | |
- category: movie | |
- category: food | |
--- | |
- type: GET | |
provider: play_requests | |
url: https://api.chucknorris.io/jokes/categories | |
expression: "'dev' in response.json()" |
This file contains 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
test_data: | |
- category: dev | |
- category: movie | |
--- | |
- comment: "query by category, save json response in 'categories' variable | |
(accessible in further steps using variables['categories']) and assert | |
200 status code" | |
type: GET | |
provider: play_requests | |
url: https://api.chucknorris.io/jokes/search?query=$category | |
variable: categories | |
variable_expression: response.json() | |
assert: response.status_code == 200 | |
- comment: "assert total number matches" | |
type: assert | |
provider: python | |
expression: "variables['categories']['total'] == len(variables['categories']['result'])" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment