Docs
Assertions
Every deterministic assertion type a nono journey can declare, with fields and examples.
Assertions are the explicit, deterministic checks that decide a journey's verdict. They are declared in a journey's assertions list and evaluated after its steps run. No assertion is ever evaluated by an LLM. Unknown fields are rejected.
Common fields#
Every assertion accepts these fields in addition to its type-specific ones:
| Field | Default | Description |
|---|---|---|
type |
— | The assertion type (required). |
id |
derived | Stable identifier shown in results, manifests and baselines, e.g. single-order-request. Letters, digits, ., _ and -. If omitted, nono derives one from the type and fields (for example request_count POST /api/orders becomes request-count-post-api-orders) and adds -2, -3… to duplicates. |
description |
generated | Text shown in results. If omitted, nono generates one such as POST /api/orders is requested exactly 1×. |
required |
true |
Required checks decide the verdict. Set false for checks that are reported but never fail or block a run. |
Give important assertions an explicit id. Baselines remember assertion IDs, and removing a required assertion that existed when the baseline was approved is itself reported as a regression.
Each evaluated assertion becomes a check in the run manifest with a status of passed, failed or unverified, plus a message, optional expected and actual values and evidence references. See Evidence format.
Every run also contains a built-in required check, journey-steps, which passes only if every step executed.
Unverified is not passed#
If an assertion cannot be evaluated — for example, the journey stopped before the state it depends on, or there is no baseline screenshot to compare with — its status is unverified, not passed. nono never reports success for checks it did not run.
The verdict is decided in this order:
EXECUTION_ERRORif the run could not execute (target not allowed or unreachable, browser failure, missingenvvariable).REGRESSIONif any gating regression against the baseline was found.FAILEDif any required check failed.UNVERIFIEDif any required check is unverified, or a required condition could not be checked (for example, the journey has no assertions).VERIFIEDotherwise.
Path patterns#
The HTTP assertions (http_response, http_response_field, request_count) and the url assertion's path field match request paths with a small pattern syntax:
/api/orders— exact path./orders/:id—:namematches one path segment./api/*—*matches anything, including/.
The query string is ignored and a trailing slash is optional. method is optional on HTTP assertions; without it, requests of any method match.
visible#
An element is visible at a checkpoint.
- type: visible
testId: order-success
| Field | Description |
|---|---|
testId, role + name, selector, text |
How to find the element (first present wins, in that order). With none, body is used. |
checkpoint |
Checkpoint at which to check. Defaults to final, captured after the last step. |
Passes if the first matching element is visible.
hidden#
An element is not visible at a checkpoint. Same fields as visible.
- type: hidden
testId: checkout-error
Passes if no matching element is visible, including when none exists.
text#
An element's text matches.
- type: text
testId: cart-total
equals: "$68.00"
checkpoint: cart
| Field | Description |
|---|---|
testId or selector |
How to find the element. role and text locators are not accepted here. |
equals |
Exact expected text. The element's inner text is trimmed before comparison. |
contains |
Expected substring. |
matches |
Regular expression. |
checkpoint |
Defaults to final. |
Use one of equals, contains or matches; if several are given, equals wins, then contains. The element text is redacted before comparison, so token-like values never match a literal.
url#
The journey ended on the expected URL.
- type: url
path: /orders/:id
| Field | Description |
|---|---|
equals |
Passes if the final URL equals this value exactly, or its path plus query, or its path. |
path |
Path pattern matched against the final URL's path. |
matches |
Regular expression matched against the full final URL. |
Use one of the three; equals wins, then path. Evaluated only if the journey completed.
http_response#
Matching requests received the expected status.
- type: http_response
method: POST
path: /api/orders
expectedStatus: 201
| Field | Description |
|---|---|
method |
HTTP method (optional). |
path |
Path pattern. |
expectedStatus |
Expected status code (100–599). |
Passes only if at least one matching request was made and every matching request received expectedStatus. Fails if the journey completed without a matching request.
http_response_field#
A field in a JSON response body has the expected value. Only the fields that assertions (or capture.responseFields) name are extracted — nono does not store response bodies.
- type: http_response_field
method: POST
path: /api/orders
field: status
equals: confirmed
| Field | Description |
|---|---|
method, path |
Identify the request. The last matching response is used. |
field |
Dot path into the JSON body, e.g. order.status or items.0.id. |
equals |
Expected value: string, number, boolean or null, compared strictly ("201" is not 201). |
matches |
Regular expression matched against the value as a string. |
exists |
false asserts the field is absent. With no equals or matches, the check passes if the field is present. |
The check is unverified if the response was not JSON, was larger than capture.maxResponseBytes (256 KiB by default), came from a different origin than the base URL, or its body was unavailable. Fields whose names match redaction rules are stored as [REDACTED], so asserting their value fails. See Privacy and security.
request_count#
A request was made the expected number of times. This is the check that catches the demo shop's duplicate checkout.
- type: request_count
method: POST
path: /api/orders
expected: 1
| Field | Description |
|---|---|
method, path |
Identify the request. |
expected |
Exact count. |
min, max |
Bounds, used when expected is absent. |
With the demo shop's regression in place, this check fails with the message requested 2× (expected 1), expected: 1, actual: 2. If the journey stopped early, exceeding max still fails; otherwise the check is unverified.
no_uncaught_exceptions#
No uncaught JavaScript exceptions occurred during the journey.
- type: no_uncaught_exceptions
No extra fields. Fails as soon as an exception was observed, even if the journey stopped early. The exception messages are in the run's console evidence.
no_console_errors#
No console.error messages were logged during the journey.
- type: no_console_errors
ignore:
- "Download the React DevTools"
| Field | Description |
|---|---|
ignore |
Regular expressions; matching console errors are not counted. |
Warnings are captured as evidence but not counted. Console text is untrusted runtime data and is redacted before it is stored.
screenshot#
A checkpoint's screenshot matches the approved baseline's screenshot for the same checkpoint.
- type: screenshot
checkpoint: confirmation
maxDiffRatio: 0.02
| Field | Description |
|---|---|
checkpoint |
Name of a checkpoint step (required). |
threshold |
Per-pixel colour sensitivity, 0–1. Defaults to verification.screenshotThreshold (0.1). Lower is stricter. |
maxDiffRatio |
Maximum fraction of pixels that may differ, 0–1. Defaults to verification.maxScreenshotDiffRatio (0.01). |
Without an approved baseline screenshot there is nothing to compare against, so the check is unverified. That includes every nono replay run, because replay does not load the baseline. Screenshots of different sizes count as 100% different. Masked regions are painted over in both the baseline and the current screenshot, so they never differ.
dom#
An element at a checkpoint has the expected count or attribute. This is evaluated against the live page, not against the baseline.
- type: dom
selector: "[data-testid^='product-']"
count: 4
checkpoint: cart
| Field | Description |
|---|---|
selector |
CSS selector (required). |
count |
Expected number of matching elements. |
attribute |
Attribute that must be present on the first match. |
value |
Expected value of attribute. |
checkpoint |
Defaults to final. |
With neither count nor attribute, the check passes if at least one element matches. Whole-page DOM changes against the baseline are reported separately as dom_changed regressions; see Baselines.
Choosing assertions#
- Assert on outcomes, not implementation: a visible confirmation, a
201, a single request. - Pair a UI assertion with a network assertion. The UI can look correct while the backend received two orders.
- Keep
screenshotchecks for stable, meaningful checkpoints; mask dynamic areas. - Mark exploratory checks
required: falseuntil they are stable.