assert - Momentic

Documentation Index

Fetch the complete documentation index at: /docs/llms.txt

Use this file to discover all available pages before exploring further.

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. For visual-first checks whose condition is fully visible in the current viewport, prefer assertVisually.

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.

- assert: vue is selected

Examples

- 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
- 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
- assert:
    that: |
      there is a message saying file upload finished