summaryrefslogtreecommitdiffhomepage
path: root/android/lib/ui
diff options
context:
space:
mode:
authorKalle Lindström <karl.lindstrom@mullvad.net>2025-04-28 16:43:01 +0200
committerJonatan Rhodin <jonatan.rhodin@mullvad.net>2025-04-30 09:27:03 +0200
commite178b2759071ce6cb3f7ee0d6d47e28fd55dbed4 (patch)
treedd466ea13d90e9a9dd210c5d729f1c66d82aa1d0 /android/lib/ui
parentbbbef9d05e5bc7e989f00975ea4141cecd187661 (diff)
downloadmullvadvpn-e178b2759071ce6cb3f7ee0d6d47e28fd55dbed4.tar.xz
mullvadvpn-e178b2759071ce6cb3f7ee0d6d47e28fd55dbed4.zip
Move all test tags to new lib.ui.tag module
Diffstat (limited to 'android/lib/ui')
-rw-r--r--android/lib/ui/component/build.gradle.kts1
-rw-r--r--android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/AnimatedNotificationBanner.kt15
-rw-r--r--android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/test/ComposeTestTagConstants.kt6
-rw-r--r--android/lib/ui/tag/build.gradle.kts28
-rw-r--r--android/lib/ui/tag/src/main/AndroidManifest.xml1
-rw-r--r--android/lib/ui/tag/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/tag/TestTagConstants.kt134
6 files changed, 173 insertions, 12 deletions
diff --git a/android/lib/ui/component/build.gradle.kts b/android/lib/ui/component/build.gradle.kts
index 7804ac0abc..d41863e495 100644
--- a/android/lib/ui/component/build.gradle.kts
+++ b/android/lib/ui/component/build.gradle.kts
@@ -31,6 +31,7 @@ android {
}
dependencies {
+ implementation(projects.lib.ui.tag)
implementation(libs.compose.material3)
implementation(libs.compose.ui)
implementation(libs.compose.constrainlayout)
diff --git a/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/AnimatedNotificationBanner.kt b/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/AnimatedNotificationBanner.kt
index 5d1d7f0e74..979f63920a 100644
--- a/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/AnimatedNotificationBanner.kt
+++ b/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/AnimatedNotificationBanner.kt
@@ -29,9 +29,9 @@ import net.mullvad.mullvadvpn.lib.model.InAppNotification
import net.mullvad.mullvadvpn.lib.model.StatusLevel
import net.mullvad.mullvadvpn.lib.theme.Dimens
import net.mullvad.mullvadvpn.lib.theme.color.warning
-import net.mullvad.mullvadvpn.lib.ui.component.test.NOTIFICATION_BANNER
-import net.mullvad.mullvadvpn.lib.ui.component.test.NOTIFICATION_BANNER_ACTION
-import net.mullvad.mullvadvpn.lib.ui.component.test.NOTIFICATION_BANNER_TEXT_ACTION
+import net.mullvad.mullvadvpn.lib.ui.tag.NOTIFICATION_BANNER_ACTION_TEST_TAG
+import net.mullvad.mullvadvpn.lib.ui.tag.NOTIFICATION_BANNER_TEST_TAG
+import net.mullvad.mullvadvpn.lib.ui.tag.NOTIFICATION_BANNER_TEXT_ACTION_TEST_TAG
@Composable
fun AnimatedNotificationBanner(
@@ -84,7 +84,7 @@ private fun Notification(modifier: Modifier = Modifier, notificationBannerData:
bottom = Dimens.smallPadding,
)
.animateContentSize()
- .testTag(NOTIFICATION_BANNER)
+ .testTag(NOTIFICATION_BANNER_TEST_TAG)
) {
val (status, textTitle, textMessage, actionIcon) = createRefs()
NotificationDot(
@@ -146,7 +146,7 @@ private fun Notification(modifier: Modifier = Modifier, notificationBannerData:
) {
message.onClick()
}
- .testTag(NOTIFICATION_BANNER_TEXT_ACTION)
+ .testTag(NOTIFICATION_BANNER_TEXT_ACTION_TEST_TAG)
} else {
it
}
@@ -197,7 +197,10 @@ private fun NotificationAction(
modifier: Modifier = Modifier,
) {
- IconButton(modifier = modifier.testTag(NOTIFICATION_BANNER_ACTION), onClick = onClick) {
+ IconButton(
+ modifier = modifier.testTag(NOTIFICATION_BANNER_ACTION_TEST_TAG),
+ onClick = onClick,
+ ) {
Icon(
modifier = Modifier.padding(Dimens.notificationIconPadding),
imageVector = imageVector,
diff --git a/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/test/ComposeTestTagConstants.kt b/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/test/ComposeTestTagConstants.kt
deleted file mode 100644
index 24189d1469..0000000000
--- a/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/test/ComposeTestTagConstants.kt
+++ /dev/null
@@ -1,6 +0,0 @@
-package net.mullvad.mullvadvpn.lib.ui.component.test
-
-// ConnectScreen - Notification banner
-const val NOTIFICATION_BANNER = "notification_banner"
-const val NOTIFICATION_BANNER_ACTION = "notification_banner_action"
-const val NOTIFICATION_BANNER_TEXT_ACTION = "notification_banner_text_action"
diff --git a/android/lib/ui/tag/build.gradle.kts b/android/lib/ui/tag/build.gradle.kts
new file mode 100644
index 0000000000..5816277ffb
--- /dev/null
+++ b/android/lib/ui/tag/build.gradle.kts
@@ -0,0 +1,28 @@
+plugins {
+ alias(libs.plugins.android.library)
+ alias(libs.plugins.kotlin.android)
+}
+
+android {
+ namespace = "net.mullvad.mullvadvpn.lib.ui.tag"
+ compileSdk = Versions.compileSdkVersion
+ buildToolsVersion = Versions.buildToolsVersion
+
+ defaultConfig { minSdk = Versions.minSdkVersion }
+
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
+ }
+
+ kotlinOptions {
+ jvmTarget = Versions.jvmTarget
+ allWarningsAsErrors = true
+ }
+
+ lint {
+ lintConfig = file("${rootProject.projectDir}/config/lint.xml")
+ abortOnError = true
+ warningsAsErrors = true
+ }
+}
diff --git a/android/lib/ui/tag/src/main/AndroidManifest.xml b/android/lib/ui/tag/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..cc947c5679
--- /dev/null
+++ b/android/lib/ui/tag/src/main/AndroidManifest.xml
@@ -0,0 +1 @@
+<manifest />
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
new file mode 100644
index 0000000000..0f63548aea
--- /dev/null
+++ b/android/lib/ui/tag/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/tag/TestTagConstants.kt
@@ -0,0 +1,134 @@
+package net.mullvad.mullvadvpn.lib.ui.tag
+
+// Top Bar
+const val TOP_BAR_ACCOUNT_BUTTON_TEST_TAG = "top_bar_account_button_test_tag"
+const val TOP_BAR_SETTINGS_BUTTON_TEST_TAG = "top_bar_settings_button_test_tag"
+const val TOP_BAR_TEST_TAG = "top_bar_test_tag"
+
+// Settings screen
+const val VPN_SETTINGS_CELL_TEST_TAG = "vpn_settings_cell_test_tag"
+const val DAITA_CELL_TEST_TAG = "data_cell_test_tag"
+
+// DAITA settings screen
+const val DAITA_SCREEN_TEST_TAG = "daita_screen_test_tag"
+
+// VpnSettingsScreen
+const val LAZY_LIST_VPN_SETTINGS_TEST_TAG = "lazy_list_vpn_settings_test_tag"
+const val LAZY_LIST_TEST_TAG = "lazy_list_test_tag"
+const val LAZY_LIST_LAST_ITEM_TEST_TAG = "lazy_list_last_item_test_tag"
+const val LAZY_LIST_QUANTUM_ITEM_OFF_TEST_TAG = "lazy_list_quantum_item_off_test_tag"
+const val LAZY_LIST_QUANTUM_ITEM_ON_TEST_TAG = "lazy_list_quantum_item_on_test_tag"
+const val LAZY_LIST_WIREGUARD_PORT_ITEM_X_TEST_TAG = "lazy_list_wireguard_item_%d_test_tag"
+const val LAZY_LIST_WIREGUARD_CUSTOM_PORT_TEXT_TEST_TAG =
+ "lazy_list_wireguard_custom_port_text_test_tag"
+const val LAZY_LIST_WIREGUARD_CUSTOM_PORT_NUMBER_TEST_TAG =
+ "lazy_list_wireguard_custom_port_number_test_tag"
+const val CUSTOM_PORT_DIALOG_INPUT_TEST_TAG = "custom_port_dialog_input_test_tag"
+const val LAZY_LIST_WIREGUARD_OBFUSCATION_TITLE_TEST_TAG =
+ "lazy_list_wireguard_obfuscation_title_test_tag"
+const val SWITCH_TEST_TAG = "switch_test_tag"
+const val WIREGUARD_OBFUSCATION_OFF_CELL_TEST_TAG = "wireguard_obfuscation_off_cell_test_tag"
+const val WIREGUARD_OBFUSCATION_SHADOWSOCKS_CELL_TEST_TAG =
+ "wireguard_obfuscation_shadowsocks_cell_test_tag"
+const val WIREGUARD_OBFUSCATION_UDP_OVER_TCP_CELL_TEST_TAG =
+ "wireguard_obfuscation_udp_over_tcp_cell_test_tag"
+const val QUANTUM_RESISTANCE_OFF_CELL_TEST_TAG = "quantum_resistance_off_cell_test_tag"
+
+// Account screen
+const val MANAGE_DEVICES_BUTTON_TEST_TAG = "manage_devices_button_test_tag"
+
+// SelectLocationScreen, ConnectScreen, CustomListLocationsScreen
+const val SELECT_LOCATION_SCREEN_TEST_TAG = "select_location_screen_test_tag"
+const val CIRCULAR_PROGRESS_INDICATOR_TEST_TAG = "circular_progress_indicator_test_tag"
+const val EXPAND_BUTTON_TEST_TAG = "expand_button_test_tag"
+const val LOCATION_CELL_TEST_TAG = "location_cell_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"
+const val RECONNECT_BUTTON_TEST_TAG = "reconnect_button_test_tag"
+const val CONNECT_CARD_HEADER_TEST_TAG = "connect_card_header_test_tag"
+const val LOCATION_INFO_CONNECTION_IN_TEST_TAG = "location_info_connection_in_test_tag"
+const val LOCATION_INFO_CONNECTION_OUT_TEST_TAG = "location_info_connection_out_test_tag"
+
+// ConnectScreen - Notification banner
+const val NOTIFICATION_BANNER_TEST_TAG = "notification_banner_test_tag"
+const val NOTIFICATION_BANNER_ACTION_TEST_TAG = "notification_banner_action_test_tag"
+const val NOTIFICATION_BANNER_TEXT_ACTION_TEST_TAG = "notification_banner_text_action_test_tag"
+
+// PlayPayment
+const val PLAY_PAYMENT_INFO_ICON_TEST_TAG = "play_payment_info_icon_test_tag"
+
+const val LOGIN_TITLE_TEST_TAG = "login_title_test_tag"
+const val LOGIN_INPUT_TEST_TAG = "login_input_test_tag"
+
+// VoucherDialog
+const val VOUCHER_INPUT_TEST_TAG = "voucher_input_test_tag"
+
+// OutOfTimeScreen
+const val OUT_OF_TIME_SCREEN_TITLE_TEST_TAG = "out_of_time_screen_title_test_tag"
+
+// CreateCustomListDialog
+const val CREATE_CUSTOM_LIST_DIALOG_INPUT_TEST_TAG = "create_custom_list_dialog_input_test_tag"
+
+// UpdateCustomListDialog
+const val EDIT_CUSTOM_LIST_DIALOG_INPUT_TEST_TAG = "edit_custom_list_dialog_input_test_tag"
+
+// CustomListLocationsScreen
+const val SAVE_BUTTON_TEST_TAG = "save_button_test_tag"
+
+// CustomListsScreen
+const val NEW_LIST_BUTTON_TEST_TAG = "new_list_button_test_tag"
+const val TOP_BAR_DROPDOWN_BUTTON_TEST_TAG = "top_bar_dropdown_button_test_tag"
+const val DELETE_DROPDOWN_MENU_ITEM_TEST_TAG = "delete_dropdown_menu_item_test_tag"
+
+// SelectLocationScreen
+const val SELECT_LOCATION_CUSTOM_LIST_HEADER_TEST_TAG =
+ "select_location_custom_list_header_test_tag"
+const val SELECT_LOCATION_CUSTOM_LIST_BOTTOM_SHEET_TEST_TAG =
+ "select_location_custom_list_bottom_sheet_test_tag"
+const val SELECT_LOCATION_LOCATION_BOTTOM_SHEET_TEST_TAG =
+ "select_location_location_bottom_sheet_test_tag"
+
+// ServerIpOverridesScreen
+const val SERVER_IP_OVERRIDE_IMPORT_TEST_TAG = "server_ip_override_import_button_test_tag"
+const val SERVER_IP_OVERRIDE_INFO_TEST_TAG = "server_ip_override_info_button_test_tag"
+const val SERVER_IP_OVERRIDE_MORE_VERT_TEST_TAG = "server_ip_override_more_vert_button_test_tag"
+const val SERVER_IP_OVERRIDE_RESET_OVERRIDES_TEST_TAG = "server_ip_override_reset_button_test_tag"
+const val SERVER_IP_OVERRIDES_IMPORT_BY_FILE_TEST_TAG = "server_ip_override_import_by_file_test_tag"
+const val SERVER_IP_OVERRIDES_IMPORT_BY_TEXT_TEST_TAG = "server_ip_override_import_by_text_test_tag"
+
+// ResetServerIpOverridesConfirmationDialog
+const val RESET_SERVER_IP_OVERRIDE_RESET_TEST_TAG = "reset_server_ip_override_reset_button_test_tag"
+const val RESET_SERVER_IP_OVERRIDE_CANCEL_TEST_TAG =
+ "reset_server_ip_override_cancel_button_test_tag"
+
+// SaveApiAccessMethodDialog
+const val SAVE_API_ACCESS_METHOD_LOADING_SPINNER_TEST_TAG =
+ "save_api_access_method_loading_spinner_test_tag"
+const val SAVE_API_ACCESS_METHOD_CANCEL_BUTTON_TEST_TAG =
+ "save_api_access_method_cancel_button_test_tag"
+const val SAVE_API_ACCESS_METHOD_SAVE_BUTTON_TEST_TAG =
+ "save_api_access_method_save_button_test_tag"
+
+// ApiAccessListScreen
+const val API_ACCESS_LIST_INFO_TEST_TAG = "api_access_list_info_test_tag"
+
+// ApiAccessMethodDetailsScreen
+const val API_ACCESS_DETAILS_TOP_BAR_DROPDOWN_BUTTON_TEST_TAG =
+ "api_access_details_top_bar_dropdown_button_test_tag"
+const val API_ACCESS_DETAILS_EDIT_BUTTON_TEST_TAG = "api_access_details_edit_button_test_tag"
+const val API_ACCESS_USE_METHOD_BUTTON_TEST_TAG = "api_access_details_use_method_test_tag"
+const val API_ACCESS_TEST_METHOD_BUTTON_TEST_TAG = "api_access_details_test_method_test_tag"
+
+// EditApiAccessMethodScreen
+const val EDIT_API_ACCESS_NAME_INPUT_TEST_TAG = "edit_api_access_name_input_test_tag"
+
+// Udp2TcpSettingScreen
+const val UDP_OVER_TCP_PORT_ITEM_AUTOMATIC_TEST_TAG = "udp_over_tcp_item_automatic_test_tag"
+const val UDP_OVER_TCP_PORT_ITEM_X_TEST_TAG = "udp_over_tcp_item_%d_test_tag"
+
+// ShadowsocksSettingsScreen
+const val SHADOWSOCKS_PORT_ITEM_AUTOMATIC_TEST_TAG = "shadowsocks_item_automatic_test_tag"
+const val SHADOWSOCKS_PORT_ITEM_X_TEST_TAG = "shadowsocks_item_%d_test_tag"
+const val SHADOWSOCKS_CUSTOM_PORT_TEXT_TEST_TAG = "shadowsocks_custom_port_text_test_tag"