Skip to content

Instantly share code, notes, and snippets.

@davidemoro
Created February 1, 2019 22:17
Show Gist options
  • Save davidemoro/05fefed4084025eb256b8e2998a32bc2 to your computer and use it in GitHub Desktop.
Save davidemoro/05fefed4084025eb256b8e2998a32bc2 to your computer and use it in GitHub Desktop.
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()"
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