Conversation
tonidero
left a comment
There was a problem hiding this comment.
This does seem to work very well for me! Tried a few times, and worked all the times 🙌
Before approving, we might want to move it somewhere else, like "util_flows" or something along those lines, separate from the tests themselves since this flow could potentially be reused for multiple tests. Also, I think we would need to adapt the device where tests run to android 36 or change to use the ADB command for tests to pass.
maestro/google-login.yml
Outdated
There was a problem hiding this comment.
This string seems to only be available in newer android versions (in API 33, it says Passwords and accounts), but as you said in the comments, we might be able to bypass those steps with the adb command above.
There was a problem hiding this comment.
Yes, good point! I thought about being smart with regex, but it seemed simpler and less confusing to make 2 separate flows:
maestro/google-login/api/36.ymlfor API >= 36maestro/google-login/api/32.ymlfor API >= 32
I'm not entirely sure if these are the exact API boundaries, but we can tweak as needed.
There's also a maestro/google-login/google-login.yml file, which selects the right API flow to use based on the API_VERSION parameter that is passed. I'm not sure of a way to automatically get the Android version in Maestro, but we can improve it if we find one. So to be clear, this is how it would work now:
maestro test \
-e API_VERSION=36 \
-e USERNAME=user@example.com \
-e PASSWORD=123 \
google-login.yml;google-login.yml Maestro flow
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2788 +/- ##
=======================================
Coverage 78.24% 78.24%
=======================================
Files 324 324
Lines 12715 12715
Branches 1736 1736
=======================================
Hits 9949 9949
Misses 2036 2036
Partials 730 730 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…e API_VERSION parameter.
This comment was marked as spam.
This comment was marked as spam.
ajpallares
left a comment
There was a problem hiding this comment.
This looks really good! 🤩
Just a couple of small comments
| - repeat: | ||
| while: | ||
| visible: "Cancel" | ||
| commands: | ||
| - tapOn: "Cancel" | ||
| - repeat: | ||
| while: | ||
| visible: "Skip" | ||
| commands: | ||
| - tapOn: "Skip" |
There was a problem hiding this comment.
What happens if there is a "Cancel" after a "Skip"? I think this would not work.
I guess we know that this won't happen?
| @@ -0,0 +1,15 @@ | |||
| # This flow requires passing the Android API version, user name and password as parameters like so: | |||
| # maestro test -e API_VERSION 36 -e USERNAME=user@example.com -e PASSWORD=123 google-login.yml | |||
There was a problem hiding this comment.
| # maestro test -e API_VERSION 36 -e USERNAME=user@example.com -e PASSWORD=123 google-login.yml | |
| # maestro test -e API_VERSION=36 -e USERNAME=user@example.com -e PASSWORD=123 google-login.yml |
rickvdl
left a comment
There was a problem hiding this comment.
Awesome work! Great to have a solid foundation
| appId: "com.android.settings" | ||
| --- | ||
| - runFlow: | ||
| label: "Log in on API >= 36" |
| - tapOn: "I agree" | ||
| - waitForAnimationToEnd | ||
| # Skip and cancel whatever Google asks us | ||
| - repeat: |
Description
Adds my attempt from a few weeks ago logging in to a Google account using Maestro. It might need some further tweaking and obviously isn't used yet, but this way it's not some random file on my desktop haha.