step

Summary

A step is a call to a single endpoint. Optionally the response can be validated.

Fields

id

type: string
required: yes
description: A string to uniquely identify a step within a transaction.

request

type: request
required: yes
description: The request to send. See step.request

expect

type: response
required: no
description: Validation on the response. See step.expect

export

type: mapping
required: no
description: The variables to export; a mapping from variable names to JSON paths to the value in the response. You can export values from headers and JSON bodies. See the examples below.

variables

type: variables
required: no
description: Variables scoped to this step

Examples

steps:
  - id: "get user with id 1"
    variables:
      api_url: "http://localhost:80"
    request:
      method: "GET"
      endpoint: "{{ var.api_url }}/users/1"
    expect:
      code: 200
      body:
        type: "json"
        content: |
          {
            "first_name": "Bobby",
            "last_name": "Hounslow",
            "address": {
                "postcode": "TW4 7AE",
                "country": "UK",
            }
          }
    export:
      auth_header: "response.headers.X-APIDAUTH"
      auth_token: "response.body.access_token"
      array_item: "response.body.array[2]"

Didn't find what you were looking for?

You can head over to our FAQ page