Requests

How to send GET, POST, and other calls, plus pauses between them.

Each item under requests is either an HTTP call or a pause. The name you give it (get_products, add_product, wait_for_index, …) is how later steps refer to it.

HTTP requests

FieldRequiredNotes
methodYesget, post, put, patch, or delete
urlYesFull URL. Put query strings in the URL itself.
bodyRequired for post, put, and patchA JSON object. Not allowed on get or delete.
headersNoIf you omit them, YAATT sends Content-Type: application/json.
descriptionNoA note for humans. YAATT displays this when it runs your test.

GET requests never send a body. Other methods send the body as JSON.

login:
  method: post
  url: "{{env:API_URL}}/auth/login"
  headers:
    Content-Type: application/json
    X-Request-Id: "{{gen:uuid}}"
  body:
    email: "{{env:TEST_USER_EMAIL}}"
    password: "{{env:TEST_USER_PASSWORD}}"

Delays

Wait between requests. delay is the number of seconds.

wait_for_index:
  delay: 2

A delay of 0 or less is skipped.