Branching control flow. The body ofDocumentation Index
Fetch the complete documentation index at: https://momentic.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
if declares exactly one condition
(assert, assertVisually, checkPageContains, checkPageDoesNotContain,
javascript, or any checkElement...) plus a then array. A failing condition
skips the then block rather than failing the test.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
<condition> | AssertionCondition | Yes | Exactly one assertion condition at the top level. See description. |
then | Step[] | Yes | Steps to run when the condition is true. |
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. |
comment | string | No | Free-form annotation kept with the step. |