Adding testTags for radiobutton and floating options elements

This commit is contained in:
ifernandezdiaz 2024-10-29 16:40:03 -03:00
parent 7ea7d78e66
commit d0b6b5f501
3 changed files with 7 additions and 6 deletions

View file

@ -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 = {

View file

@ -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")
)
}
}

View file

@ -56,7 +56,7 @@ fun VaultContent(
showDivider = true,
modifier = Modifier
.fillMaxWidth()
.testTag("FolderFilter")
.testTag("VerificationCodesFilter")
.padding(16.dp),
)
}