[config]
base_url = "https://httpbin.org"
default_headers = { "Content-Type" = "application/json" }
[[tests]]
name = "Basic Test"
method = "GET"
endpoint = "/get"
expected_status = 200
[[tests.assertions]]
type = "Contains"
value = { "url" = "https://httpbin.org/get" }
[[tests]]
name = "Complex Test"
method = "POST"
endpoint = "/post"
expected_status = 200
[tests.body]
name = "Test User"
email = "test@example.com"
[[tests.assertions]]
type = "Contains"
[tests.assertions.value]
url = "https://httpbin.org/post"
[tests.assertions.value.json]
name = "Test User"
[[tests.assertions]]
type = "PathRegex"
value = ["$.json.email", "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"]
[[tests]]
name = "Variable Storage Test"
method = "POST"
endpoint = "/post"
expected_status = 200
[tests.body]
id = "12345"
name = "Test Resource"
[tests.store]
"$.json.id" = "resource_id"
"$.json.name" = "resource_name"
[[tests]]
name = "Variable Usage Test"
method = "GET"
endpoint = "/get"
expected_status = 200
[tests.query_params]
id = "${{resource_id}}"
name = "${{resource_name}}"
[tests.headers]
"X-Resource-ID" = "${{resource_id}}"
[[tests.assertions]]
type = "Contains"
[tests.assertions.value.args]
id = "12345"
name = "Test Resource"
[[tests]]
name = "Response Time Test"
method = "GET"
endpoint = "/get"
expected_status = 200
max_response_time = 1000
[[tests]]
name = "Expected Body Test"
method = "GET"
endpoint = "/get"
expected_status = 200
[tests.expected_body]
url = "https://httpbin.org/get"
[tests.expected_body.args]
[[tests]]
name = "Multiple Assertions Test"
method = "GET"
endpoint = "/get"
expected_status = 200
[[tests.assertions]]
type = "Exact"
[tests.assertions.value]
url = "https://httpbin.org/get"
args = {}
[[tests.assertions]]
type = "Regex"
value = ".*\"url\":\\s*\"https://httpbin.org/get\".*"
[[tests.assertions]]
type = "PathRegex"
value = ["$.url", "^https://httpbin.org/get$"]
[[tests]]
name = "Current User Test"
method = "POST"
endpoint = "/post"
expected_status = 200
body = { "username" = "${{USER}}" }
assertions = [
{ "type" = "Contains", "value" = { "json" = { "username" = "${{USER}}" } } },
]
store = { "$.json.username" = "current_user" }