Skip to main content
Momentic stores tests and modules as YAML files in your repository. This page covers the top-level file structure. See Steps for the syntax inside before, steps, and after. Web (momentic) and mobile (momentic-mobile) are separate CLIs that share the same simplified format. Their file types and available top-level fields differ where the platforms require it.

Test and module files

A test has a fileType, a readable kebab-case id, and a list of steps. A module uses a module fileType and adds a human-readable name. Both use id as their stable identifier.
A web test can set its starting url.
checkout.test.yaml
log-in.module.yaml
Each module parameter is { name, default?, enum? }. default is a value object ({ string } or { javascript }) used when an invocation does not supply that parameter. See Modules for parameter defaults, inputs, and caching.

IDs

Every test and module ID must be unique across your Momentic organization. When Momentic creates a file, including through MCP, it assigns a readable slug such as silver-river-lantern. Generated IDs do not have a fixed number of words. Keep the ID if you rename or move the file. When authoring YAML by hand, choose any lowercase kebab-case slug up to 36 characters, such as checkout or guest-checkout. Keep it stable after the file is created. UUID IDs from older files remain valid.

Before and after sections

Tests can declare optional before and after arrays alongside steps. All three arrays use the same step syntax. In the editor, before is Setup and after is Teardown.
checkout.test.yaml
  • before runs first, followed by steps, then after.
  • If a before step fails, the main steps are skipped and the test is marked as a setup failure.
  • after runs after the main steps whether they pass or fail. Use it for teardown such as resetting state or deleting test data.
Use before for prerequisites the main steps assume, most commonly authentication.
before and after run only when the whole test runs. Running a single step, or running from or until a step in the main body, skips both sections. Run the whole test to include setup and teardown.

Step syntax

For commands, targets, AI actions, assertions, control flow, module calls, and shared step options, see Steps.