> ## 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.

# Web commands

> Every command available inside a Momentic web YAML test.

This is the reference for every command that lives inside a web test or module's
`steps`, `before`, or `after` array. Each page documents the parameters,
shorthand form, and idiomatic examples for a single command. For mobile tests,
see [Mobile commands](/reference/mobile-commands/index).

See [Test format](/core-concepts/test-format) for the global file shape and
[Modules](/core-concepts/modules) for how to call modules from a test.

## AI

| Command                                                 | Summary                                                                   |
| ------------------------------------------------------- | ------------------------------------------------------------------------- |
| [`act`](/reference/commands/act)                        | Run an AI agent that performs actions to satisfy a natural-language goal. |
| [`assert`](/reference/commands/assert)                  | Run an AI assertion against the DOM, accessibility tree, and screenshot.  |
| [`assertVisually`](/reference/commands/assert-visually) | Run an AI assertion using a screenshot only.                              |
| [`extract`](/reference/commands/extract)                | Pull a value off the page with the AI agent and save it to `env`.         |

## Mouse

| Command                                            | Summary                                                          |
| -------------------------------------------------- | ---------------------------------------------------------------- |
| [`blur`](/reference/commands/blur)                 | Remove keyboard focus from an element (or the active element).   |
| [`click`](/reference/commands/click)               | Click an element identified by description, CSS, or coordinates. |
| [`doubleClick`](/reference/commands/double-click)  | Double-click an element.                                         |
| [`dragAndDrop`](/reference/commands/drag-and-drop) | Drag from one element or position to another.                    |
| [`focus`](/reference/commands/focus)               | Move keyboard focus to an element.                               |
| [`hover`](/reference/commands/hover)               | Hover the mouse over an element.                                 |
| [`mouseDrag`](/reference/commands/mouse-drag)      | Drag the mouse a relative delta from an origin.                  |
| [`rightClick`](/reference/commands/right-click)    | Right-click an element to open a context menu.                   |

## Keyboard

| Command                                   | Summary                                                      |
| ----------------------------------------- | ------------------------------------------------------------ |
| [`copy`](/reference/commands/copy)        | Write a value to the system clipboard.                       |
| [`keyDown`](/reference/commands/key-down) | Press a key down without releasing it.                       |
| [`keyUp`](/reference/commands/key-up)     | Release a previously pressed key.                            |
| [`paste`](/reference/commands/paste)      | Paste the current clipboard contents.                        |
| [`press`](/reference/commands/press)      | Press a key or key combination.                              |
| [`select`](/reference/commands/select)    | Pick an option from a `<select>` dropdown.                   |
| [`type`](/reference/commands/type)        | Type text into an input, optionally clearing and submitting. |

## Form

| Command                                         | Summary                                               |
| ----------------------------------------------- | ----------------------------------------------------- |
| [`fileUpload`](/reference/commands/file-upload) | Attach a file to the next file picker the page opens. |

## Scroll

| Command                                           | Summary                               |
| ------------------------------------------------- | ------------------------------------- |
| [`scrollDown`](/reference/commands/scroll-down)   | Scroll the page or a container down.  |
| [`scrollLeft`](/reference/commands/scroll-left)   | Scroll the page or a container left.  |
| [`scrollRight`](/reference/commands/scroll-right) | Scroll the page or a container right. |
| [`scrollUp`](/reference/commands/scroll-up)       | Scroll the page or a container up.    |

## Navigation

| Command                                       | Summary                                                      |
| --------------------------------------------- | ------------------------------------------------------------ |
| [`closeTab`](/reference/commands/close-tab)   | Close the active tab or a matching tab.                      |
| [`goBack`](/reference/commands/go-back)       | Navigate back in the browser history.                        |
| [`goForward`](/reference/commands/go-forward) | Navigate forward in the browser history.                     |
| [`navigate`](/reference/commands/navigate)    | Navigate the current tab to a URL.                           |
| [`newTab`](/reference/commands/new-tab)       | Open a URL in a new tab and switch to it.                    |
| [`refresh`](/reference/commands/refresh)      | Reload the current page.                                     |
| [`switchTab`](/reference/commands/switch-tab) | Switch the active tab by index, URL substring, or URL regex. |

## Waits

| Command                                                                 | Summary                                                                     |
| ----------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| [`wait`](/reference/commands/wait)                                      | Pause execution for a fixed duration in milliseconds.                       |
| [`waitForUrl`](/reference/commands/wait-for-url)                        | Wait until the page URL matches a substring, glob, regex, or domain.        |
| [`waitForUrlNotToMatch`](/reference/commands/wait-for-url-not-to-match) | Wait until the page URL stops matching a substring, glob, regex, or domain. |

