Momentic tests and modules are YAML files. The on-disk format favors readable, human-editable shapes: single-key command aliases, natural-language targets, and no volatile IDs.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.
This is the current web format. Mobile tests still use the previous verbose
shape; existing mobile tests keep working without changes.
File shapes
A test is YAML with afileType, a readable kebab-case id, an optional url,
and a list of steps:
checkout.test.yaml
fileType: momentic/module/v2 and a
moduleId instead of id.
log-in.module.yaml
defaultParameters is an
optional map of fallback values used when an invocation does not supply an input
for the parameter.
Step shapes
Every step is one of:-
A bare command alias for commands that take no options:
- refresh,- goBack,- goForward,- paste,- offline,- online,- authSave,- blur. -
A simplified single-key scalar:
- click: Submit. The string is the natural-language description of the target. -
A detailed single-key object when the command needs more than a description:
-
An AI action:
- act: <goal>, or a detailed form withgoalandversion. -
A module invocation:
- module: <relative path>, or a detailed form withpathandinputs. -
A conditional with one
ifkey:
retries, skipped, comment, env, and
envKey can be set on any step.
Targets
Target-bearing commands accept either a natural-language description, a CSS selector, or absolute coordinates. The description key varies by command:| Command | Description key |
|---|---|
click, doubleClick, rightClick, hover, focus | on |
visualDiff | on |
assert, assertVisual | that |
type | into |
select | from |
scrollUp, scrollDown, scrollLeft, scrollRight | in |
dragAndDrop | from, to |
fileUpload | path |
navigate, newTab | url |
css. Coordinate targeting uses coords for numeric pairs,
or split x / y when either coordinate needs templating:
Command aliases
Common command aliases:| Category | Aliases |
|---|---|
| Interact | click, doubleClick, rightClick, type, select, hover, focus, blur |
| Drag | dragAndDrop |
| Scroll | scrollUp, scrollDown, scrollLeft, scrollRight |
| Keyboard | press, keyDown, keyUp, copy, paste |
| Navigation | navigate, newTab, switchTab, closeTab, goBack, goForward, refresh |
| Waits | wait, waitForUrl, waitForUrlNotToMatch |
| AI | act, assert, assertVisual, extract |
| Page assertions | checkPageContains, checkPageDoesNotContain |
| Network | header, mock, removeRouteMock, request, graphqlRequest, registerRequestListener, awaitListener, recordRequests, getRecordedRequests |
| Storage | cookie, localStorage |
| Files / auth | fileUpload, javascript, authLoad, authSave |
| Misc | dialog, captcha, offline, online, visualDiff |
doubleClick: Submit is shorthand for click: { on: Submit, times: 2 }, and
rightClick: Submit is shorthand for click: { on: Submit, rightClick: true }.
AI actions and assertions
assert fails the test by default. extract fails the step when the extracted
payload does not conform to the schema.
See Agentic testing,
Writing assertions, and
Variables for usage patterns.
Modules
Module invocations resolve relative to the file that contains the invocation:File references
Relative file references resolve from the YAML file containing the step, not from the project root and not from the test file when the step is inside a module.Variables and templating
Any string field can include{{ expression }} templating, evaluated at runtime
against the test’s env map. See Variables for
setting and reading values across steps.