Skip to content

Conversation

@JayShortway
Copy link
Member

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.

@JayShortway JayShortway requested a review from tonidero October 30, 2025 09:45
@JayShortway JayShortway self-assigned this Oct 30, 2025
@JayShortway JayShortway requested a review from a team as a code owner October 30, 2025 09:45
Copy link
Contributor

@tonidero tonidero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

---
- launchApp
- scrollUntilVisible:
element: "Passwords, passkeys & accounts"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yml for API >= 36
  • maestro/google-login/api/32.yml for 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 [email protected] \
  -e PASSWORD=123 \
  google-login.yml;

@JayShortway JayShortway changed the title Adds google-login.yml Maestro flow Adds Google login Maestro flow Oct 30, 2025
@codecov
Copy link

codecov bot commented Oct 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.24%. Comparing base (fa4c91d) to head (3816f1e).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@saico-0ps

This comment was marked as spam.

Copy link
Member

@ajpallares ajpallares left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really good! 🤩

Just a couple of small comments

Comment on lines +29 to +38
- repeat:
while:
visible: "Cancel"
commands:
- tapOn: "Cancel"
- repeat:
while:
visible: "Skip"
commands:
- tapOn: "Skip"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 [email protected] -e PASSWORD=123 google-login.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# maestro test -e API_VERSION 36 -e [email protected] -e PASSWORD=123 google-login.yml
# maestro test -e API_VERSION=36 -e [email protected] -e PASSWORD=123 google-login.yml

Copy link

@rickvdl rickvdl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work! Great to have a solid foundation

appId: "com.android.settings"
---
- runFlow:
label: "Log in on API >= 36"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great 🙌

- tapOn: "I agree"
- waitForAnimationToEnd
# Skip and cancel whatever Google asks us
- repeat:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smart one 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants