momentic) and mobile (momentic-mobile) are separate CLIs that share
this format. The shapes on this page apply to both; only the command set and
targeting differ. For the full list of commands, see the
Web steps reference and the
Mobile steps reference.
File shapes
A test is YAML with afileType, a readable kebab-case id, and a list of
steps. A module uses a module fileType and adds a human-readable name.
Both use the same id key for their stable identifier.
- Web
- Mobile
A web test sets the starting
url.checkout.test.yaml
log-in.module.yaml
{ name, default?, enum? }. default is a value
object ({ string } or { javascript }) used when an invocation does not
supply an input for that parameter.
Before and after sections
Alongsidesteps, a test can declare optional before and after sections.
They are sibling top-level keys with the same step shape as steps. In the
editor these are the Setup (before) and Teardown (after) sections.
checkout.test.yaml
beforeruns first, thensteps, thenafter.- If a
beforestep fails, the main steps are skipped and the test is marked as a setup failure. afterruns after the main steps regardless of whether they passed, which makes it the right place for teardown (resetting state, deleting test data).
before for prerequisites the main steps assume, most commonly
authentication.
Step shapes
Every step is one of:- A bare command alias for commands that take no options (web:
- refresh,- goBack; mobile:- killApp,- openNotifications). - A simplified single-key scalar where the string is the target description
(
- click: Submit,- tap: the Submit button). - 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 id>, or a detailed form withpathandinputs. - A conditional with one
ifkey.
retries, skipped, comment, and saveAs
can be set on any step. saveAs stores the step’s return value on env.<NAME>
for later steps to read.
Targets
Target-bearing commands take a natural-language description of the element. The key name varies by command (on, into, from, that, and so on), which the
command reference lists per command.
- Web
- Mobile
Web commands also accept a CSS selector (
css) or absolute coordinates
(coords, or split x / y when a coordinate needs templating).Commands
Each command is a single-key alias. The available commands differ by platform:- Web: clicks, navigation, tabs, storage, and network mocking. See the Web steps reference.
- Mobile: taps, swipes, device buttons, and app lifecycle. See the Mobile steps reference.
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 performs a goal in natural language. assert checks a condition and fails
the test by default. extract pulls a value and fails the step when the payload
does not match its schema, storing the result on env.<saveAs>.
Element checks
checkElement<...> aliases are deterministic assertions against a single
element. They take a target and, where relevant, a name and value. Aliases
compose a subject and a condition:
- Subjects:
Element(existence-style:Exists,Visible,Enabled,Editable,Focused),ElementContent,ElementAttribute,ElementName,ElementStyle(content-style:Contains,Equals,StartsWith). - Each positive condition has a paired negation, e.g.
DoesNotExist,NotVisible,DoesNotContain,DoesNotEqual,DoesNotStartWith.
- Web
- Mobile
The target is
element (or css / coords / x+y).Conditionals
A conditional is a singleif key holding exactly one condition plus a then
list. The condition is an inline assert, an element or screen check, or a
javascript expression. There is no else; use a separate step instead.
Modules
Module invocations reference a module file with a path relative to the file that contains the invocation:inputs is one of:
- A shorthand string, evaluated as a JavaScript expression. Use this to
reference env vars (
env.PARAM) or call helpers. It is not mustache templating. { string: ... }: a literal string.{ javascript: ... }: the script’s return value is bound to the parameter.
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. Use saveAs on any step to write its return value
to env.<NAME> for later steps. See Variables for
setting and reading values across steps.
Durations
Every duration written in the simplified format is milliseconds. Format converters translate to and from the internal second-based fields automatically: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.Related
- Web steps reference: the full web command set.
- Mobile steps reference: the full mobile command set.
- Modules, Variables, and Writing assertions.
- Migrate to the simplified format.