From ece8bc932550ae53a6c563c8a9361ab503a51073 Mon Sep 17 00:00:00 2001 From: David Perez Date: Mon, 26 Feb 2024 14:43:52 -0600 Subject: [PATCH] BIT-1652: Add element IDs to AddItem Screen for Appium tests (#1066) --- .../ui/vault/components/CollectionItemSelector.kt | 3 +++ .../ui/vault/feature/addedit/VaultAddEditItemContent.kt | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/components/CollectionItemSelector.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/components/CollectionItemSelector.kt index d368d07ec..01a4a5c45 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/components/CollectionItemSelector.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/components/CollectionItemSelector.kt @@ -12,6 +12,8 @@ import androidx.compose.material3.Text import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource +import androidx.compose.ui.semantics.semantics +import androidx.compose.ui.semantics.testTag import androidx.compose.ui.unit.dp import com.x8bit.bitwarden.R import com.x8bit.bitwarden.ui.platform.components.BitwardenListHeaderText @@ -50,6 +52,7 @@ fun LazyListScope.collectionItemsSelector( }, modifier = Modifier .fillMaxWidth() + .semantics { testTag = "CollectionItemCell" } .padding(horizontal = 16.dp), ) } diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditItemContent.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditItemContent.kt index 38fa52789..d60ff01e6 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditItemContent.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditItemContent.kt @@ -10,6 +10,8 @@ import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource +import androidx.compose.ui.semantics.semantics +import androidx.compose.ui.semantics.testTag import androidx.compose.ui.unit.dp import com.x8bit.bitwarden.R import com.x8bit.bitwarden.ui.platform.components.BitwardenListHeaderText @@ -58,6 +60,7 @@ fun VaultAddEditContent( text = stringResource(R.string.personal_ownership_policy_in_effect), modifier = Modifier .padding(horizontal = 16.dp) + .semantics { testTag = "PersonalOwnershipPolicyLabel" } .fillMaxWidth(), ) } @@ -77,7 +80,9 @@ fun VaultAddEditContent( TypeOptionsItem( itemType = state.type, onTypeOptionClicked = onTypeOptionClicked, - modifier = Modifier.padding(horizontal = 16.dp), + modifier = Modifier + .semantics { testTag = "ItemTypePicker" } + .padding(horizontal = 16.dp), ) } }