--env <name> or the test’s defaultEnv.
The --env flag chooses the environment; it does not assign variable values.
Within that environment, Momentic loads variables in this order. Later sources
override earlier values with the same name:
envVariables, including values loaded withfromFile.- The
envFile. - The enclosing shell, when
inheritFromShell: true.
environments for the full schema.
Secrets
For passwords, API tokens, and other secrets, prefer a.env file or shell or
CI environment variables over inlining values in momentic.config.yaml. See
Secrets for the recommended patterns.
Reserved variables
Momentic sets these at runtime. Access them via{{ env.NAME }}:
BASE_URL and CURRENT_URL apply to web tests. Mobile tests use an app
artifact rather than a browser URL.
Access variables in tests
Use the templating syntax anywhere a step accepts a string:env.VARIABLE directly inside a JavaScript step.
Set variables at runtime
UsesetVariable inside a JavaScript step to write a variable: