[Feature] Call external functions within the yaml
Background Sometimes we need to manipulate some other services that we cannot do via the apps UI, it would be useful if we could call some of our own external functions.
Example
In order to log in to my account, I need to enter a pin code sent via text.
I can retrieve this pincode via a /pin endpoint.
By running his function and storing the variable returned, I can continue with my tests
yaml example:
- launchApp
- tapOn:
id: "LoginButton"
- inputText: "+1234567890"
- tapOn:
id: "Next"
- function: loginPin()
output: { LOGIN_PIN }
- inputText: ${{ LOGIN_PIN }}
Is this in any projected roadmap at all?
We would like to keep control over the binary being executed, so can't promise a generic function execution yet. However, a use case of calling an HTTPS endpoint did come up before so we will consider adding it.
+1 We have been exploring the use of Maestro for our e2e tests, but we would need to ability to make http requests for:
- user auth (we have passwordless auth so the only way to auth in an automated environment is through requests with the auth server)
- setting up database data for different flows
Such a feature would be super useful! :)
Any estimates on when that could be added? Or is it not that high priority in your roadmap yet?
@dmitry-zaitsev we're in the same boat as @ksketo. It would be super convenient to be able to make requests to the backend and then verify the change on the frontend. Something like:
- request:
url:
method:
headers:
body:
timeout:
🙏 🙏 Stoked about Maestro btw. Extremely user friendly.
This specific usecase was addressed in Maestro 1.16.0. We have just introduced Javascript support that allows you to send HTTP requests:
https://maestro.mobile.dev/advanced/javascript/make-http-s-requests
This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue. Thank you for helping keep us our issue tracker clean!