diff --git a/maestro/google-login/api/32.yml b/maestro/google-login/api/32.yml new file mode 100644 index 0000000000..7a0e665dd1 --- /dev/null +++ b/maestro/google-login/api/32.yml @@ -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 USERNAME=user@example.com -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: + 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" diff --git a/maestro/google-login/api/36.yml b/maestro/google-login/api/36.yml new file mode 100644 index 0000000000..0c6803e9f9 --- /dev/null +++ b/maestro/google-login/api/36.yml @@ -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 USERNAME=user@example.com -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" diff --git a/maestro/google-login/google-login.yml b/maestro/google-login/google-login.yml new file mode 100644 index 0000000000..f5b1d04d26 --- /dev/null +++ b/maestro/google-login/google-login.yml @@ -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 + +appId: "com.android.settings" +--- +- runFlow: + label: "Log in on API >= 36" + 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