> ## Documentation Index
> Fetch the complete documentation index at: https://momentic.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# assert

> Run an AI assertion against the DOM, accessibility tree, and screenshot.

The agent inspects the current page state and returns whether the assertion
holds. Use for semantic checks that are awkward to express as a CSS selector or
substring match.

## Parameters

| Parameter | Type      | Required | Description                                                           |
| --------- | --------- | -------- | --------------------------------------------------------------------- |
| `that`    | `string`  | Yes      | What must be true on the page.                                        |
| `timeout` | `number`  | No       | Maximum time in milliseconds to wait for the assertion to hold.       |
| `iframe`  | `string`  | No       | URL or URL pattern of the iframe that contains the target element.    |
| `saveAs`  | `string`  | No       | Name of the variable to write this step's return value to.            |
| `retries` | `number`  | No       | Number of times to retry the step on failure before failing the test. |
| `skipped` | `boolean` | No       | Skip this step at execution time.                                     |

## Shorthand

Assertion text as a single string.

```yaml theme={null}
- assert: vue is selected
```

## Examples

```yaml theme={null}
- assert:
    that: |
      the AI action step (the topmost step on the left, with goal text about
      clicking the Visible Button) has a green check icon next to it
      indicating the step succeeded
    timeout: 90000
```

```yaml theme={null}
- assert:
    that: |
      the only step in the test (an AI_EXTRACT step) has a green check icon
      next to it indicating the step succeeded
    timeout: 60000
```

```yaml theme={null}
- assert:
    that: |
      there is a message saying file upload finished
    DANGEROUS_FORCE_DYNAMIC: false
```

## Related

* [Writing assertions](/core-concepts/writing-assertions)
* [Test format](/core-concepts/test-format)
