diff options
| author | saber safavi <saber.safavi@codic.se> | 2023-12-29 10:09:30 +0100 |
|---|---|---|
| committer | Albin <albin@mullvad.net> | 2024-01-05 10:43:47 +0100 |
| commit | d123576eca7f8f2f2b8540c9d94e40fdce47d523 (patch) | |
| tree | ab716f760877d893f9c974bfe19422630b8a2abb /android | |
| parent | b4e789c36efba733b2f267ffd34d7f6875623f76 (diff) | |
| download | mullvadvpn-d123576eca7f8f2f2b8540c9d94e40fdce47d523.tar.xz mullvadvpn-d123576eca7f8f2f2b8540c9d94e40fdce47d523.zip | |
Fix broken e2e tests for ConnectScreen and WebLink
Diffstat (limited to 'android')
3 files changed, 14 insertions, 10 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/LocationInfo.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/LocationInfo.kt index cd96bae05d..97602ed592 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/LocationInfo.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/LocationInfo.kt @@ -10,10 +10,12 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.draw.alpha import androidx.compose.ui.graphics.Color +import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import net.mullvad.mullvadvpn.R +import net.mullvad.mullvadvpn.compose.test.LOCATION_INFO_CONNECTION_OUT_TEST_TAG import net.mullvad.mullvadvpn.lib.theme.AppTheme import net.mullvad.mullvadvpn.lib.theme.Dimens import net.mullvad.mullvadvpn.lib.theme.color.AlphaInactive @@ -111,9 +113,10 @@ fun LocationInfo( color = colorExpanded, style = MaterialTheme.typography.labelMedium, modifier = - Modifier.alpha( - if (isExpanded && outAddress.isNotEmpty()) AlphaVisible else AlphaInvisible - ) + Modifier.testTag(LOCATION_INFO_CONNECTION_OUT_TEST_TAG) + .alpha( + if (isExpanded && outAddress.isNotEmpty()) AlphaVisible else AlphaInvisible + ) ) } } diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/test/ComposeTestTagConstants.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/test/ComposeTestTagConstants.kt index ff5bbf43cc..98c63ac9b9 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/test/ComposeTestTagConstants.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/test/ComposeTestTagConstants.kt @@ -25,6 +25,7 @@ const val SELECT_LOCATION_BUTTON_TEST_TAG = "select_location_button_test_tag" const val CONNECT_BUTTON_TEST_TAG = "connect_button_test_tag" const val RECONNECT_BUTTON_TEST_TAG = "reconnect_button_test_tag" const val LOCATION_INFO_TEST_TAG = "location_info_test_tag" +const val LOCATION_INFO_CONNECTION_OUT_TEST_TAG = "location_info_connection_out_test_tag" // ConnectScreen - Notification banner const val NOTIFICATION_BANNER = "notification_banner" 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 74bc7703d5..6921e6b362 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 @@ -13,9 +13,6 @@ import net.mullvad.mullvadvpn.test.common.constant.CONNECTION_TIMEOUT import net.mullvad.mullvadvpn.test.common.constant.LOGIN_PROMPT_TIMEOUT import net.mullvad.mullvadvpn.test.common.constant.LOGIN_TIMEOUT import net.mullvad.mullvadvpn.test.common.constant.MULLVAD_PACKAGE -import net.mullvad.mullvadvpn.test.common.constant.SETTINGS_COG_ID -import net.mullvad.mullvadvpn.test.common.constant.TUNNEL_INFO_ID -import net.mullvad.mullvadvpn.test.common.constant.TUNNEL_OUT_ADDRESS_ID import net.mullvad.mullvadvpn.test.common.extension.clickAgreeOnPrivacyDisclaimer import net.mullvad.mullvadvpn.test.common.extension.clickAllowOnNotificationPermissionPromptIfApiLevel33AndAbove import net.mullvad.mullvadvpn.test.common.extension.findObjectWithTimeout @@ -78,15 +75,18 @@ class AppInteractor(private val device: UiDevice, private val targetContext: Con } fun extractIpAddress(): String { - device.findObjectWithTimeout(By.res(TUNNEL_INFO_ID)).click() + device.findObjectWithTimeout(By.res("location_info_test_tag")).click() return device - .findObjectWithTimeout(By.res(TUNNEL_OUT_ADDRESS_ID), CONNECTION_TIMEOUT) + .findObjectWithTimeout( + By.res("location_info_connection_out_test_tag"), + CONNECTION_TIMEOUT + ) .text .extractIpAddress() } fun clickSettingsCog() { - device.findObjectWithTimeout(By.res(SETTINGS_COG_ID)).click() + device.findObjectWithTimeout(By.res("top_bar_settings_button")).click() } fun clickAccountCog() { @@ -106,6 +106,6 @@ class AppInteractor(private val device: UiDevice, private val targetContext: Con } private fun String.extractIpAddress(): String { - return split(" ")[1].split(" ")[0] + return split(" ")[1].split(" ")[0] } } |
