baseUrl
and a set of variables available to tests as
env.*.
momentic.config.yaml
Select an environment
Momentic reads the environment name from--env <name> first, then from
defaultEnv in the test file.
There is no fallback. A test does not use the only environment in the config
automatically. If neither value is set, no environment resolves.
Pair the environment name in your config with defaultEnv in the test:
momentic.config.yaml
checkout.test.yaml
--url-override first, then the test’s own url, then
env.BASE_URL from the selected environment. A test that sets url therefore
keeps that URL in every environment. If no value is available, the run fails
with:
Mobile tests
A mobile test selects its environment the same way, throughdefaultEnv and
--env. Mobile has no base URL. The app comes from a
channel and a tag
instead:
checkout.test.yaml
defaultChannel names the channel to install from, and --channel overrides
it. defaultTag accepts a tag or an alias such as nightly, and --tag
overrides it. defaultTag is optional: without it, Momentic installs the latest
tag in the channel. In the local region, the test installs
defaultApkFilePath or defaultAppFilePath from your machine, and the channel
and the tag are unused.
Environment isolation
By default, Momentic shares cache entries across environments in the same project. This keeps repeat runs fast whendev, staging, and production
render the same UI.
If environments have different DOM structures, mobile screens, feature flags, or
environment-specific IDs, enable
advanced.isolateCachesByEnvironment.
When enabled, Momentic stores separate step cache
entries for each selected environment, so a cache learned in staging will not
replay in production.
momentic.config.yaml
Per-environment options
string
Name of the environment. Selected at runtime via
--env <name> or
defaultEnv in the test file, and exposed to tests as env.ENV_NAME.momentic.config.yaml
string
Starting URL for tests in this environment. Exposed as
env.BASE_URL.momentic.config.yaml
Record<string, string | { fromFile: string; json?: boolean }>
Key-value pairs available to tests as Use the
env.VARIABLE_NAME. Values may
reference shell variables via
dotenvx interpolation,
but cannot reference other variables defined in the same envVariables
block.momentic.config.yaml
fromFile form to load values from a JSON file:momentic.config.yaml
boolean
Include every variable from the enclosing shell at runtime. Default:
false.momentic.config.yaml
string
Path to a
.env-format file to load. Each line is a KEY=VALUE pair; values
become env.VARIABLE_NAME.momentic.config.yaml
{ server: string; username?: string; password?: string }
HTTP proxy configuration scoped to this environment.
server must include
the protocol (http:// or https://), host, and port.momentic.config.yaml
Secrets
Keep passwords, API tokens, and other secrets out ofmomentic.config.yaml and
out of version control. Provide them at runtime through one of these; the
resolved values are still read in tests as env.*:
- .env file
- Shell / CI secrets
Point an environment at a
.env-format file with
envFile and keep that file out of git
(.gitignore). Each KEY=VALUE line becomes env.KEY.momentic.config.yaml
.secrets.env
Your Momentic API key is a secret too. Export it as
MOMENTIC_API_KEY rather
than committing it; see API keys.