Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions maestro/google-login/api/32.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# We could save a few steps in this flow by immediately opening the Add Account screen in the Settings app:
# adb shell am start -a android.settings.ADD_ACCOUNT_SETTINGS -n com.android.settings/.accounts.AddAccountSettings;

# This flow requires passing the user name and password as parameters like so:
# maestro test -e [email protected] -e PASSWORD=123 google-login.yml

appId: "com.android.settings"
---
- launchApp
- scrollUntilVisible:
element: "Passwords & accounts"
- tapOn: "Passwords & accounts"
- runFlow:
when:
notVisible: ${USERNAME}
commands:
- tapOn: "Add account"
- tapOn: "Google"
- tapOn:
id: identifierId
- inputText: ${USERNAME}
- tapOn: NEXT
- assertVisible: "Show password"
- inputText: ${PASSWORD}
- tapOn: NEXT
- tapOn: "I agree"
- waitForAnimationToEnd
# Skip and cancel whatever Google asks us
- repeat:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Smart one 😅

while:
visible: "Cancel"
commands:
- tapOn: "Cancel"
- repeat:
while:
visible: "Skip"
commands:
- tapOn: "Skip"
Comment on lines +29 to +38
Copy link
Copy Markdown
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?

- runFlow:
label: "Ensure Auto Backup is disabled"
when:
visible: "Back up device data"
commands:
- tapOn:
checked: true
- tapOn: "Accept"
55 changes: 55 additions & 0 deletions maestro/google-login/api/36.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# We could save a few steps in this flow by immediately opening the Add Account screen in the Settings app:
# adb shell am start -a android.settings.ADD_ACCOUNT_SETTINGS -n com.android.settings/.accounts.AddAccountSettings;

# This flow requires passing the user name and password as parameters like so:
# maestro test -e [email protected] -e PASSWORD=123 google-login.yml

appId: "com.android.settings"
---
- launchApp
- scrollUntilVisible:
element: "Passwords, passkeys & accounts"
- tapOn: "Passwords, passkeys & accounts"
- runFlow:
when:
notVisible: ${USERNAME}
commands:
- runFlow:
label: "Ensure auto-fill is disabled"
when:
notVisible: "None selected"
commands:
- tapOn: "Change"
- tapOn: "None"
- tapOn: "Turn off"
- back
- tapOn: "Add account"
- tapOn: "Google"
- tapOn:
id: identifierId
- inputText: ${USERNAME}
- tapOn: NEXT
- assertVisible: "Show password"
- inputText: ${PASSWORD}
- tapOn: NEXT
- tapOn: "I agree"
- waitForAnimationToEnd
# Skip and cancel whatever Google asks us
- repeat:
while:
visible: "Cancel"
commands:
- tapOn: "Cancel"
- repeat:
while:
visible: "Skip"
commands:
- tapOn: "Skip"
- runFlow:
label: "Ensure Auto Backup is disabled"
when:
visible: "Back up device data"
commands:
- tapOn:
checked: true
- tapOn: "Accept"
15 changes: 15 additions & 0 deletions maestro/google-login/google-login.yml
Original file line number Diff line number Diff line change
@@ -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
Copy Markdown
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


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

Choose a reason for hiding this comment

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

This is great 🙌

when:
true: ${API_VERSION >= 36}
file: api/36.yml
- runFlow:
label: "Log in on API >= 32"
when:
true: ${API_VERSION >= 32 && API_VERSION < 36}
file: api/32.yml