## Page checks

| Command                                                                      | Summary                                                         |
| ---------------------------------------------------------------------------- | --------------------------------------------------------------- |
| [`checkPageContains`](/reference/commands/check-page-contains)               | Assert that the visible page text contains a substring.         |
| [`checkPageDoesNotContain`](/reference/commands/check-page-does-not-contain) | Assert that the visible page text does NOT contain a substring. |

## Element checks

| Command                                                                | Summary                                                                 |
| ---------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [`checkElement`](/reference/commands/check-element)                    | Element-level assertion family for the element itself.                  |
| [`checkElementAttribute`](/reference/commands/check-element-attribute) | Element-level assertion family for an HTML attribute on the element.    |
| [`checkElementContent`](/reference/commands/check-element-content)     | Element-level assertion family for the element's text content.          |
| [`checkElementName`](/reference/commands/check-element-name)           | Element-level assertion family for the element's tag name.              |
| [`checkElementStyle`](/reference/commands/check-element-style)         | Element-level assertion family for a computed CSS style on the element. |

## Network

| Command                                                                    | Summary                                                          |
| -------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| [`awaitListener`](/reference/commands/await-listener)                      | Block until a previously registered listener captures a request. |
| [`getRecordedRequests`](/reference/commands/get-recorded-requests)         | Retrieve the list of requests captured by `recordRequests`.      |
| [`graphqlRequest`](/reference/commands/graphql-request)                    | Make a server-side GraphQL request and capture the response.     |
| [`header`](/reference/commands/header)                                     | Set an HTTP request header on outgoing requests.                 |
| [`mock`](/reference/commands/mock)                                         | Intercept a network route and return a custom response.          |
| [`recordRequests`](/reference/commands/record-requests)                    | Start recording every request that matches a URL pattern.        |
| [`registerRequestListener`](/reference/commands/register-request-listener) | Start listening for requests that match a URL pattern.           |
| [`removeRouteMock`](/reference/commands/remove-route-mock)                 | Remove a previously installed route mock by key.                 |
| [`request`](/reference/commands/request)                                   | Make an out-of-band HTTP request and capture the response.       |

## Storage

| Command                                             | Summary                                            |
| --------------------------------------------------- | -------------------------------------------------- |
| [`cookie`](/reference/commands/cookie)              | Set a browser cookie via a `name=value` string.    |
| [`localStorage`](/reference/commands/local-storage) | Write a key/value pair into `window.localStorage`. |

## Authentication

| Command                                     | Summary                                                                 |
| ------------------------------------------- | ----------------------------------------------------------------------- |
| [`authLoad`](/reference/commands/auth-load) | Restore browser auth state from a Playwright storage-state file.        |
| [`authSave`](/reference/commands/auth-save) | Save the current browser auth state to a Playwright storage-state file. |

## Visual

| Command                                         | Summary                                                         |
| ----------------------------------------------- | --------------------------------------------------------------- |
| [`captcha`](/reference/commands/captcha)        | Solve a captcha challenge on the current page.                  |
| [`dialog`](/reference/commands/dialog)          | Auto-handle the next browser dialog (alert/confirm/prompt).     |
| [`visualDiff`](/reference/commands/visual-diff) | Compare a viewport or element screenshot against a golden file. |

## Connectivity

| Command                                  | Summary                                   |
| ---------------------------------------- | ----------------------------------------- |
| [`offline`](/reference/commands/offline) | Put the browser into offline mode.        |
| [`online`](/reference/commands/online)   | Restore the browser's network connection. |

## Scripts

| Command                                        | Summary                                           |
| ---------------------------------------------- | ------------------------------------------------- |
| [`javascript`](/reference/commands/javascript) | Run arbitrary JavaScript inside the test runtime. |

## Control flow

| Command                                | Summary                                           |
| -------------------------------------- | ------------------------------------------------- |
| [`if`](/reference/commands/if)         | Run a block of steps only when a condition holds. |
| [`module`](/reference/commands/module) | Invoke a reusable module of steps.                |

## Bare commands

These commands can be written as single-key scalars without an object payload:

* [`authSave`](/reference/commands/auth-save)
* [`blur`](/reference/commands/blur)
* [`captcha`](/reference/commands/captcha)
* [`closeTab`](/reference/commands/close-tab)
* [`goBack`](/reference/commands/go-back)
* [`goForward`](/reference/commands/go-forward)
* [`offline`](/reference/commands/offline)
* [`online`](/reference/commands/online)
* [`paste`](/reference/commands/paste)
* [`refresh`](/reference/commands/refresh)
* [`visualDiff`](/reference/commands/visual-diff)
