summaryrefslogtreecommitdiffhomepage
path: root/android/lib
diff options
context:
space:
mode:
authorDavid Göransson <david.goransson@mullvad.net>2025-07-29 15:37:07 +0200
committerJonatan Rhodin <jonatan.rhodin@mullvad.net>2025-07-29 16:07:29 +0200
commit34c6f795b484494ee81614fff8baf7852ca2d469 (patch)
tree00a1ef671391fd110ec3bafdb28185c708d64e2d /android/lib
parent93d42e2e3d688e19bb16c41ddc0a9aa119a80903 (diff)
downloadmullvadvpn-34c6f795b484494ee81614fff8baf7852ca2d469.tar.xz
mullvadvpn-34c6f795b484494ee81614fff8baf7852ca2d469.zip
Check for both tag and name in location cells for e2e tests
Diffstat (limited to 'android/lib')
-rw-r--r--android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/relaylist/SelectableRelayListItem.kt12
-rw-r--r--android/lib/ui/tag/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/tag/TestTagConstants.kt4
2 files changed, 16 insertions, 0 deletions
diff --git a/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/relaylist/SelectableRelayListItem.kt b/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/relaylist/SelectableRelayListItem.kt
index 289eb5aa9f..8c38610f9e 100644
--- a/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/relaylist/SelectableRelayListItem.kt
+++ b/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/relaylist/SelectableRelayListItem.kt
@@ -43,7 +43,10 @@ import net.mullvad.mullvadvpn.lib.ui.component.ExpandChevron
import net.mullvad.mullvadvpn.lib.ui.designsystem.RelayListItem
import net.mullvad.mullvadvpn.lib.ui.designsystem.RelayListItemDefaults
import net.mullvad.mullvadvpn.lib.ui.designsystem.RelayListTokens
+import net.mullvad.mullvadvpn.lib.ui.tag.CUSTOM_LIST_ENTRY_NAME_TAG
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.RECENT_NAME_TAG
@Composable
@Preview
@@ -100,6 +103,15 @@ fun SelectableRelayListItem(
}
Name(
+ modifier =
+ Modifier.testTag(
+ when (relayListItem) {
+ is RelayListItem.CustomListEntryItem -> CUSTOM_LIST_ENTRY_NAME_TAG
+ is RelayListItem.CustomListItem -> CUSTOM_LIST_ENTRY_NAME_TAG
+ is RelayListItem.GeoLocationItem -> GEOLOCATION_NAME_TAG
+ is RelayListItem.RecentListItem -> RECENT_NAME_TAG
+ }
+ ),
name = relayListItem.hop.displayName(LocalContext.current),
state = relayListItem.state,
active = relayListItem.hop.isActive,
diff --git a/android/lib/ui/tag/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/tag/TestTagConstants.kt b/android/lib/ui/tag/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/tag/TestTagConstants.kt
index a8264b9b56..ba022e0edc 100644
--- a/android/lib/ui/tag/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/tag/TestTagConstants.kt
+++ b/android/lib/ui/tag/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/tag/TestTagConstants.kt
@@ -41,6 +41,10 @@ const val CIRCULAR_PROGRESS_INDICATOR_TEST_TAG = "circular_progress_indicator_te
const val EXPAND_BUTTON_TEST_TAG = "expand_button_test_tag"
const val LOCATION_CELL_TEST_TAG = "location_cell_test_tag"
+const val GEOLOCATION_NAME_TAG = "geolocation_name_test_tag"
+const val CUSTOM_LIST_NAME_TAG = "custom_list_name_test_tag"
+const val CUSTOM_LIST_ENTRY_NAME_TAG = "custom_list_entry_name_test_tag"
+const val RECENT_NAME_TAG = "recent_name_test_tag"
// ConnectScreen
const val SELECT_LOCATION_BUTTON_TEST_TAG = "select_location_button_test_tag"
const val CONNECT_BUTTON_TEST_TAG = "connect_button_test_tag"