BIT-1971: Add remaining appbar and fab test tags (#1128)

This commit is contained in:
David Perez 2024-03-12 15:53:54 -05:00 committed by Álison Fernandes
parent b3e4d3807c
commit 4d945d20f2
7 changed files with 21 additions and 2 deletions

View file

@ -105,6 +105,7 @@ fun BitwardenTopAppBar(
maxLines = 1, maxLines = 1,
softWrap = false, softWrap = false,
overflow = TextOverflow.Ellipsis, overflow = TextOverflow.Ellipsis,
modifier = Modifier.semantics { testTag = "PageTitleLabel" },
) )
}, },
modifier = modifier.semantics { testTag = "HeaderBarComponent" }, modifier = modifier.semantics { testTag = "HeaderBarComponent" },

View file

@ -36,6 +36,8 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
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.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
@ -136,6 +138,7 @@ fun BlockAutoFillScreen(
onClick = remember(viewModel) { onClick = remember(viewModel) {
{ viewModel.trySendAction(BlockAutoFillAction.AddUriClick) } { viewModel.trySendAction(BlockAutoFillAction.AddUriClick) }
}, },
modifier = Modifier.semantics { testTag = "AddItemButton" },
) { ) {
Icon( Icon(
painter = painterResource(id = R.drawable.ic_plus), painter = painterResource(id = R.drawable.ic_plus),

View file

@ -28,6 +28,8 @@ import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
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.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
@ -90,7 +92,9 @@ fun FoldersScreen(
onClick = remember(viewModel) { onClick = remember(viewModel) {
{ viewModel.trySendAction(FoldersAction.AddFolderButtonClick) } { viewModel.trySendAction(FoldersAction.AddFolderButtonClick) }
}, },
modifier = Modifier.navigationBarsPadding(), modifier = Modifier
.semantics { testTag = "AddItemButton" }
.navigationBarsPadding(),
) { ) {
Icon( Icon(
painter = painterResource(id = R.drawable.ic_plus), painter = painterResource(id = R.drawable.ic_plus),

View file

@ -23,6 +23,8 @@ import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
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.core.net.toUri import androidx.core.net.toUri
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.collectAsStateWithLifecycle
@ -159,6 +161,7 @@ fun SendScreen(
onClick = remember(viewModel) { onClick = remember(viewModel) {
{ viewModel.trySendAction(SendAction.AddSendClick) } { viewModel.trySendAction(SendAction.AddSendClick) }
}, },
modifier = Modifier.semantics { testTag = "AddItemButton" },
) { ) {
Icon( Icon(
painter = painterResource(id = R.drawable.ic_plus), painter = painterResource(id = R.drawable.ic_plus),

View file

@ -254,7 +254,9 @@ fun VaultItemScreen(
onClick = remember(viewModel) { onClick = remember(viewModel) {
{ viewModel.trySendAction(VaultItemAction.Common.EditClick) } { viewModel.trySendAction(VaultItemAction.Common.EditClick) }
}, },
modifier = Modifier.padding(bottom = 16.dp), modifier = Modifier
.semantics { testTag = "EditItemButton" }
.padding(bottom = 16.dp),
) { ) {
Icon( Icon(
painter = painterResource(id = R.drawable.ic_edit), painter = painterResource(id = R.drawable.ic_edit),

View file

@ -24,6 +24,8 @@ import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
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.core.net.toUri import androidx.core.net.toUri
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
import com.x8bit.bitwarden.R import com.x8bit.bitwarden.R
@ -227,6 +229,7 @@ private fun VaultItemListingScaffold(
FloatingActionButton( FloatingActionButton(
containerColor = MaterialTheme.colorScheme.primaryContainer, containerColor = MaterialTheme.colorScheme.primaryContainer,
onClick = vaultItemListingHandlers.addVaultItemClick, onClick = vaultItemListingHandlers.addVaultItemClick,
modifier = Modifier.semantics { testTag = "AddItemButton" },
) { ) {
Icon( Icon(
painter = painterResource(id = R.drawable.ic_plus), painter = painterResource(id = R.drawable.ic_plus),

View file

@ -30,6 +30,8 @@ import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
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 androidx.core.net.toUri import androidx.core.net.toUri
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
@ -252,6 +254,7 @@ private fun VaultScreenScaffold(
FloatingActionButton( FloatingActionButton(
containerColor = MaterialTheme.colorScheme.primaryContainer, containerColor = MaterialTheme.colorScheme.primaryContainer,
onClick = vaultHandlers.addItemClickAction, onClick = vaultHandlers.addItemClickAction,
modifier = Modifier.semantics { testTag = "AddItemButton" },
) { ) {
Icon( Icon(
painter = painterResource(id = R.drawable.ic_plus), painter = painterResource(id = R.drawable.ic_plus),