diff options
Diffstat (limited to 'android/test/common/src')
| -rw-r--r-- | android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/interactor/AppInteractor.kt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/interactor/AppInteractor.kt b/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/interactor/AppInteractor.kt index 2909b4edd0..74bc7703d5 100644 --- a/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/interactor/AppInteractor.kt +++ b/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/interactor/AppInteractor.kt @@ -49,6 +49,14 @@ class AppInteractor(private val device: UiDevice, private val targetContext: Con ensureLoggedIn() } + fun launchAndCreateAccount() { + launch() + device.clickAgreeOnPrivacyDisclaimer() + device.clickAllowOnNotificationPermissionPromptIfApiLevel33AndAbove() + attemptCreateAccount() + ensureAccountCreated() + } + fun attemptLogin(accountToken: String) { val loginObject = device.findObjectWithTimeout(By.clazz("android.widget.EditText")).apply { @@ -57,6 +65,14 @@ class AppInteractor(private val device: UiDevice, private val targetContext: Con loginObject.parent.findObject(By.clazz(Button::class.java)).click() } + private fun attemptCreateAccount() { + device.findObjectWithTimeout(By.text("Create account")).click() + } + + private fun ensureAccountCreated() { + device.findObjectWithTimeout(By.text("Congrats!"), LOGIN_TIMEOUT) + } + fun ensureLoggedIn() { device.findObjectWithTimeout(By.text("UNSECURED CONNECTION"), LOGIN_TIMEOUT) } |
