Parameters & Constants
External parameters
There might be cases where you don't want to store certain values in a test file itself (i.e. user name, password, etc.). To solve that, you can pass parameters to Maestro:
And then refer to them in your flow using ${name}
notation:
In a similar fashion, parameters can be passed to maestro cloud
command:
Inline parameters
Constants can be declared at the flow file level, above the ---
marker:
Alternatively, they can be passed to a runFlow
command:
Constants defined in a nested flow override parameters with the same name in the parent flow.
Accessing variables from the shell
Maestro will automatically read environment variables from the shell prefixed by MAESTRO_
and make them available in your Flows, assuming the environment variable is not manually defined in the Flow or passed as an env parameter.
If you define the variable MAESTRO_FOO
as above, you can simply refer to it in your Flows when running maestro test
or maestro cloud
like a normal environment variable:
Parameters and JavaScript
All env
parameters are defined as JavaScript variables under the hood and can be accessed from the JavaScript code.
Last updated