diff options
| author | Albin <albin@mullvad.net> | 2024-08-19 12:46:49 +0200 |
|---|---|---|
| committer | Albin <albin@mullvad.net> | 2024-08-19 12:46:49 +0200 |
| commit | 3305d6aeb3018688dc4ab28ec60d5a990bb9d8fa (patch) | |
| tree | ecc00338159437299df39e4333716b6543356fd1 /android/test/common/src | |
| parent | 58a811f70b0d9da7ad052ec98b25eff65ee4a1be (diff) | |
| parent | 69bce812c4d300a1d9e26c0086a5778da65e01da (diff) | |
| download | mullvadvpn-3305d6aeb3018688dc4ab28ec60d5a990bb9d8fa.tar.xz mullvadvpn-3305d6aeb3018688dc4ab28ec60d5a990bb9d8fa.zip | |
Merge branch 'unable-to-get-initilizationprovider-droid-1238'
Diffstat (limited to 'android/test/common/src')
2 files changed, 5 insertions, 16 deletions
diff --git a/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/extension/UiAutomatorExtensions.kt b/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/extension/UiAutomatorExtensions.kt index b3e99eec98..9f3d727d29 100644 --- a/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/extension/UiAutomatorExtensions.kt +++ b/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/extension/UiAutomatorExtensions.kt @@ -24,13 +24,11 @@ fun UiDevice.findObjectWithTimeout( wait(Until.hasObject(selector), timeout) - return try { - findObject(selector) - } catch (e: NullPointerException) { - throw IllegalArgumentException( - "No matches for selector within timeout ($timeout): $selector" - ) - } + val foundObject = findObject(selector) + + require(foundObject != null) { "No matches for selector within timeout ($timeout): $selector" } + + return foundObject } fun UiDevice.clickAgreeOnPrivacyDisclaimer() { 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 07ea1aeca1..bc2481e55f 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 @@ -52,15 +52,6 @@ class AppInteractor( ensureLoggedIn() } - fun launchAndCreateAccount() { - launch() - device.clickAgreeOnPrivacyDisclaimer() - device.clickAllowOnNotificationPermissionPromptIfApiLevel33AndAbove() - waitForLoginPrompt() - attemptCreateAccount() - ensureAccountCreated() - } - fun attemptLogin(accountNumber: String) { val loginObject = device.findObjectWithTimeout(By.clazz("android.widget.EditText")).apply { |
