Skip to main content

Module assertions

Module assertions 

Source
Expand description

Assertion helpers for common test patterns. Additional assertion helpers for testing

Modules§

tasks
Task execution assertion utilities

Functions§

assert_contains
Assert that response body contains text
assert_error
Assert that a result is an error (generic error assertion)
assert_internal_error
Assert that a result is an Internal error
assert_json_array_contains
Assert that JSON array contains a value
assert_json_array_empty
Assert that JSON array is empty
assert_json_array_len
Assert that JSON array has a specific length
assert_json_array_not_empty
Assert that JSON array is not empty
assert_json_field_eq
Assert that JSON contains a field with a specific value
assert_json_has_field
Assert that JSON contains a field
assert_json_matches
Assert that JSON matches a pattern (subset matching)
assert_json_missing_field
Assert that JSON does not contain a field
assert_json_response
Assert that response contains expected JSON data (exact match)
assert_json_response_contains
Assert that response is JSON and contains expected field with value
assert_not_contains
Assert that response body does not contain text
assert_not_found_error
Assert that a result is a NotFound error
assert_response_body_contains
Assert that response body contains expected text
assert_response_body_equals
Assert that response body equals expected bytes
assert_status
Assert that response has expected status code
assert_status_client_error
Assert that status is in 4xx range
assert_status_eq
Assert that two status codes are equal
assert_status_error
Assert that status is an error (4xx or 5xx)
assert_status_redirect
Assert that status is in 3xx range
assert_status_server_error
Assert that status is in 5xx range
assert_status_success
Assert that status is in 2xx range
assert_validation_error
Assert that a result is a Validation error