Reference

YAML Test File Format

Complete reference for .tarn.yaml file structure, all fields with descriptions and constraints.

Top-level fields

Field Required Type Description
versionNostringSchema version ("1" only)
nameNo*stringTop-level test suite name (*recommended)
descriptionNostringSuite description
tagsNo[string]Tags for filtering with --tag
envNoobjectInline environment variables
cookiesNostring"auto" (default), "off", "per-test"
redactionNoobjectReport-time redaction of headers, env, captures
defaultsNoobjectProject-wide request defaults (headers, auth, timeout)
setupNo[step]Setup steps run before all tests
teardownNo[step]Teardown steps run after all tests
testsSee note[test]Named test groups (mutually exclusive with steps)
stepsSee note[step]Flat (unnamed) steps (mutually exclusive with tests)

At least one of steps or tests must be present.

Step fields

Field Required Type Description
nameYesstringStep name (display and identification)
requestYesobjectHTTP request (method + url required)
captureNoobjectCapture variables from response
assertNoobjectResponse assertions
pollNoobjectPolling configuration (until, interval, max_attempts)
retriesNointegerRetry count for transient failures
timeoutNointegerPer-step timeout in milliseconds
connect_timeoutNointegerTCP connection timeout in milliseconds
delayNointegerDelay before step in milliseconds
follow_redirectsNobooleanWhether to follow redirects (default: true)
max_redirsNointegerMaximum redirects to follow
cookiesNostring/boolean"off" to disable, string for named jar, true/false
scriptNostringInline Lua script (optional feature)
ifNostringSkip step unless interpolated expression is truthy
unlessNostringSkip step if interpolated expression is truthy
debugNobooleanRecord full response for debugging

Request fields

Field Required Type Description
methodYesstringHTTP method (GET, POST, PUT, PATCH, DELETE, etc.)
urlYesstringRequest URL with {{ ... }} interpolation
headersNoobjectHTTP headers (key: value)
bodyNoanyJSON body (object/array), or plain text (string)
formNoobjectForm-urlencoded body
graphqlNoobjectGraphQL query (query, variables, operation_name)
multipartNoobjectMultipart form data (fields + files)
authNoobjectAuth config (bearer token or basic credentials)

Assert fields

Field Type Description
statusinteger / string / objectStatus assertion (exact, shorthand, or complex)
bodyobjectBody assertions keyed by JSONPath
headersobjectResponse header assertions
durationstringDuration assertion ("< 500ms", etc.)
redirectobjectRedirect assertions (url, count)

Capture fields

Key Value / Sub-fields Description
name: "$.json.path"string (JSONPath)Capture from body JSONPath (shorthand)
name.jsonpathstringExplicit JSONPath capture from body
name.headerstringCapture from response header
name.cookiestringCapture cookie by name from Set-Cookie
name.bodytrueCapture whole response body as string
name.statustrueCapture HTTP status code as number
name.urltrueCapture final URL after redirects
name.regexstringRegex capture group 1 (on header/body sources)
name.optionaltrueDon't fail if source is missing
name.defaultanyFallback value when source yields no match
name.whenobjectStatus gate ({ status: 201 } or { status: "2xx" })

Poll configuration

Field Required Type Description
untilYesobjectAssertions that must pass to stop polling
intervalYesstring/msPolling interval (e.g. "1s", 500)
max_attemptsYesintegerMaximum polling attempts before failure

Include directive

Field Required Type Description
includeYesstringPath to shared .tarn.yaml file
withNoobjectParameters to pass ({{ params.x }})
overrideNoobjectOverride env/cookies/defaults from included file

Auth config

Field Type Example
auth.bearerstringauth: { bearer: "{{ capture.token }}" }
auth.basicobjectauth: { basic: { username: "admin", password: "pass" } }