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:
maestro test -e [email protected] -e PASSWORD=123 file.yaml
And then refer to them in your flow using ${name} notation:
appId: your.app.id
---
- launchApp
- inputText: ${USERNAME}
- tapOn: Next
- inputText: ${PASSWORD}
In a similar fashion, parameters can be passed to maestro cloud command:
maestro cloud -e [email protected] PASSWORD=123 app.apk file.yaml

Inline parameters

Constants can be declared at the flow file level, above the --- marker:
appId: your.app.id
env:
PASSWORD: 123
---
- inputText: ${USERNAME}
- inputText: ${PASSWORD}
Alternatively, they can be passed to a runFlow command:
appId: your.app.id
---
- runFlow:
file: subflow.yaml
env:
PASSWORD: 123
Constants defined in a nested flow override parameters with the same name in the parent flow.