momentic
by using a momentic.config.yaml
file in your project root directory. Each configuration file represents a project.
Paths are relative to the location of momentic.config.yaml
or absolute paths. Globs are relative to the location of momentic.config.yaml
.
Global options
name
momentic.config.yaml
include
momentic.config.yaml
exclude
momentic.config.yaml
node_modules
, .git
, and .venv
are always excluded.
The default directory Momentic will write to when creating a new module.
goldenFileDir
momentic.config.yaml
reporterDir
momentic.config.yaml
retries
momentic.config.yaml
retries
option set on the test.
parallel
momentic.config.yaml
1
The number of tests to run in parallel. This is useful for speeding up test execution, especially for large test suites. Set to 1
to run tests sequentially.
gitMainBranch
momentic.config.yaml
gitProtectedBranches
momentic.config.yaml
Defining environments
environments
Each object in the environments
list defines a different environment for running tests. Each environment defines a set of key-value pairs which are available to tests as variables.
In the example below, we’ve defined three environments: dev
, staging
, and production
.
momentic.config.yaml
Environment options
name
momentic.config.yaml
env.ENV_NAME
in tests.
baseUrl
momentic.config.yaml
env.BASE_URL
in tests.
envVariables
momentic.config.yaml
env.VARIABLE_NAME
. They can be used to store sensitive information like API keys or credentials.
Interpolation is supported, so you can reference shell variables. You cannot reference other variables defined in the same environment.
inheritFromShell
momentic.config.yaml
false
Include all values from the enclosing shell as environment variables at runtime.
envFile
momentic.config.yaml
.env
file, with each line containing a key-value pair. Momentic will load these variables and make them available to tests as env.VARIABLE_NAME
.
JSON file
momentic.config.yaml
fromFile
option specifies the path to the file, and the json
option indicates that the file is in JSON format. The variables will be available as env.VAR_FROM_FILE
.
Browser options
browser
Configure default browser settings for all tests in the project. Individual tests can override these settings.
momentic.config.yaml
pageLoadTimeoutMs
momentic.config.yaml
8000
How long to wait for a page to load before timing out, in milliseconds. This includes new tabs and navigation events.
smartWaitingTimeoutMs
momentic.config.yaml
5000
Configure the maximum timeout for smart waiting, in milliseconds. This controls how long Momentic will wait for the page to stabilize before proceeding from one step to the next.
localChromeExtensionPaths
momentic.config.yaml
extraHeaders
momentic.config.yaml
userAgent
momentic.config.yaml
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.7103.25 Safari/537.36
The user agent string to use for all requests made by the browser.
disableGpu
momentic.config.yaml
false
Whether to disable intensive graphical operations, such as WebGL and rasterization with hardware acceleration. Disabling can significantly increase performance, however some graphics libraries may require it.
autoExpandIframes
momentic.config.yaml
false
Automatically expand iframes. This allows Momentic to interact with elements inside iframes without needing to configure the Act within iframe option.
autoFollowNewTabs
This option is deprecated and will be removed in the future. Waiting for new
tabs to open is inherently racy, as client-side JavaScript may not open the
tab before Momentic continues onto the next step. Please use Switch
Tab steps to explicitly switch to new tabs instead.
momentic.config.yaml
false
Automatically switch to new tabs that are opened during test execution.
allowPartialAccessibilityTree
momentic.config.yaml
false
Momentic uses the accessibility tree as context for several AI agents. However, some sites can fail to load the complete accessibility tree due to third-party iframes, embedded videos, or misconfigured script tags. Enable this setting to allow using partial sections of the accessibility tree.
ignoreHttpsErrors
momentic.config.yaml
false
Ignore HTTPS errors, such as self-signed certificates and certificate errors. Useful for testing internal or development environments that use self-signed certificates.
showZeroOpacityElements
We strongly recommend using hover steps to reveal hidden
elements before interacting with them.
momentic.config.yaml
false
Filter out elements with zero opacity from the page context that is passed to Momentic’s locator AI agent. In addition, prevent interactive steps from targeting elements that have opacity 0. This improves AI performance and more closely mimics the behavior of a human user.
This option never affects element check steps, which are commonly used to locate and verify hidden elements.
When this option is set to false
, users may need to add hover or scroll steps to reveal hidden elements before interacting with them.
When this option is set to inputs-only
, <input>
elements that are zero opacity are still shown. This is useful for sites that use UI frameworks that rely on hidden inputs for styling reasons.
ignoreHrefForCaching
momentic.config.yaml
false
Ignore the href
attribute when determining whether cache entries can be reused for anchor elements. This can greatly improve speed for sites that use auto-generated or dynamic links. href
attributes are only ignored if the anchor element has some text content (either as a direct child or in some nested element).
disableSecondaryCacheResolution
momentic.config.yaml
false
Disable secondary cache resolution methods, which include using HTML l-dist and template matching. These methods are less accurate and may cause instances where step caches resolve to the wrong element, but can improve test speed.
hybridSelectorMode
Hybrid selectors are in beta and subject to be deprecated in the future.
Disable cache
to ensure the correct element is always targeted.
momentic.config.yaml
off
Options:
off
: Disable hybrid selectors altogether. Equivalent to omitting this field entirely.test
: Enable hybrid selectors for element resolution, and report mismatches to Momentic.prefer
: Enable hybrid selectors for element resolution and prefer using them over traditional selectors. If no elements are discovered using hybrid selectors, falls back to CSS selectors.
bustCacheOnBoundingBoxChange
momentic.config.yaml
false
Whether to force busting locator caches when the bounding box of an element changes.
globalLocatorRedirect
momentic.config.yaml
true
During interactive steps, use Momentic’s custom algorithm for determining the “top-most” element that should be interacted with. Sometimes, functional HTML elements can be covered by other presentational HTML elements. For example, many UI frameworks employ hidden inputs that are covered by styled <div>
or <label>
elements that users actually interact with when clicking. While other frameworks such as Playwright throw errors or require users to explicitly bypass stability checks in this case, Momentic’s algorithm can determine the top-most element that still intersects with the original bounding box and interact with that element instead.
For customers who desire more manual control over how to handle cases where an element is covered by another element, you can opt out of this feature. The “Disable stability checks” option on interactive steps can also be used to force interactions with covered elements, similar to Playwright’s force setting.
visualActions
momentic.config.yaml
false
Use a heuristic to determine x, y coordinates of the element and use them to perform actions like clicking, hovering, or typing.
importantAttributes
momentic.config.yaml
data-test-id
and aria-label
are automatically considered important.
Values may contain a single *
at the end to indicate a prefix match, such as data-test-*
.
importantClasses
momentic.config.yaml
*
at the end to indicate a prefix match, such as home-page-*
.
importantStyles
Adding common styles to this list will dramatically increase the size of the
context passed to AI agents, which slowing down tests significantly and
reducing AI performance. We recommend using this setting sparingly.
momentic.config.yaml
property:value
, such as width:100px
. A value of *
matches any value. Note that custom CSS variables (i.e. those starting with --
) are not supported.
AI options
ai
Configure AI features for the project.
momentic.config.yaml
agentConfig
momentic.config.yaml
failureRecovery
Failure recovery is in beta and subject to be deprecated in the future.
momentic.config.yaml
false
Enable Failure recovery to automatically recover from certain test failures by proposing and executing step changes.
aiFailureAnalysis
momentic.config.yaml
false
Enable AI failure analysis for failed test runs. When a run fails, Momentic analyzes the error to classify a likely root cause, summarize previous steps, and generate an error summary. The analysis appears in the Run Viewer under the “AI failure analysis” tab.
aiAction
AI action is in beta and subject to be deprecated in the future.
momentic.config.yaml
false
Enable AI action as a step in the Momentic Editor. This allows you to use AI to generate actions based on natural language instructions.
stepLintSuggestions
momentic.config.yaml
true
Enable AI step linting suggestions. This will provide suggestions for improving the quality of your test steps, such as removing unnecessary steps or optimizing existing ones.
aiPageFiltering
momentic.config.yaml
false
Enables page chunking and filtering if the page is too large. This allows Momentic to handle large pages more efficiently by breaking them into smaller chunks and filtering out unnecessary content.
Advanced options
advanced
Configure advanced settings for the project.
momentic.config.yaml
fakerConstantSeed
momentic.config.yaml
false
Use a constant seed for the Faker library to ensure that random data generated by Faker is consistent across test runs. This can be useful for debugging and ensuring that tests are reproducible.