- CLI flags (e.g.
--env-file,--env) - The enclosing shell when
inheritFromShell: trueis set on an environment momentic.config.yaml, either inline underenvVariablesor loaded from anenvFile/ JSON file
environments for the full
schema.
Reserved variables
These are set automatically at runtime and accessible in any step via{{ env.NAME }}:
| Variable | Description |
|---|---|
BASE_URL | Base URL of the current environment |
CURRENT_URL | URL of the page being tested |
ENV_NAME | Name of the current environment |
TEST_NAME | Name of the test being executed |
Runtime variables
Required by the CLI, MCP server, and dashboard integrations:| Variable | Purpose |
|---|---|
MOMENTIC_API_KEY | Authenticates with the dashboard. Required for CI, MCP, and uploads. |
CI | When set to true, enables CI-only behavior (e.g. cache saving). |
MOMENTIC_LOG_LEVEL | debug, info (default), warn, error. |
Accessing in tests
Use the templating syntax anywhere a step accepts a string:env.VARIABLE directly inside a JavaScript step.
Setting at runtime
UsesetVariable inside a JavaScript step to write a variable: