mobile-dev-inc / maestro

Painless Mobile UI Automation
https://maestro.mobile.dev/
Apache License 2.0
5.79k stars 272 forks source link

Allow for using `MAESTRO_APP_ID` env var as `appId` #1789

Open imjn opened 3 months ago

imjn commented 3 months ago

Hello team!

As far as I understand, the shell environment variables that can be accessed in flows need to have MAESTRO_ prefix. https://maestro.mobile.dev/advanced/parameters-and-constants#accessing-variables-from-the-shell

But APP_ID needs to be APP_ID and cannot be MAESTRO_APP_ID. https://maestro.mobile.dev/troubleshooting/frequently-asked-questions#how-can-i-use-the-same-flow-when-my-apps-have-different-app-ids

This makes it impossible to set the APP_ID from the shell environment variable.

So my feature request is that to add a support for the APP_ID to be read from the shell environment variables. It would be useful if I can do this so that I don't have to pass the -e APP_ID=xx every time I run the command.

Thank you!

bartekpacia commented 3 months ago

Hey @imjn! Thanks for taking time to create this issue.

You're right, we should allow for:

appId: ${MAESTRO_APP_ID}
---
- launchAppp
- ...

Would you be up to contribute this fix?