If you want to run the same flow for apps with different app IDs, you can use an external parameter for appId
. Pass the parameter APP_ID
to Maestro:
maestro test -e APP_ID=your.app.id file.yaml
And then refer to it in your flow using ${APP_ID}
:
appId: ${APP_ID}
---
- launchApp
Values with dollar signs can be interpreted as variables. To avoid this, escape the dollar characters.
- assertVisible: \$150 in Cash
To assert on values that exist on different screens, store them in variables.
# Perform steps to navigate to first value, then:
- copyTextFrom:
id: 'listView1'
- evalScript: ${output.firstPrice = maestro.copiedText}
# Perform steps to navigate to the second value, then:
- copyTextFrom:
id: 'detailView'
- evalScript: ${output.secondPrice = maestro.copiedText}
# Compare the values:
- runFlow:
when:
true: ${output.firstPrice === output.secondPrice}
commands:
- evalScript: ${console.log('Prices match! Both are ' + output.secondPrice)}