Actions

Each test step executes one action: an HTTP request, a database query, or a wait.

HTTP Request

{
  "action": {
    "type": "httpRequest",
    "method": "POST",
    "url": "api-gateway/api/users",
    "headers": {
      "Authorization": "Bearer {{token}}",
      "Content-Type": "application/json"
    },
    "body": {
      "name": "{{userName}}",
      "email": "{{email}}"
    }
  }
}
FieldTypeRequiredDescription
type"httpRequest"YesAction type
methodenumYesGET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS
urlstringYesservice-name/path format — service name resolves to internal DNS
headersobjectNoRequest headers (values support {{variables}})
bodyany JSONNoRequest body (string values support {{variables}})

Use service names, not ports. The url field uses the format service-name/path — just the item name and the route. Dokkimi handles DNS and port resolution internally. Don't include ports, protocols, or hostnames.

For example, if your service item is named api-gateway and listens on port 3000:

// Correct
"url": "api-gateway/api/users"

// Wrong — don't include ports or protocols
"url": "http://api-gateway:3000/api/users"

Parallel actions

Steps within the same step group run in parallel. This means multiple HTTP requests can execute simultaneously:

"steps": [
  [
    {
      "name": "Create order A",
      "action": { "type": "httpRequest", "method": "POST", "url": "api-gateway/api/orders", "body": { "item": "widget" } }
    },
    {
      "name": "Create order B",
      "action": { "type": "httpRequest", "method": "POST", "url": "api-gateway/api/orders", "body": { "item": "gadget" } }
    }
  ]
]

Both requests fire at the same time. Use this to test concurrent access patterns or to speed up independent setup steps. See Tests & Steps for more on parallel vs sequential grouping.

Database Query

SQL databases (Postgres, MySQL)

{
  "action": {
    "type": "dbQuery",
    "database": "postgres-db",
    "query": "SELECT * FROM users WHERE email = '{{email}}'"
  }
}

MongoDB

For MongoDB, the query field must be a JSON string with a specific structure:

{
  "action": {
    "type": "dbQuery",
    "database": "mongo-db",
    "query": "{\"operation\":\"findOne\",\"collection\":\"orders\",\"filter\":{\"orderId\":\"ORD-001\"}}"
  }
}

Supported MongoDB operations:

OperationRequired fields
find, findOnecollection, filter
insertOnecollection, document
insertManycollection, documents
updateOne, updateManycollection, filter, update
deleteOne, deleteManycollection, filter
FieldTypeRequiredDescription
type"dbQuery"YesAction type
databasestringYesName of a DATABASE item in the definition
querystringYesSQL query or MongoDB command JSON (supports {{variables}})

Wait

Pause execution for a specified duration. Useful for waiting for async operations to complete.

{
  "action": {
    "type": "wait",
    "durationMs": 2000
  }
}
FieldTypeRequiredDescription
type"wait"YesAction type
durationMsintegerYesDuration to wait in milliseconds