summaryrefslogtreecommitdiffhomepage
path: root/android/test/common/src
diff options
context:
space:
mode:
Diffstat (limited to 'android/test/common/src')
-rw-r--r--android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/extension/UiAutomatorExtensions.kt12
-rw-r--r--android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/interactor/AppInteractor.kt9
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 {