> ## 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.

# assertVisually

> Run an AI assertion about the screen using a screenshot only.

Same shape as [`assert`](/reference/mobile-commands/assert), but the agent
reasons over the screenshot rather than the accessibility/XML hierarchy. Reach
for it when the screen is rendered in a way the hierarchy cannot describe (for
example a WebView with multiple pages) or when the condition is purely visual,
such as color, layout, icons, or charts. The simplified form takes the condition
as a single string.

## Parameters

| Parameter | Type      | Required | Description                                                  |
| --------- | --------- | -------- | ------------------------------------------------------------ |
| `that`    | `string`  | Yes      | What must be true on the screen, purely from the screenshot. |
| `timeout` | `number`  | No       | Milliseconds to wait for the condition to become true.       |
| `saveAs`  | `string`  | No       | Variable to store this step's return value on `env.<name>`.  |
| `retries` | `number`  | No       | Times to retry the step on failure before failing the test.  |
| `skipped` | `boolean` | No       | Skip this step at execution time.                            |

## Shorthand

Condition as a single string.

```yaml theme={null}
- assertVisually: the cart shows a red error banner above the checkout button
```

## Examples

```yaml theme={null}
- assertVisually:
    that: The dashboard chart is visible and not cut off
    timeout: 10000 # poll for up to 10s before failing
```

## Related

* [Test format](/core-concepts/test-format)
* [Writing assertions](/core-concepts/writing-assertions)
* [Golden files](/guides/visual-testing/golden-files)
