mirror of
https://github.com/bitwarden/android.git
synced 2026-04-29 12:32:26 -05:00
BIT-1650: Add element IDs to Vault Screen for appium tests (#1065)
This commit is contained in:
committed by
Álison Fernandes
parent
4c7c82b5d0
commit
444630258c
@@ -12,6 +12,8 @@ import androidx.compose.runtime.Composable
|
|||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
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 androidx.compose.ui.unit.dp
|
||||||
import com.x8bit.bitwarden.R
|
import com.x8bit.bitwarden.R
|
||||||
import com.x8bit.bitwarden.ui.platform.components.BitwardenGroupItem
|
import com.x8bit.bitwarden.ui.platform.components.BitwardenGroupItem
|
||||||
@@ -36,7 +38,6 @@ fun VaultContent(
|
|||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
) {
|
) {
|
||||||
if (state.totpItemsCount > 0) {
|
if (state.totpItemsCount > 0) {
|
||||||
|
|
||||||
item {
|
item {
|
||||||
BitwardenListHeaderTextWithSupportLabel(
|
BitwardenListHeaderTextWithSupportLabel(
|
||||||
label = stringResource(id = R.string.totp),
|
label = stringResource(id = R.string.totp),
|
||||||
@@ -56,13 +57,13 @@ fun VaultContent(
|
|||||||
showDivider = true,
|
showDivider = true,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
.semantics { testTag = "FolderFilter" }
|
||||||
.padding(16.dp),
|
.padding(16.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.favoriteItems.isNotEmpty()) {
|
if (state.favoriteItems.isNotEmpty()) {
|
||||||
|
|
||||||
item {
|
item {
|
||||||
BitwardenListHeaderTextWithSupportLabel(
|
BitwardenListHeaderTextWithSupportLabel(
|
||||||
label = stringResource(id = R.string.favorites),
|
label = stringResource(id = R.string.favorites),
|
||||||
@@ -99,6 +100,7 @@ fun VaultContent(
|
|||||||
},
|
},
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
.semantics { testTag = "CipherCell" }
|
||||||
.padding(
|
.padding(
|
||||||
start = 16.dp,
|
start = 16.dp,
|
||||||
// There is some built-in padding to the menu button that makes up
|
// There is some built-in padding to the menu button that makes up
|
||||||
@@ -142,6 +144,7 @@ fun VaultContent(
|
|||||||
showDivider = false,
|
showDivider = false,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
.semantics { testTag = "LoginFilter" }
|
||||||
.padding(horizontal = 16.dp),
|
.padding(horizontal = 16.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -155,6 +158,7 @@ fun VaultContent(
|
|||||||
showDivider = false,
|
showDivider = false,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
.semantics { testTag = "CardFilter" }
|
||||||
.padding(horizontal = 16.dp),
|
.padding(horizontal = 16.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -168,6 +172,7 @@ fun VaultContent(
|
|||||||
showDivider = false,
|
showDivider = false,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
.semantics { testTag = "IdentityFilter" }
|
||||||
.padding(horizontal = 16.dp),
|
.padding(horizontal = 16.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -181,6 +186,7 @@ fun VaultContent(
|
|||||||
showDivider = false,
|
showDivider = false,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
.semantics { testTag = "SecureNoteFilter" }
|
||||||
.padding(horizontal = 16.dp),
|
.padding(horizontal = 16.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -219,6 +225,7 @@ fun VaultContent(
|
|||||||
showDivider = false,
|
showDivider = false,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
.semantics { testTag = "FolderFilter" }
|
||||||
.padding(horizontal = 16.dp),
|
.padding(horizontal = 16.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -266,6 +273,7 @@ fun VaultContent(
|
|||||||
},
|
},
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
.semantics { testTag = "CipherCell" }
|
||||||
.padding(horizontal = 16.dp),
|
.padding(horizontal = 16.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -301,6 +309,7 @@ fun VaultContent(
|
|||||||
showDivider = false,
|
showDivider = false,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
.semantics { testTag = "CollectionFilter" }
|
||||||
.padding(horizontal = 16.dp),
|
.padding(horizontal = 16.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -339,6 +348,7 @@ fun VaultContent(
|
|||||||
showDivider = false,
|
showDivider = false,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
.semantics { testTag = "TrashFilter" }
|
||||||
.padding(horizontal = 16.dp),
|
.padding(horizontal = 16.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ import androidx.compose.ui.Alignment
|
|||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
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 androidx.compose.ui.unit.dp
|
||||||
import com.x8bit.bitwarden.R
|
import com.x8bit.bitwarden.R
|
||||||
import com.x8bit.bitwarden.ui.platform.base.util.bottomDivider
|
import com.x8bit.bitwarden.ui.platform.base.util.bottomDivider
|
||||||
@@ -73,6 +75,7 @@ fun VaultFilter(
|
|||||||
.scrolledContainerBackground(topAppBarScrollBehavior)
|
.scrolledContainerBackground(topAppBarScrollBehavior)
|
||||||
.bottomDivider(color = MaterialTheme.colorScheme.outlineVariant)
|
.bottomDivider(color = MaterialTheme.colorScheme.outlineVariant)
|
||||||
.padding(vertical = 8.dp)
|
.padding(vertical = 8.dp)
|
||||||
|
.semantics { testTag = "ActiveFilterRow" }
|
||||||
.then(modifier),
|
.then(modifier),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
@@ -83,13 +86,16 @@ fun VaultFilter(
|
|||||||
),
|
),
|
||||||
style = MaterialTheme.typography.bodyLarge,
|
style = MaterialTheme.typography.bodyLarge,
|
||||||
color = MaterialTheme.colorScheme.onSurface,
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
modifier = Modifier.weight(1f),
|
modifier = Modifier
|
||||||
|
.semantics { testTag = "ActiveFilterLabel" }
|
||||||
|
.weight(1f),
|
||||||
)
|
)
|
||||||
|
|
||||||
Spacer(modifier = Modifier.width(16.dp))
|
Spacer(modifier = Modifier.width(16.dp))
|
||||||
|
|
||||||
IconButton(
|
IconButton(
|
||||||
onClick = { shouldShowSelectionDialog = true },
|
onClick = { shouldShowSelectionDialog = true },
|
||||||
|
modifier = Modifier.semantics { testTag = "OpenOrgFilter" },
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
painter = painterResource(id = R.drawable.ic_more_horizontal),
|
painter = painterResource(id = R.drawable.ic_more_horizontal),
|
||||||
|
|||||||
@@ -219,6 +219,7 @@ private fun VaultScreenScaffold(
|
|||||||
onClick = {
|
onClick = {
|
||||||
updateAccountMenuVisibility(!accountMenuVisible)
|
updateAccountMenuVisibility(!accountMenuVisible)
|
||||||
},
|
},
|
||||||
|
actionTestTag = "AccountIconButton",
|
||||||
)
|
)
|
||||||
BitwardenSearchActionItem(
|
BitwardenSearchActionItem(
|
||||||
contentDescription = stringResource(id = R.string.search_vault),
|
contentDescription = stringResource(id = R.string.search_vault),
|
||||||
|
|||||||
Reference in New Issue
Block a user