Skip to main content

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.

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.
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 a fileType, a readable kebab-case id, an optional url, and a list of steps:
checkout.test.yaml
fileType: momentic/test/v2
id: checkout-happy-path
url: https://shop.example.com
steps:
  - click: Checkout
  - type:
      text: [email protected]
      into: Email input
  - assert: An order confirmation is visible
A module has the same shape but uses fileType: momentic/module/v2 and a moduleId instead of id.
log-in.module.yaml
fileType: momentic/module/v2
moduleId: log-in
name: Log in
parameters:
  - USERNAME
  - PASSWORD
defaultParameters:
  USERNAME: [email protected]
steps:
  - type:
      text: "{{ env.USERNAME }}"
      into: Email input
  - type:
      text: "{{ env.PASSWORD }}"
      into: Password input
  - click: Log in
Module parameters are a list of variable names. 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:
    - click:
        on: Submit
        timeout: 5000
    - type:
        text: [email protected]
        into: Email input
        pressEnter: true
    - scrollDown:
        pixels: 500
        in: Results panel
    
  • An AI action: - act: <goal>, or a detailed form with goal and version.
  • A module invocation: - module: <relative path>, or a detailed form with path and inputs.
  • A conditional with one if key:
    - if:
        condition:
          assert: A success banner is visible
        then:
          - click: Continue
        else:
          - click: Retry
    
Detailed options always live under the command key; sibling top-level keys are rejected. Shared metadata such as 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:
CommandDescription key
click, doubleClick, rightClick, hover, focuson
visualDiffon
assert, assertVisualthat
typeinto
selectfrom
scrollUp, scrollDown, scrollLeft, scrollRightin
dragAndDropfrom, to
fileUploadpath
navigate, newTaburl
CSS targeting uses css. Coordinate targeting uses coords for numeric pairs, or split x / y when either coordinate needs templating:
- click:
    on: Submit
- click:
    css: "button[type='submit']"
- click:
    coords: 120, 240
- click:
    x: 120
    y: "{{ env.SUBMIT_Y }}"

Command aliases

Common command aliases:
CategoryAliases
Interactclick, doubleClick, rightClick, type, select, hover, focus, blur
DragdragAndDrop
ScrollscrollUp, scrollDown, scrollLeft, scrollRight
Keyboardpress, keyDown, keyUp, copy, paste
Navigationnavigate, newTab, switchTab, closeTab, goBack, goForward, refresh
Waitswait, waitForUrl, waitForUrlNotToMatch
AIact, assert, assertVisual, extract
Page assertionscheckPageContains, checkPageDoesNotContain
Networkheader, mock, removeRouteMock, request, graphqlRequest, registerRequestListener, awaitListener, recordRequests, getRecordedRequests
Storagecookie, localStorage
Files / authfileUpload, javascript, authLoad, authSave
Miscdialog, 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

- act: Sign in with the default account
- act:
    goal: Use the legacy planner for this step
    version: "2"
- assert: The dashboard chart is visible and not cut off
- assertVisual:
    that: The chart is visible
    timeout: 10000
- extract:
    goal: The discounted subtotal in the order summary
    schema:
      type: object
      properties:
        amount:
          type: number
      required: [amount]
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:
steps:
  - module:
      path: ../modules/log-in.module.yaml
      inputs:
        USERNAME: "{{ env.QA_EMAIL }}"
        PASSWORD: "{{ env.QA_PASSWORD }}"
When a module takes no inputs, the scalar form is enough:
steps:
  - module: ../modules/log-in.module.yaml
See Modules for parameters, defaults, and caching.

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.
steps:
  - javascript: ./scripts/setup.js
  - authLoad: ./auth-state.json
after:
  - authSave: ./auth-state.json

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.

Durations

Every duration written in v2 is milliseconds. Format converters translate to and from the internal second-based fields automatically:
- assertVisual:
    that: The chart is visible
    timeout: 10000 # 10 seconds

IDs

The format omits per-step and per-command IDs from disk. The runtime mints fresh internal IDs on load. Step-cache continuity across saves is preserved by the snapshot identity cache, so cached steps stay cached after a reorder or file move when the content is stable. See Step cache and Auto-heal for cache behavior on reruns.