summaryrefslogtreecommitdiffhomepage
path: root/android/test
diff options
context:
space:
mode:
authorDavid Göransson <david.goransson@mullvad.net>2024-09-17 15:28:58 +0200
committerDavid Göransson <david.goransson@mullvad.net>2024-09-18 14:35:22 +0200
commitc06026cae12be2757376883dfbf879528e545b4f (patch)
treeb533d83806ec42fcbe242e693032d4db62e45d4a /android/test
parent567e64f458781112eae97f860e8e2796e78507a3 (diff)
downloadmullvadvpn-c06026cae12be2757376883dfbf879528e545b4f.tar.xz
mullvadvpn-c06026cae12be2757376883dfbf879528e545b4f.zip
Fix tests
Diffstat (limited to 'android/test')
-rw-r--r--android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/interactor/AppInteractor.kt11
-rw-r--r--android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/ConnectionTest.kt10
2 files changed, 8 insertions, 13 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 340dad5ea0..1434de600e 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
@@ -71,7 +71,7 @@ class AppInteractor(
}
fun ensureLoggedIn() {
- device.findObjectWithTimeout(By.text("UNSECURED CONNECTION"), VERY_LONG_TIMEOUT)
+ device.findObjectWithTimeout(By.text("DISCONNECTED"), VERY_LONG_TIMEOUT)
}
fun ensureOutOfTime() {
@@ -82,8 +82,8 @@ class AppInteractor(
device.findObjectWithTimeout(By.text("Account"))
}
- fun extractIpAddress(): String {
- device.findObjectWithTimeout(By.res("location_info_test_tag")).click()
+ fun extractOutIpv4Address(): String {
+ device.findObjectWithTimeout(By.res("connect_card_header_test_tag")).click()
return device
.findObjectWithTimeout(
// Text exist and contains IP address
@@ -91,7 +91,6 @@ class AppInteractor(
VERY_LONG_TIMEOUT,
)
.text
- .extractIpAddress()
}
fun clickSettingsCog() {
@@ -118,8 +117,4 @@ class AppInteractor(
device.findObjectWithTimeout(By.desc("Remove")).click()
clickActionButtonByText("Yes, log out device")
}
-
- private fun String.extractIpAddress(): String {
- return split(" ")[1].split(" ")[0]
- }
}
diff --git a/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/ConnectionTest.kt b/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/ConnectionTest.kt
index 8f262f94e9..7b98c2f8f3 100644
--- a/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/ConnectionTest.kt
+++ b/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/ConnectionTest.kt
@@ -26,11 +26,11 @@ class ConnectionTest : EndToEndTest(BuildConfig.FLAVOR_infrastructure) {
app.launchAndEnsureLoggedIn(accountTestRule.validAccountNumber)
// When
- device.findObjectWithTimeout(By.text("Secure my connection")).click()
+ device.findObjectWithTimeout(By.text("Connect")).click()
device.findObjectWithTimeout(By.text("OK")).click()
// Then
- device.findObjectWithTimeout(By.text("SECURE CONNECTION"), VERY_LONG_TIMEOUT)
+ device.findObjectWithTimeout(By.text("CONNECTED"), VERY_LONG_TIMEOUT)
}
@Test
@@ -39,10 +39,10 @@ class ConnectionTest : EndToEndTest(BuildConfig.FLAVOR_infrastructure) {
app.launchAndEnsureLoggedIn(accountTestRule.validAccountNumber)
// When
- device.findObjectWithTimeout(By.text("Secure my connection")).click()
+ device.findObjectWithTimeout(By.text("Connect")).click()
device.findObjectWithTimeout(By.text("OK")).click()
- device.findObjectWithTimeout(By.text("SECURE CONNECTION"), VERY_LONG_TIMEOUT)
- val expected = ConnCheckState(true, app.extractIpAddress())
+ device.findObjectWithTimeout(By.text("CONNECTED"), VERY_LONG_TIMEOUT)
+ val expected = ConnCheckState(true, app.extractOutIpv4Address())
// Then
val result = SimpleMullvadHttpClient(targetContext).runConnectionCheck()