diff options
| author | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2025-09-03 16:22:10 +0200 |
|---|---|---|
| committer | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2025-09-03 16:22:10 +0200 |
| commit | 6755586be823effd7128420b0cf5cfe9b5bf3a61 (patch) | |
| tree | f7d1301e490f886499b230aef9d1aa5aa17c5cee /android/test | |
| parent | 82ef8c8fb924351172d2baf93b77023e6a408a90 (diff) | |
| parent | 675394de27138e98c8b171737114779834f7189d (diff) | |
| download | mullvadvpn-6755586be823effd7128420b0cf5cfe9b5bf3a61.tar.xz mullvadvpn-6755586be823effd7128420b0cf5cfe9b5bf3a61.zip | |
Merge branch 'bypass-quic-socket-android'
Diffstat (limited to 'android/test')
5 files changed, 83 insertions, 0 deletions
diff --git a/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/page/SelectLocationPage.kt b/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/page/SelectLocationPage.kt index 404a81f9a8..627af6252b 100644 --- a/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/page/SelectLocationPage.kt +++ b/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/page/SelectLocationPage.kt @@ -1,8 +1,11 @@ package net.mullvad.mullvadvpn.test.common.page import androidx.test.uiautomator.By +import androidx.test.uiautomator.Direction +import androidx.test.uiautomator.Until import net.mullvad.mullvadvpn.lib.ui.tag.EXPAND_BUTTON_TEST_TAG import net.mullvad.mullvadvpn.lib.ui.tag.GEOLOCATION_NAME_TAG +import net.mullvad.mullvadvpn.lib.ui.tag.SELECT_LOCATION_LIST_TEST_TAG import net.mullvad.mullvadvpn.lib.ui.tag.SELECT_LOCATION_SCREEN_TEST_TAG import net.mullvad.mullvadvpn.test.common.extension.findObjectWithTimeout @@ -24,4 +27,9 @@ class SelectLocationPage internal constructor() : Page() { fun clickLocationCell(locationName: String) { uiDevice.findObjectWithTimeout(By.text(locationName)).click() } + + fun scrollUntilCell(locationName: String) { + val scrollView2 = uiDevice.findObjectWithTimeout(By.res(SELECT_LOCATION_LIST_TEST_TAG)) + scrollView2.scrollUntil(Direction.DOWN, Until.hasObject(By.res(locationName))) + } } diff --git a/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/page/VpnSettingsPage.kt b/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/page/VpnSettingsPage.kt index 8232369cdb..1e4f0dd4e1 100644 --- a/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/page/VpnSettingsPage.kt +++ b/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/page/VpnSettingsPage.kt @@ -9,6 +9,7 @@ import net.mullvad.mullvadvpn.lib.ui.tag.LAZY_LIST_VPN_SETTINGS_TEST_TAG import net.mullvad.mullvadvpn.lib.ui.tag.LAZY_LIST_WIREGUARD_CUSTOM_PORT_TEXT_TEST_TAG import net.mullvad.mullvadvpn.lib.ui.tag.SWITCH_TEST_TAG import net.mullvad.mullvadvpn.lib.ui.tag.WIREGUARD_OBFUSCATION_OFF_CELL_TEST_TAG +import net.mullvad.mullvadvpn.lib.ui.tag.WIREGUARD_OBFUSCATION_QUIC_CELL_TEST_TAG import net.mullvad.mullvadvpn.lib.ui.tag.WIREGUARD_OBFUSCATION_SHADOWSOCKS_CELL_TEST_TAG import net.mullvad.mullvadvpn.lib.ui.tag.WIREGUARD_OBFUSCATION_UDP_OVER_TCP_CELL_TEST_TAG import net.mullvad.mullvadvpn.test.common.extension.clickObjectAwaitIsChecked @@ -35,6 +36,10 @@ class VpnSettingsPage internal constructor() : Page() { scrollUntilCell(WIREGUARD_OBFUSCATION_UDP_OVER_TCP_CELL_TEST_TAG) } + fun scrollUntilWireGuardObfuscationQuicCell() { + scrollUntilCell(WIREGUARD_OBFUSCATION_QUIC_CELL_TEST_TAG) + } + fun scrollUntilWireGuardObfuscationOffCell() { scrollUntilCell(WIREGUARD_OBFUSCATION_OFF_CELL_TEST_TAG) } @@ -55,6 +60,10 @@ class VpnSettingsPage internal constructor() : Page() { uiDevice.clickObjectAwaitIsChecked(By.res(WIREGUARD_OBFUSCATION_UDP_OVER_TCP_CELL_TEST_TAG)) } + fun clickWireguardObfuscationQuicCell() { + uiDevice.clickObjectAwaitIsChecked(By.res(WIREGUARD_OBFUSCATION_QUIC_CELL_TEST_TAG)) + } + fun clickWireGuardObfuscationOffCell() { uiDevice.clickObjectAwaitIsChecked(By.res(WIREGUARD_OBFUSCATION_OFF_CELL_TEST_TAG)) } 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 2d7757ace1..e9c503e5b6 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 @@ -241,6 +241,57 @@ class ConnectionTest : EndToEndTest() { @Test @HasDependencyOnLocalAPI @ClearFirewallRules + fun testQuic() = runTest { + app.launchAndLogIn(accountTestRule.validAccountNumber) + on<ConnectPage> { enableLocalNetworkSharingStory() } + + on<ConnectPage> { clickSelectLocation() } + + on<SelectLocationPage> { + val quicRelay = relayProvider.getQuicRelay() + clickLocationExpandButton(quicRelay.country) + clickLocationExpandButton(quicRelay.city) + scrollUntilCell(quicRelay.relay) + clickLocationCell(quicRelay.relay) + } + + device.acceptVpnPermissionDialog() + + var relayIpAddress: String? = null + + on<ConnectPage> { + waitForConnectedLabel() + relayIpAddress = extractInIpv4Address() + clickDisconnect() + } + + // Block UDP traffic to the relay + val firewallRule = DropRule.blockWireGuardTrafficRule(relayIpAddress!!) + firewallClient.createRule(firewallRule) + + // Enable QUIC + on<ConnectPage> { clickSettings() } + + on<SettingsPage> { clickVpnSettings() } + + on<VpnSettingsPage> { + scrollUntilWireGuardObfuscationQuicCell() + clickWireguardObfuscationQuicCell() + } + + device.pressBack() + device.pressBack() + + on<ConnectPage> { + clickConnect() + waitForConnectedLabel(timeout = EXTREMELY_LONG_TIMEOUT) + clickDisconnect() + } + } + + @Test + @HasDependencyOnLocalAPI + @ClearFirewallRules fun testShadowsocks() = runTest { app.launchAndLogIn(accountTestRule.validAccountNumber) on<ConnectPage> { enableLocalNetworkSharingStory() } diff --git a/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/constant/Relays.kt b/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/constant/Relays.kt index 50a27de87c..7d098fff8f 100644 --- a/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/constant/Relays.kt +++ b/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/constant/Relays.kt @@ -5,16 +5,23 @@ import net.mullvad.mullvadvpn.test.e2e.misc.TestRelay object Stagemole { val DEFAULT_RELAY = Relays.gotWg001 val DAITA_RELAY = Relays.gotWg002RelaySoftware + + val QUIC_RELAY = Relays.stoWg001 } object Production { val DEFAULT_RELAY = Relays.gotWg001 val DAITA_RELAY = Relays.gotWg002 + + val QUIC_RELAY = Relays.stoWg204 } private object Relays { val gotWg001 = TestRelay(relay = "se-got-wg-001", country = "Sweden", city = "Gothenburg") val gotWg002 = TestRelay(relay = "se-got-wg-002", country = "Sweden", city = "Gothenburg") + + val stoWg001 = TestRelay(relay = "se-sto-wg-001", country = "Sweden", city = "Stockholm") + val stoWg204 = TestRelay(relay = "se-sto-wg-204", country = "Sweden", city = "Stockholm") val gotWg002RelaySoftware = TestRelay( relay = "se-got-wg-002", diff --git a/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/misc/RelayProvider.kt b/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/misc/RelayProvider.kt index 6aaafde29f..ee27f95148 100644 --- a/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/misc/RelayProvider.kt +++ b/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/misc/RelayProvider.kt @@ -21,6 +21,14 @@ class RelayProvider(val currentFlavor: String = BuildConfig.FLAVOR_billing) { else -> error("Invalid flavor: $currentFlavor") } } + + fun getQuicRelay(): TestRelay { + return when (currentFlavor) { + "play" -> Stagemole.QUIC_RELAY + "oss" -> Production.QUIC_RELAY + else -> error("Invalid flavor: $currentFlavor") + } + } } data class TestRelay(val country: String, val city: String, val relay: String) |
