How caching works
Caching is automatically applied to most interactive steps such as Click and Type. When these steps are executed, Momentic stores contextual information about the targeted element, including:- CSS selectors and HTML attributes.
- Accessibility roles and metadata.
- Screenshots and visual cues.
- Element location and dimensions.
Cache saving eligibility
A test run is always eligible if the
--save-cache
flag is passed.- If the test is running in a CI environment, the test is eligible for cache saving. This is defined by the environment variable
CI
being set totrue
. - If the test is not running in a CI environment, caches are saved when running on a branch not configured as a main branch or protected branch. These branches are specified in the project configuration.
Where caching is never applied
- Steps like AI check or AI extract which rely on dynamic evaluation.
- Steps with variables that have continuously changing values (e.g.
CLICK the {{ Date.now() }} timer
).
Disabling cache
Disabling cache may drastically increase test duration and non-determinism.
--disable-cache
flag when running tests:
How cache keys are generated
Cache keys are based on:- The step’s unique ID.
- IDs of any parent modules.
- The resolved element description.
- Dynamic template values (e.g.,
{{ env.USERNAME }}
).
Storage and expiration
Cache is:- Securely stored on Momentic Cloud.
- Isolated per organization and only accessible during authenticated test runs.
- Automatically expired after 90 days of inactivity.