From d0b6b5f50196d0b6af4b1fb3515f07b63a33513b Mon Sep 17 00:00:00 2001 From: ifernandezdiaz Date: Tue, 29 Oct 2024 16:40:03 -0300 Subject: [PATCH] Adding testTags for radiobutton and floating options elements --- .../appbar/action/BitwardenOverflowActionItem.kt | 8 +++----- .../components/dialog/row/BitwardenSelectionRow.kt | 3 +++ .../bitwarden/ui/vault/feature/vault/VaultContent.kt | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/appbar/action/BitwardenOverflowActionItem.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/appbar/action/BitwardenOverflowActionItem.kt index 67a2a6a43..97357c324 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/appbar/action/BitwardenOverflowActionItem.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/appbar/action/BitwardenOverflowActionItem.kt @@ -65,6 +65,7 @@ fun BitwardenOverflowActionItem( containerColor = BitwardenTheme.colorScheme.background.primary, modifier = Modifier .semantics { testTagsAsResourceId = true } + .testTag("FloatingOptionsContent") .widthIn( min = 112.dp, max = 280.dp, @@ -72,16 +73,13 @@ fun BitwardenOverflowActionItem( content = { menuItemDataList.forEach { dropdownMenuItemData -> DropdownMenuItem( - modifier = Modifier.semantics { - dropdownMenuItemData.testTag?.let { - testTag = it - } - }, + modifier = Modifier.testTag("FloatingOptionsItem"), colors = bitwardenMenuItemColors(), text = { Text( text = dropdownMenuItemData.text, style = BitwardenTheme.typography.bodyLarge, + modifier = Modifier.testTag("FloatingOptionsItemName") ) }, onClick = { diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/dialog/row/BitwardenSelectionRow.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/dialog/row/BitwardenSelectionRow.kt index 238eb53c2..a8e637483 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/dialog/row/BitwardenSelectionRow.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/dialog/row/BitwardenSelectionRow.kt @@ -11,6 +11,7 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.testTag import androidx.compose.ui.semantics.selected import androidx.compose.ui.semantics.semantics import androidx.compose.ui.unit.dp @@ -35,6 +36,7 @@ fun BitwardenSelectionRow( Row( modifier = modifier .fillMaxWidth() + .testTag("AlertSelectionOption") .clickable( interactionSource = remember { MutableInteractionSource() }, indication = ripple( @@ -56,6 +58,7 @@ fun BitwardenSelectionRow( text = text(), color = BitwardenTheme.colorScheme.text.primary, style = BitwardenTheme.typography.bodyLarge, + modifier = Modifier.testTag("AlertSelectionOptionName") ) } } diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultContent.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultContent.kt index 5a2f53570..b93f5917d 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultContent.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultContent.kt @@ -56,7 +56,7 @@ fun VaultContent( showDivider = true, modifier = Modifier .fillMaxWidth() - .testTag("FolderFilter") + .testTag("VerificationCodesFilter") .padding(16.dp), ) }