Skip to main content
Assertions let you validate HTTP responses and browser page state — status codes, response bodies, headers, latency, page URLs, extracted text, and more. They use a fluent API that reads naturally:

API request assertion subjects

You can assert on four properties of any HTTP request node:

Status code

Response body

Access nested properties with bracket notation. Use .at(index) for array elements. For steps with response_format: NoContent (e.g. 204 No Content), there is no body — assert only on state["req"].status (e.g. .equals(204)).

Headers

Latency

Latency is measured in milliseconds:

Browser assertion subjects

Browser nodes expose different properties than API request nodes. See Browser Monitors for full details.

Page URL

Page title

Duration

Total time for all browser steps, in milliseconds:

Console errors

JavaScript errors captured from the browser console:

Extracted text

Values captured by extractText() steps:

Predicates

Comparison

String

Existence

Negation

Prefix any predicate with .not to negate it:

Using with the sequential builder

The sequential builder provides a callback with a type-safe state proxy:
The state proxy only exposes nodes that have been defined above the assertion, giving you compile-time autocomplete.

Using with the graph builder

With the graph builder, create a state proxy manually using createStateProxy:

Multiple assertions

You can add multiple assertion nodes to validate different parts of your flow:
A monitor run is marked as failed if any assertion in any assertion node fails.