packages feed

curl-runnings-0.3.0: examples/example-spec.yaml

---
# The top level of the file is an array of test cases

- name: test 1 # required
  url: http://your-endpoint.com/status # required
  requestMethod: GET # required
  # [Optional] Specify the json payload we expect here
  # The 1 key in this block should be either:
  # exactly | contains
  expectData:
    # The 1 key in this object specifies the matcher we want
    # to use to test the returned payload. In this case, we
    # require the payload is exactly what we specify.
    exactly:
      okay: true
      msg: 'a message'
  # [Required] Assertions about the returned status code. Pass in
  # an acceptable code or list of codes
  expectStatus: 200

- name: test 2
  url: http://your-endpoint.com/path
  requestMethod: POST
  expectStatus:
  - 200
  - 201
  # [Optional] json data to send with the request
  requestData:
    hello: there
    num: 1

- name: test 3
  url: http://your-url.com/other/path
  requestMethod: GET
  # Specify the headers you want to sent, just like the -H flag in a curl command
  # IE "key: value; key: value; ..."
  headers: "Content-Type: application/json"
  expectStatus: 200
  # The response must constain at least these headers exactly.
  # Header strings again match the -H syntax from curl
  expectHeaders: "Content-Type: application/json; Hello: world"

- name: test 4
  url: http://your-url.com/other/path
  requestMethod: GET
  headers: "Content-Type: application/json"
  expectStatus: 200
  # You can also specify a key and/or value to look for in the headers
  expectHeaders: 
  -
    key: "Key-With-Val-We-Dont-Care-About"

- name: test 5
  url: http://your-url.com/other/path
  requestMethod: GET
  headers: "Content-Type: application/json"
  expectStatus: 200
  # Specify a mix of full or partial header matches in a list like so:
  expectHeaders: 
  - "Hello: world"
  -
    value: "Value-With-Key-We-Dont-Care-About"