Tests & Steps

Structure test cases with sequential step groups and parallel steps.

Test structure

Tests are defined in the top-level tests array. Each test is independent and contains step groups.

{
  "name": "my-test-suite",
  "items": [ ... ],
  "tests": [
    {
      "name": "Create and fetch a user",
      "variables": { "email": "test@example.com" },
      "steps": [
        [{ "name": "Step 1a", ... }, { "name": "Step 1b", ... }],
        [{ "name": "Step 2", ... }]
      ]
    }
  ]
}

Step groups: parallel and sequential

Steps are organized as an array of arrays:

"steps": [
  // Group 1: these two steps run in parallel
  [
    { "name": "Create user A", ... },
    { "name": "Create user B", ... }
  ],
  // Group 2: runs after group 1 completes
  [
    { "name": "List all users", ... }
  ]
]

TestDefinition fields

FieldTypeRequiredDefaultDescription
namestringYesName of the test
descriptionstringNoWhat the test verifies
timeoutSecondsintegerNoTimeout for entire test
stopOnFailurebooleanNotrueStop subsequent groups when any assertion fails
variablesobjectNoTest-level variables (overrides definition-level). Supports $ref.
stepsarray of arraysYesStep groups

TestStep fields

FieldTypeRequiredDefaultDescription
namestringNoStep name
descriptionstringNoStep description
actionobjectYesAction to execute (see Actions)
extractobjectNoExtract variables from response (see Variables)
assertionsarrayNoAssertion blocks (see Assertions)
stopOnFailurebooleanNotrueStop test when assertions in this step fail

Definition-level variables

The definition file itself can have a top-level variables field alongside name, items, and tests. These are shared across all tests in the definition. Test-level variables override definition-level variables with the same key.

{
  "name": "my-suite",
  "variables": {
    "baseEmail": "test@example.com"
  },
  "items": [ ... ],
  "tests": [
    {
      "name": "Test 1",
      "variables": {
        "baseEmail": "override@example.com"
      },
      "steps": [ ... ]
    }
  ]
}

See Variables for full details on interpolation, extraction, and scoping.