Replace all usage of semantics { testTag = '' } with extension (#1288)

This commit is contained in:
Caleb Derosier 2024-04-19 13:54:29 -06:00 committed by Álison Fernandes
parent 1e9644bc8c
commit 15cb60e3d2
66 changed files with 361 additions and 352 deletions

View file

@ -35,6 +35,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.CustomAccessibilityAction import androidx.compose.ui.semantics.CustomAccessibilityAction
@ -180,7 +181,7 @@ fun CreateAccountScreen(
onClick = remember(viewModel) { onClick = remember(viewModel) {
{ viewModel.trySendAction(SubmitClick) } { viewModel.trySendAction(SubmitClick) }
}, },
modifier = Modifier.semantics { testTag = "SubmitButton" }, modifier = Modifier.testTag("SubmitButton"),
) )
}, },
) )
@ -201,7 +202,7 @@ fun CreateAccountScreen(
{ viewModel.trySendAction(EmailInputChange(it)) } { viewModel.trySendAction(EmailInputChange(it)) }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "EmailAddressEntry" } .testTag("EmailAddressEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
keyboardType = KeyboardType.Email, keyboardType = KeyboardType.Email,
@ -218,7 +219,7 @@ fun CreateAccountScreen(
{ viewModel.trySendAction(PasswordInputChange(it)) } { viewModel.trySendAction(PasswordInputChange(it)) }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "MasterPasswordEntry" } .testTag("MasterPasswordEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
showPasswordTestTag = "PasswordVisibilityToggle", showPasswordTestTag = "PasswordVisibilityToggle",
@ -238,7 +239,7 @@ fun CreateAccountScreen(
{ viewModel.trySendAction(ConfirmPasswordInputChange(it)) } { viewModel.trySendAction(ConfirmPasswordInputChange(it)) }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "ConfirmMasterPasswordEntry" } .testTag("ConfirmMasterPasswordEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
showPasswordTestTag = "ConfirmPasswordVisibilityToggle", showPasswordTestTag = "ConfirmPasswordVisibilityToggle",
@ -252,7 +253,7 @@ fun CreateAccountScreen(
}, },
hint = stringResource(id = R.string.master_password_hint_description), hint = stringResource(id = R.string.master_password_hint_description),
modifier = Modifier modifier = Modifier
.semantics { testTag = "MasterPasswordHintLabel" } .testTag("MasterPasswordHintLabel")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -266,7 +267,7 @@ fun CreateAccountScreen(
} }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "CheckExposedMasterPasswordToggle" } .testTag("CheckExposedMasterPasswordToggle")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
Spacer(modifier = Modifier.height(8.dp)) Spacer(modifier = Modifier.height(8.dp))

View file

@ -20,9 +20,9 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.testTag
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.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
@ -122,7 +122,7 @@ fun EnterpriseSignOnScreen(
onClick = remember(viewModel) { onClick = remember(viewModel) {
{ viewModel.trySendAction(EnterpriseSignOnAction.LogInClick) } { viewModel.trySendAction(EnterpriseSignOnAction.LogInClick) }
}, },
modifier = Modifier.semantics { testTag = "LoginButton" }, modifier = Modifier.testTag("LoginButton"),
) )
}, },
) )

View file

@ -20,9 +20,9 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
@ -94,7 +94,7 @@ fun EnvironmentScreen(
onClick = remember(viewModel) { onClick = remember(viewModel) {
{ viewModel.trySendAction(EnvironmentAction.SaveClick) } { viewModel.trySendAction(EnvironmentAction.SaveClick) }
}, },
modifier = Modifier.semantics { testTag = "SaveButton" }, modifier = Modifier.testTag("SaveButton"),
) )
}, },
) )
@ -127,7 +127,7 @@ fun EnvironmentScreen(
keyboardType = KeyboardType.Uri, keyboardType = KeyboardType.Uri,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "ServerUrlEntry" } .testTag("ServerUrlEntry")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -151,7 +151,7 @@ fun EnvironmentScreen(
keyboardType = KeyboardType.Uri, keyboardType = KeyboardType.Uri,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "WebVaultUrlEntry" } .testTag("WebVaultUrlEntry")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -166,7 +166,7 @@ fun EnvironmentScreen(
keyboardType = KeyboardType.Uri, keyboardType = KeyboardType.Uri,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "ApiUrlEntry" } .testTag("ApiUrlEntry")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -181,7 +181,7 @@ fun EnvironmentScreen(
keyboardType = KeyboardType.Uri, keyboardType = KeyboardType.Uri,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "IdentityUrlEntry" } .testTag("IdentityUrlEntry")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -197,7 +197,7 @@ fun EnvironmentScreen(
keyboardType = KeyboardType.Uri, keyboardType = KeyboardType.Uri,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "IconsUrlEntry" } .testTag("IconsUrlEntry")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )

View file

@ -37,9 +37,9 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
@ -257,7 +257,7 @@ private fun LandingScreenContent(
BitwardenTextField( BitwardenTextField(
modifier = Modifier modifier = Modifier
.semantics { testTag = "EmailAddressEntry" } .testTag("EmailAddressEntry")
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
value = state.emailInput, value = state.emailInput,
@ -272,7 +272,7 @@ private fun LandingScreenContent(
selectedOption = state.selectedEnvironmentType, selectedOption = state.selectedEnvironmentType,
onOptionSelected = onEnvironmentTypeSelect, onOptionSelected = onEnvironmentTypeSelect,
modifier = Modifier modifier = Modifier
.semantics { testTag = "RegionSelectorDropdown" } .testTag("RegionSelectorDropdown")
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -282,7 +282,7 @@ private fun LandingScreenContent(
isChecked = state.isRememberMeEnabled, isChecked = state.isRememberMeEnabled,
onCheckedChange = onRememberMeToggle, onCheckedChange = onRememberMeToggle,
modifier = Modifier modifier = Modifier
.semantics { testTag = "RememberMeSwitch" } .testTag("RememberMeSwitch")
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -294,7 +294,7 @@ private fun LandingScreenContent(
onClick = onContinueClick, onClick = onContinueClick,
isEnabled = state.isContinueButtonEnabled, isEnabled = state.isContinueButtonEnabled,
modifier = Modifier modifier = Modifier
.semantics { testTag = "ContinueButton" } .testTag("ContinueButton")
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -319,7 +319,7 @@ private fun LandingScreenContent(
label = stringResource(id = R.string.create_account), label = stringResource(id = R.string.create_account),
onClick = onCreateAccountClick, onClick = onCreateAccountClick,
modifier = Modifier modifier = Modifier
.semantics { testTag = "CreateAccountLabel" }, .testTag("CreateAccountLabel"),
) )
} }

View file

@ -28,9 +28,9 @@ import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalSoftwareKeyboardController import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.platform.SoftwareKeyboardController import androidx.compose.ui.platform.SoftwareKeyboardController
import androidx.compose.ui.platform.testTag
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.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
@ -240,7 +240,7 @@ private fun LoginScreenContent(
) { ) {
BitwardenPasswordField( BitwardenPasswordField(
modifier = Modifier modifier = Modifier
.semantics { testTag = "MasterPasswordEntry" } .testTag("MasterPasswordEntry")
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
value = state.passwordInput, value = state.passwordInput,
@ -255,7 +255,7 @@ private fun LoginScreenContent(
style = MaterialTheme.typography.bodySmall, style = MaterialTheme.typography.bodySmall,
modifier = Modifier modifier = Modifier
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.semantics { testTag = "GetMasterPasswordHintLabel" }, .testTag("GetMasterPasswordHintLabel"),
) )
Spacer(modifier = Modifier.height(20.dp)) Spacer(modifier = Modifier.height(20.dp))
@ -265,7 +265,7 @@ private fun LoginScreenContent(
onClick = onLoginButtonClick, onClick = onLoginButtonClick,
isEnabled = state.isLoginButtonEnabled, isEnabled = state.isLoginButtonEnabled,
modifier = Modifier modifier = Modifier
.semantics { testTag = "LogInWithMasterPasswordButton" } .testTag("LogInWithMasterPasswordButton")
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -278,7 +278,7 @@ private fun LoginScreenContent(
icon = painterResource(id = R.drawable.ic_device), icon = painterResource(id = R.drawable.ic_device),
onClick = onLoginWithDeviceClick, onClick = onLoginWithDeviceClick,
modifier = Modifier modifier = Modifier
.semantics { testTag = "LogInWithAnotherDeviceButton" } .testTag("LogInWithAnotherDeviceButton")
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -291,7 +291,7 @@ private fun LoginScreenContent(
icon = painterResource(id = R.drawable.ic_briefcase), icon = painterResource(id = R.drawable.ic_briefcase),
onClick = onSingleSignOnClick, onClick = onSingleSignOnClick,
modifier = Modifier modifier = Modifier
.semantics { testTag = "LogInWithSsoButton" } .testTag("LogInWithSsoButton")
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -308,7 +308,7 @@ private fun LoginScreenContent(
style = MaterialTheme.typography.bodyMedium, style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant, color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier modifier = Modifier
.semantics { testTag = "LoggingInAsLabel" } .testTag("LoggingInAsLabel")
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -318,7 +318,7 @@ private fun LoginScreenContent(
onClick = onNotYouButtonClick, onClick = onNotYouButtonClick,
style = MaterialTheme.typography.labelLarge, style = MaterialTheme.typography.labelLarge,
innerPadding = PaddingValues(vertical = 8.dp, horizontal = 16.dp), innerPadding = PaddingValues(vertical = 8.dp, horizontal = 16.dp),
modifier = Modifier.semantics { testTag = "NotYouLabel" }, modifier = Modifier.testTag("NotYouLabel"),
) )
Spacer(modifier = Modifier.navigationBarsPadding()) Spacer(modifier = Modifier.navigationBarsPadding())
} }

View file

@ -28,9 +28,9 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.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
@ -198,7 +198,7 @@ private fun LoginWithDeviceScreenContent(
style = LocalNonMaterialTypography.current.sensitiveInfoSmall, style = LocalNonMaterialTypography.current.sensitiveInfoSmall,
minLines = 2, minLines = 2,
modifier = Modifier modifier = Modifier
.semantics { testTag = "FingerprintPhraseValue" } .testTag("FingerprintPhraseValue")
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -218,7 +218,7 @@ private fun LoginWithDeviceScreenContent(
) )
} else { } else {
BitwardenClickableText( BitwardenClickableText(
modifier = Modifier.semantics { testTag = "ResendNotificationButton" }, modifier = Modifier.testTag("ResendNotificationButton"),
label = stringResource(id = R.string.resend_notification), label = stringResource(id = R.string.resend_notification),
style = MaterialTheme.typography.labelLarge, style = MaterialTheme.typography.labelLarge,
innerPadding = PaddingValues(vertical = 8.dp, horizontal = 16.dp), innerPadding = PaddingValues(vertical = 8.dp, horizontal = 16.dp),
@ -241,7 +241,7 @@ private fun LoginWithDeviceScreenContent(
) )
BitwardenClickableText( BitwardenClickableText(
modifier = Modifier.semantics { testTag = "ViewAllLoginOptionsButton" }, modifier = Modifier.testTag("ViewAllLoginOptionsButton"),
label = stringResource(id = R.string.view_all_login_options), label = stringResource(id = R.string.view_all_login_options),
innerPadding = PaddingValues(vertical = 8.dp, horizontal = 16.dp), innerPadding = PaddingValues(vertical = 8.dp, horizontal = 16.dp),
style = MaterialTheme.typography.labelLarge, style = MaterialTheme.typography.labelLarge,

View file

@ -14,9 +14,9 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
@ -107,7 +107,7 @@ fun MasterPasswordHintScreen(
onClick = remember(viewModel) { onClick = remember(viewModel) {
{ viewModel.trySendAction(MasterPasswordHintAction.SubmitClick) } { viewModel.trySendAction(MasterPasswordHintAction.SubmitClick) }
}, },
modifier = Modifier.semantics { testTag = "SubmitButton" }, modifier = Modifier.testTag("SubmitButton"),
) )
}, },
) )

View file

@ -23,8 +23,8 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.testTag
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.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
@ -112,14 +112,14 @@ fun ResetPasswordScreen(
BitwardenTextButton( BitwardenTextButton(
label = stringResource(id = R.string.log_out), label = stringResource(id = R.string.log_out),
onClick = { shouldShowLogoutConfirmationDialog = true }, onClick = { shouldShowLogoutConfirmationDialog = true },
modifier = Modifier.semantics { testTag = "LogoutButton" }, modifier = Modifier.testTag("LogoutButton"),
) )
BitwardenTextButton( BitwardenTextButton(
label = stringResource(id = R.string.submit), label = stringResource(id = R.string.submit),
onClick = remember(viewModel) { onClick = remember(viewModel) {
{ viewModel.trySendAction(ResetPasswordAction.SubmitClick) } { viewModel.trySendAction(ResetPasswordAction.SubmitClick) }
}, },
modifier = Modifier.semantics { testTag = "SubmitButton" }, modifier = Modifier.testTag("SubmitButton"),
) )
}, },
) )
@ -202,7 +202,7 @@ private fun ResetPasswordScreenContent(
value = state.currentPasswordInput, value = state.currentPasswordInput,
onValueChange = onCurrentPasswordInputChanged, onValueChange = onCurrentPasswordInputChanged,
modifier = Modifier modifier = Modifier
.semantics { testTag = "MasterPasswordField" } .testTag("MasterPasswordField")
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -218,7 +218,7 @@ private fun ResetPasswordScreenContent(
showPassword = isPasswordVisible, showPassword = isPasswordVisible,
showPasswordChange = { isPasswordVisible = it }, showPasswordChange = { isPasswordVisible = it },
modifier = Modifier modifier = Modifier
.semantics { testTag = "NewPasswordField" } .testTag("NewPasswordField")
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -232,7 +232,7 @@ private fun ResetPasswordScreenContent(
showPassword = isPasswordVisible, showPassword = isPasswordVisible,
showPasswordChange = { isPasswordVisible = it }, showPasswordChange = { isPasswordVisible = it },
modifier = Modifier modifier = Modifier
.semantics { testTag = "RetypePasswordField" } .testTag("RetypePasswordField")
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -245,7 +245,7 @@ private fun ResetPasswordScreenContent(
onValueChange = onPasswordHintInputChanged, onValueChange = onPasswordHintInputChanged,
hint = stringResource(id = R.string.master_password_hint_description), hint = stringResource(id = R.string.master_password_hint_description),
modifier = Modifier modifier = Modifier
.semantics { testTag = "MasterPasswordHintLabel" } .testTag("MasterPasswordHintLabel")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )

View file

@ -23,8 +23,8 @@ import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
@ -72,14 +72,14 @@ fun SetPasswordScreen(
onClick = remember(viewModel) { onClick = remember(viewModel) {
{ viewModel.trySendAction(SetPasswordAction.CancelClick) } { viewModel.trySendAction(SetPasswordAction.CancelClick) }
}, },
modifier = Modifier.semantics { testTag = "CancelButton" }, modifier = Modifier.testTag("CancelButton"),
) )
BitwardenTextButton( BitwardenTextButton(
label = stringResource(id = R.string.submit), label = stringResource(id = R.string.submit),
onClick = remember(viewModel) { onClick = remember(viewModel) {
{ viewModel.trySendAction(SetPasswordAction.SubmitClick) } { viewModel.trySendAction(SetPasswordAction.SubmitClick) }
}, },
modifier = Modifier.semantics { testTag = "SubmitButton" }, modifier = Modifier.testTag("SubmitButton"),
) )
}, },
) )
@ -149,7 +149,7 @@ private fun SetPasswordScreenContent(
showPasswordChange = { isPasswordVisible = it }, showPasswordChange = { isPasswordVisible = it },
hint = stringResource(id = R.string.master_password_description), hint = stringResource(id = R.string.master_password_description),
modifier = Modifier modifier = Modifier
.semantics { testTag = "NewPasswordField" } .testTag("NewPasswordField")
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -163,7 +163,7 @@ private fun SetPasswordScreenContent(
showPassword = isPasswordVisible, showPassword = isPasswordVisible,
showPasswordChange = { isPasswordVisible = it }, showPasswordChange = { isPasswordVisible = it },
modifier = Modifier modifier = Modifier
.semantics { testTag = "RetypePasswordField" } .testTag("RetypePasswordField")
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -176,7 +176,7 @@ private fun SetPasswordScreenContent(
onValueChange = onPasswordHintInputChanged, onValueChange = onPasswordHintInputChanged,
hint = stringResource(id = R.string.master_password_hint_description), hint = stringResource(id = R.string.master_password_hint_description),
modifier = Modifier modifier = Modifier
.semantics { testTag = "MasterPasswordHintLabel" } .testTag("MasterPasswordHintLabel")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )

View file

@ -22,9 +22,9 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
@ -188,7 +188,7 @@ private fun TrustedDeviceScaffold(
style = MaterialTheme.typography.bodyMedium, style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant, color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier modifier = Modifier
.semantics { testTag = "LoggingInAsLabel" } .testTag("LoggingInAsLabel")
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -198,7 +198,7 @@ private fun TrustedDeviceScaffold(
onClick = handlers.onNotYouButtonClick, onClick = handlers.onNotYouButtonClick,
style = MaterialTheme.typography.labelLarge, style = MaterialTheme.typography.labelLarge,
innerPadding = PaddingValues(vertical = 8.dp, horizontal = 16.dp), innerPadding = PaddingValues(vertical = 8.dp, horizontal = 16.dp),
modifier = Modifier.semantics { testTag = "NotYouLabel" }, modifier = Modifier.testTag("NotYouLabel"),
) )
Spacer(modifier = Modifier.navigationBarsPadding()) Spacer(modifier = Modifier.navigationBarsPadding())

View file

@ -25,8 +25,8 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
@ -176,7 +176,7 @@ fun VaultUnlockScreen(
.vaultUnlockType .vaultUnlockType
.inputFieldVisibilityToggleTestTag, .inputFieldVisibilityToggleTestTag,
modifier = Modifier modifier = Modifier
.semantics { testTag = state.vaultUnlockType.unlockScreenInputTestTag } .testTag(state.vaultUnlockType.unlockScreenInputTestTag)
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -200,7 +200,7 @@ fun VaultUnlockScreen(
style = MaterialTheme.typography.bodyMedium, style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant, color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier modifier = Modifier
.semantics { testTag = "UserAndEnvironmentDataLabel" } .testTag("UserAndEnvironmentDataLabel")
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -234,7 +234,7 @@ fun VaultUnlockScreen(
}, },
isEnabled = state.input.isNotEmpty(), isEnabled = state.input.isNotEmpty(),
modifier = Modifier modifier = Modifier
.semantics { testTag = "UnlockVaultButton" } .testTag("UnlockVaultButton")
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
) )

View file

@ -6,10 +6,10 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.colorResource import androidx.compose.ui.res.colorResource
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.semantics.testTag
import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.Font import androidx.compose.ui.text.font.Font
@ -40,7 +40,7 @@ fun BitwardenAccountActionItem(
IconButton( IconButton(
onClick = onClick, onClick = onClick,
modifier = Modifier.semantics { testTag = "CurrentActiveAccount" }, modifier = Modifier.testTag("CurrentActiveAccount"),
) { ) {
Icon( Icon(
painter = iconPainter, painter = iconPainter,

View file

@ -35,10 +35,10 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
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.clearAndSetSemantics import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag 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
@ -203,7 +203,7 @@ private fun AnimatedAccountSwitcher(
) { ) {
LazyColumn( LazyColumn(
modifier = modifier modifier = modifier
.semantics { testTag = "AccountListView" } .testTag("AccountListView")
// To prevent going all the way up to the bottom of the screen, we'll add some small // To prevent going all the way up to the bottom of the screen, we'll add some small
// bottom padding. // bottom padding.
.padding(bottom = 24.dp) .padding(bottom = 24.dp)
@ -230,7 +230,7 @@ private fun AnimatedAccountSwitcher(
onClick = onAddAccountClick, onClick = onAddAccountClick,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "AddAccountButton" } .testTag("AddAccountButton")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -252,7 +252,7 @@ private fun AccountSummaryItem(
horizontalArrangement = Arrangement.Start, horizontalArrangement = Arrangement.Start,
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
modifier = Modifier modifier = Modifier
.semantics { testTag = "AccountCell" } .testTag("AccountCell")
.combinedClickable( .combinedClickable(
interactionSource = remember { MutableInteractionSource() }, interactionSource = remember { MutableInteractionSource() },
indication = rememberRipple(color = MaterialTheme.colorScheme.primary), indication = rememberRipple(color = MaterialTheme.colorScheme.primary),
@ -290,14 +290,14 @@ private fun AccountSummaryItem(
Text( Text(
text = accountSummary.email, text = accountSummary.email,
style = MaterialTheme.typography.bodyLarge, style = MaterialTheme.typography.bodyLarge,
modifier = Modifier.semantics { testTag = "AccountEmailLabel" }, modifier = Modifier.testTag("AccountEmailLabel"),
) )
Text( Text(
text = accountSummary.environmentLabel, text = accountSummary.environmentLabel,
style = MaterialTheme.typography.bodyMedium, style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant, color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.semantics { testTag = "AccountEnvironmentLabel" }, modifier = Modifier.testTag("AccountEnvironmentLabel"),
) )
accountSummary.supportingTextResOrNull?.let { supportingTextResId -> accountSummary.supportingTextResOrNull?.let { supportingTextResId ->
@ -305,7 +305,7 @@ private fun AccountSummaryItem(
text = stringResource(id = supportingTextResId).lowercaseWithCurrentLocal(), text = stringResource(id = supportingTextResId).lowercaseWithCurrentLocal(),
style = MaterialTheme.typography.bodyMedium, style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant, color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.semantics { testTag = "AccountStatusLabel" }, modifier = Modifier.testTag("AccountStatusLabel"),
) )
} }
} }
@ -317,7 +317,7 @@ private fun AccountSummaryItem(
contentDescription = null, contentDescription = null,
tint = MaterialTheme.colorScheme.onSurface, tint = MaterialTheme.colorScheme.onSurface,
modifier = Modifier modifier = Modifier
.semantics { testTag = accountSummary.iconTestTag } .testTag(accountSummary.iconTestTag)
.size(24.dp), .size(24.dp),
) )

View file

@ -12,8 +12,8 @@ import androidx.compose.material3.TopAppBarScrollBehavior
import androidx.compose.material3.rememberTopAppBarState import androidx.compose.material3.rememberTopAppBarState
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import com.x8bit.bitwarden.R import com.x8bit.bitwarden.R
@ -54,10 +54,10 @@ fun BitwardenMediumTopAppBar(
Text( Text(
text = title, text = title,
style = MaterialTheme.typography.titleLarge, style = MaterialTheme.typography.titleLarge,
modifier = Modifier.semantics { testTag = "PageTitleLabel" }, modifier = Modifier.testTag("PageTitleLabel"),
) )
}, },
modifier = modifier.semantics { testTag = "HeaderBarComponent" }, modifier = modifier.testTag("HeaderBarComponent"),
actions = actions, actions = actions,
) )
} }

View file

@ -19,9 +19,9 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.ImeAction
import com.x8bit.bitwarden.R import com.x8bit.bitwarden.R
@ -46,7 +46,7 @@ fun BitwardenSearchTopAppBar(
) { ) {
val focusRequester = remember { FocusRequester() } val focusRequester = remember { FocusRequester() }
TopAppBar( TopAppBar(
modifier = modifier.semantics { testTag = "HeaderBarComponent" }, modifier = modifier.testTag("HeaderBarComponent"),
colors = TopAppBarDefaults.topAppBarColors( colors = TopAppBarDefaults.topAppBarColors(
containerColor = MaterialTheme.colorScheme.surface, containerColor = MaterialTheme.colorScheme.surface,
scrolledContainerColor = MaterialTheme.colorScheme.surfaceContainer, scrolledContainerColor = MaterialTheme.colorScheme.surfaceContainer,
@ -59,7 +59,7 @@ fun BitwardenSearchTopAppBar(
navigationIcon?.let { navigationIcon?.let {
IconButton( IconButton(
onClick = it.onNavigationIconClick, onClick = it.onNavigationIconClick,
modifier = Modifier.semantics { testTag = "CloseButton" }, modifier = Modifier.testTag("CloseButton"),
) { ) {
Icon( Icon(
modifier = Modifier.mirrorIfRtl(), modifier = Modifier.mirrorIfRtl(),

View file

@ -13,9 +13,9 @@ import androidx.compose.material3.rememberTopAppBarState
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.painter.Painter import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
@ -88,7 +88,7 @@ fun BitwardenTopAppBar(
navigationIcon?.let { navigationIcon?.let {
IconButton( IconButton(
onClick = it.onNavigationIconClick, onClick = it.onNavigationIconClick,
modifier = Modifier.semantics { testTag = "CloseButton" }, modifier = Modifier.testTag("CloseButton"),
) { ) {
Icon( Icon(
modifier = Modifier.mirrorIfRtl(), modifier = Modifier.mirrorIfRtl(),
@ -105,10 +105,10 @@ fun BitwardenTopAppBar(
maxLines = 1, maxLines = 1,
softWrap = false, softWrap = false,
overflow = TextOverflow.Ellipsis, overflow = TextOverflow.Ellipsis,
modifier = Modifier.semantics { testTag = "PageTitleLabel" }, modifier = Modifier.testTag("PageTitleLabel"),
) )
}, },
modifier = modifier.semantics { testTag = "HeaderBarComponent" }, modifier = modifier.testTag("HeaderBarComponent"),
actions = actions, actions = actions,
) )
} }

View file

@ -17,6 +17,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
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.semantics
@ -54,7 +55,7 @@ fun BitwardenOverflowActionItem(
) { ) {
IconButton( IconButton(
onClick = { isOverflowMenuVisible = !isOverflowMenuVisible }, onClick = { isOverflowMenuVisible = !isOverflowMenuVisible },
modifier = Modifier.semantics { testTag = "HeaderBarOptionsButton" }, modifier = Modifier.testTag("HeaderBarOptionsButton"),
) { ) {
Icon( Icon(
painter = painterResource(id = R.drawable.ic_more), painter = painterResource(id = R.drawable.ic_more),

View file

@ -4,8 +4,8 @@ import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton import androidx.compose.material3.IconButton
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import com.x8bit.bitwarden.R import com.x8bit.bitwarden.R
@ -27,7 +27,7 @@ fun BitwardenSearchActionItem(
) { ) {
IconButton( IconButton(
onClick = onClick, onClick = onClick,
modifier = Modifier.semantics { testTag = "SearchButton" }, modifier = Modifier.testTag("SearchButton"),
) { ) {
Icon( Icon(
painter = painterResource(id = R.drawable.ic_search), painter = painterResource(id = R.drawable.ic_search),

View file

@ -7,6 +7,7 @@ import androidx.compose.material3.Icon
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.semantics.semantics import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag import androidx.compose.ui.semantics.testTag
@ -75,7 +76,7 @@ fun BitwardenTextFieldWithActions(
visualTransformation = visualTransformation, visualTransformation = visualTransformation,
) )
BitwardenRowOfActions( BitwardenRowOfActions(
modifier = Modifier.run { actionsTestTag?.let { semantics { testTag = it } } ?: this }, modifier = Modifier.run { actionsTestTag?.let { testTag(it) } ?: this },
actions = actions, actions = actions,
) )
} }

View file

@ -7,7 +7,7 @@ import androidx.compose.material3.SegmentedButtonDefaults
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.semantics.semantics import androidx.compose.ui.platform.testTag
import androidx.compose.ui.semantics.testTag import androidx.compose.ui.semantics.testTag
/** /**
@ -35,7 +35,7 @@ fun BitwardenSegmentedButton(
), ),
label = { Text(text = option.text) }, label = { Text(text = option.text) },
modifier = Modifier.run { modifier = Modifier.run {
option.testTag?.let { semantics { testTag = it } } ?: this option.testTag?.let { testTag(it) } ?: this
}, },
) )
} }

View file

@ -12,8 +12,8 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R import com.x8bit.bitwarden.R
@ -158,7 +158,7 @@ fun SearchContent(
} }
.toPersistentList(), .toPersistentList(),
modifier = Modifier modifier = Modifier
.semantics { testTag = searchType.searchItemTestTag } .testTag(searchType.searchItemTestTag)
.fillMaxWidth() .fillMaxWidth()
.padding( .padding(
start = 16.dp, start = 16.dp,

View file

@ -14,8 +14,8 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag 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
@ -49,7 +49,7 @@ fun SearchEmptyContent(
Text( Text(
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
modifier = Modifier modifier = Modifier
.semantics { testTag = "NoSearchResultsLabel" } .testTag("NoSearchResultsLabel")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
text = it(), text = it(),

View file

@ -15,9 +15,9 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.core.net.toUri import androidx.core.net.toUri
@ -93,7 +93,7 @@ fun SearchScreen(
onNavigationIconClick = searchHandlers.onBackClick, onNavigationIconClick = searchHandlers.onBackClick,
), ),
modifier = Modifier modifier = Modifier
.semantics { testTag = "SearchFieldEntry" } .testTag("SearchFieldEntry")
.bottomDivider(), .bottomDivider(),
) )
}, },

View file

@ -24,9 +24,9 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
@ -90,7 +90,7 @@ fun SettingsScreen(
{ viewModel.trySendAction(SettingsAction.SettingsClick(it)) } { viewModel.trySendAction(SettingsAction.SettingsClick(it)) }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = it.testTag } .testTag(it.testTag)
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
) )

View file

@ -29,6 +29,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.contentDescription import androidx.compose.ui.semantics.contentDescription
@ -171,7 +172,7 @@ private fun ContentColumn(
isChecked = state.isSubmitCrashLogsEnabled, isChecked = state.isSubmitCrashLogsEnabled,
onCheckedChange = onSubmitCrashLogsCheckedChange, onCheckedChange = onSubmitCrashLogsCheckedChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "SubmitCrashLogsSwitch" } .testTag("SubmitCrashLogsSwitch")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
contentDescription = stringResource(id = R.string.submit_crash_logs), contentDescription = stringResource(id = R.string.submit_crash_logs),

View file

@ -27,9 +27,9 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.core.net.toUri import androidx.core.net.toUri
@ -171,7 +171,7 @@ fun AccountSecurityScreen(
{ viewModel.trySendAction(AccountSecurityAction.PushNotificationConfirm) } { viewModel.trySendAction(AccountSecurityAction.PushNotificationConfirm) }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "ApproveLoginRequestsSwitch" } .testTag("ApproveLoginRequestsSwitch")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -182,7 +182,7 @@ fun AccountSecurityScreen(
{ viewModel.trySendAction(AccountSecurityAction.PendingLoginRequestsClick) } { viewModel.trySendAction(AccountSecurityAction.PendingLoginRequestsClick) }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "PendingLogInRequestsLabel" } .testTag("PendingLogInRequestsLabel")
.fillMaxWidth(), .fillMaxWidth(),
) )
} }
@ -201,7 +201,7 @@ fun AccountSecurityScreen(
}, },
biometricsManager = biometricsManager, biometricsManager = biometricsManager,
modifier = Modifier modifier = Modifier
.semantics { testTag = "UnlockWithBiometricsSwitch" } .testTag("UnlockWithBiometricsSwitch")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -212,7 +212,7 @@ fun AccountSecurityScreen(
{ viewModel.trySendAction(it) } { viewModel.trySendAction(it) }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "UnlockWithPinSwitch" } .testTag("UnlockWithPinSwitch")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -237,7 +237,7 @@ fun AccountSecurityScreen(
{ viewModel.trySendAction(AccountSecurityAction.VaultTimeoutTypeSelect(it)) } { viewModel.trySendAction(AccountSecurityAction.VaultTimeoutTypeSelect(it)) }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "VaultTimeoutChooser" } .testTag("VaultTimeoutChooser")
.fillMaxWidth(), .fillMaxWidth(),
) )
(state.vaultTimeout as? VaultTimeout.Custom)?.let { customTimeout -> (state.vaultTimeout as? VaultTimeout.Custom)?.let { customTimeout ->
@ -262,7 +262,7 @@ fun AccountSecurityScreen(
{ viewModel.trySendAction(AccountSecurityAction.VaultTimeoutActionSelect(it)) } { viewModel.trySendAction(AccountSecurityAction.VaultTimeoutActionSelect(it)) }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "VaultTimeoutActionChooser" } .testTag("VaultTimeoutActionChooser")
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -279,7 +279,7 @@ fun AccountSecurityScreen(
{ viewModel.trySendAction(AccountSecurityAction.AccountFingerprintPhraseClick) } { viewModel.trySendAction(AccountSecurityAction.AccountFingerprintPhraseClick) }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "AccountFingerprintPhraseLabel" } .testTag("AccountFingerprintPhraseLabel")
.fillMaxWidth(), .fillMaxWidth(),
) )
BitwardenExternalLinkRow( BitwardenExternalLinkRow(
@ -291,7 +291,7 @@ fun AccountSecurityScreen(
dialogTitle = stringResource(id = R.string.continue_to_web_app), dialogTitle = stringResource(id = R.string.continue_to_web_app),
dialogMessage = stringResource(id = R.string.two_step_login_description_long), dialogMessage = stringResource(id = R.string.two_step_login_description_long),
modifier = Modifier modifier = Modifier
.semantics { testTag = "TwoStepLoginLinkItemView" } .testTag("TwoStepLoginLinkItemView")
.fillMaxWidth(), .fillMaxWidth(),
) )
if (state.isUnlockWithPasswordEnabled) { if (state.isUnlockWithPasswordEnabled) {
@ -315,7 +315,7 @@ fun AccountSecurityScreen(
{ viewModel.trySendAction(AccountSecurityAction.LockNowClick) } { viewModel.trySendAction(AccountSecurityAction.LockNowClick) }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "LockNowLabel" } .testTag("LockNowLabel")
.fillMaxWidth(), .fillMaxWidth(),
) )
} }
@ -325,7 +325,7 @@ fun AccountSecurityScreen(
{ viewModel.trySendAction(AccountSecurityAction.LogoutClick) } { viewModel.trySendAction(AccountSecurityAction.LogoutClick) }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "LogOutLabel" } .testTag("LogOutLabel")
.fillMaxWidth(), .fillMaxWidth(),
) )
BitwardenTextRow( BitwardenTextRow(
@ -334,7 +334,7 @@ fun AccountSecurityScreen(
{ viewModel.trySendAction(AccountSecurityAction.DeleteAccountClick) } { viewModel.trySendAction(AccountSecurityAction.DeleteAccountClick) }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "DeleteAccountLabel" } .testTag("DeleteAccountLabel")
.fillMaxWidth(), .fillMaxWidth(),
) )
} }
@ -573,7 +573,7 @@ private fun SessionTimeoutRow(
text = selectedVaultTimeoutType.displayLabel(), text = selectedVaultTimeoutType.displayLabel(),
style = MaterialTheme.typography.labelSmall, style = MaterialTheme.typography.labelSmall,
color = MaterialTheme.colorScheme.onSurfaceVariant, color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.semantics { testTag = "SessionTimeoutStatusLabel" }, modifier = Modifier.testTag("SessionTimeoutStatusLabel"),
) )
} }
@ -728,7 +728,7 @@ private fun SessionTimeoutActionRow(
color = MaterialTheme.colorScheme.onSurfaceVariant.copy( color = MaterialTheme.colorScheme.onSurfaceVariant.copy(
alpha = if (isEnabled) 1.0f else 0.38f, alpha = if (isEnabled) 1.0f else 0.38f,
), ),
modifier = Modifier.semantics { testTag = "SessionTimeoutActionStatusLabel" }, modifier = Modifier.testTag("SessionTimeoutActionStatusLabel"),
) )
} }
when { when {

View file

@ -26,9 +26,9 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
@ -166,7 +166,7 @@ fun DeleteAccountScreen(
}, },
isUnlockWithPasswordEnabled = state.isUnlockWithPasswordEnabled, isUnlockWithPasswordEnabled = state.isUnlockWithPasswordEnabled,
modifier = Modifier modifier = Modifier
.semantics { testTag = "DELETE ACCOUNT" } .testTag("DELETE ACCOUNT")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -177,7 +177,7 @@ fun DeleteAccountScreen(
{ viewModel.trySendAction(DeleteAccountAction.CancelClick) } { viewModel.trySendAction(DeleteAccountAction.CancelClick) }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "CANCEL" } .testTag("CANCEL")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )

View file

@ -23,6 +23,7 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.semantics
@ -176,7 +177,7 @@ private fun LoginApprovalContent(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.semantics { testTag = "LogInAttemptByLabel" }, .testTag("LogInAttemptByLabel"),
) )
Spacer(modifier = Modifier.height(24.dp)) Spacer(modifier = Modifier.height(24.dp))
@ -196,7 +197,7 @@ private fun LoginApprovalContent(
color = LocalNonMaterialColors.current.fingerprint, color = LocalNonMaterialColors.current.fingerprint,
style = LocalNonMaterialTypography.current.sensitiveInfoSmall, style = LocalNonMaterialTypography.current.sensitiveInfoSmall,
modifier = Modifier modifier = Modifier
.semantics { testTag = "FingerprintValueLabel" } .testTag("FingerprintValueLabel")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -227,7 +228,7 @@ private fun LoginApprovalContent(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.semantics { testTag = "ConfirmLoginButton" }, .testTag("ConfirmLoginButton"),
) )
Spacer(modifier = Modifier.height(8.dp)) Spacer(modifier = Modifier.height(8.dp))
@ -238,7 +239,7 @@ private fun LoginApprovalContent(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.semantics { testTag = "DenyLoginButton" }, .testTag("DenyLoginButton"),
) )
Spacer(modifier = Modifier.navigationBarsPadding()) Spacer(modifier = Modifier.navigationBarsPadding())

View file

@ -37,9 +37,9 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.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
@ -209,7 +209,7 @@ private fun PendingRequestsContent(
timestamp = request.timestamp, timestamp = request.timestamp,
onNavigateToLoginApproval = onNavigateToLoginApproval, onNavigateToLoginApproval = onNavigateToLoginApproval,
modifier = Modifier modifier = Modifier
.semantics { testTag = "LoginRequestCell" } .testTag("LoginRequestCell")
.fillMaxWidth(), .fillMaxWidth(),
) )
HorizontalDivider( HorizontalDivider(
@ -224,7 +224,7 @@ private fun PendingRequestsContent(
icon = painterResource(id = R.drawable.ic_trash), icon = painterResource(id = R.drawable.ic_trash),
onClick = { shouldShowDeclineAllRequestsConfirm = true }, onClick = { shouldShowDeclineAllRequestsConfirm = true },
modifier = Modifier modifier = Modifier
.semantics { testTag = "DeclineAllRequestsButton" } .testTag("DeclineAllRequestsButton")
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -272,7 +272,7 @@ private fun PendingRequestItem(
style = LocalNonMaterialTypography.current.sensitiveInfoSmall, style = LocalNonMaterialTypography.current.sensitiveInfoSmall,
textAlign = TextAlign.Start, textAlign = TextAlign.Start,
modifier = Modifier modifier = Modifier
.semantics { testTag = "FingerprintValueLabel" } .testTag("FingerprintValueLabel")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )

View file

@ -19,9 +19,9 @@ import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
@ -87,7 +87,7 @@ fun AppearanceScreen(
{ viewModel.trySendAction(AppearanceAction.LanguageChange(it)) } { viewModel.trySendAction(AppearanceAction.LanguageChange(it)) }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "LanguageChooser" } .testTag("LanguageChooser")
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -97,7 +97,7 @@ fun AppearanceScreen(
{ viewModel.trySendAction(AppearanceAction.ThemeChange(it)) } { viewModel.trySendAction(AppearanceAction.ThemeChange(it)) }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "ThemeChooser" } .testTag("ThemeChooser")
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -109,7 +109,7 @@ fun AppearanceScreen(
{ viewModel.trySendAction(AppearanceAction.ShowWebsiteIconsToggle(it)) } { viewModel.trySendAction(AppearanceAction.ShowWebsiteIconsToggle(it)) }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "ShowWebsiteIconsSwitch" } .testTag("ShowWebsiteIconsSwitch")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )

View file

@ -24,9 +24,9 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
@ -131,7 +131,7 @@ fun AutoFillScreen(
}, },
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "AutofillServicesSwitch" } .testTag("AutofillServicesSwitch")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
BitwardenWideSwitch( BitwardenWideSwitch(
@ -144,7 +144,7 @@ fun AutoFillScreen(
enabled = state.canInteractWithInlineAutofillToggle, enabled = state.canInteractWithInlineAutofillToggle,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "InlineAutofillSwitch" } .testTag("InlineAutofillSwitch")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
Spacer(modifier = Modifier.height(16.dp)) Spacer(modifier = Modifier.height(16.dp))
@ -163,7 +163,7 @@ fun AutoFillScreen(
}, },
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "CopyTotpAutomaticallySwitch" } .testTag("CopyTotpAutomaticallySwitch")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
BitwardenWideSwitch( BitwardenWideSwitch(
@ -175,7 +175,7 @@ fun AutoFillScreen(
}, },
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "AskToAddLoginSwitch" } .testTag("AskToAddLoginSwitch")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
DefaultUriMatchTypeRow( DefaultUriMatchTypeRow(
@ -184,7 +184,7 @@ fun AutoFillScreen(
{ viewModel.trySendAction(AutoFillAction.DefaultUriMatchTypeSelect(it)) } { viewModel.trySendAction(AutoFillAction.DefaultUriMatchTypeSelect(it)) }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "DefaultUriMatchDetectionChooser" } .testTag("DefaultUriMatchDetectionChooser")
.fillMaxWidth(), .fillMaxWidth(),
) )
BitwardenTextRow( BitwardenTextRow(

View file

@ -34,9 +34,9 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.testTag
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.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
@ -138,7 +138,7 @@ fun BlockAutoFillScreen(
onClick = remember(viewModel) { onClick = remember(viewModel) {
{ viewModel.trySendAction(BlockAutoFillAction.AddUriClick) } { viewModel.trySendAction(BlockAutoFillAction.AddUriClick) }
}, },
modifier = Modifier.semantics { testTag = "AddItemButton" }, modifier = Modifier.testTag("AddItemButton"),
) { ) {
Icon( Icon(
painter = painterResource(id = R.drawable.ic_plus), painter = painterResource(id = R.drawable.ic_plus),

View file

@ -26,9 +26,9 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.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
@ -93,7 +93,7 @@ fun FoldersScreen(
{ viewModel.trySendAction(FoldersAction.AddFolderButtonClick) } { viewModel.trySendAction(FoldersAction.AddFolderButtonClick) }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "AddItemButton" } .testTag("AddItemButton")
.navigationBarsPadding(), .navigationBarsPadding(),
) { ) {
Icon( Icon(
@ -154,7 +154,7 @@ private fun FoldersContent(
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
style = MaterialTheme.typography.bodyMedium, style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurface, color = MaterialTheme.colorScheme.onSurface,
modifier = Modifier.semantics { testTag = "NoFoldersLabel" }, modifier = Modifier.testTag("NoFoldersLabel"),
) )
} }
} else { } else {
@ -164,7 +164,7 @@ private fun FoldersContent(
items(foldersList) { items(foldersList) {
Row( Row(
modifier = Modifier modifier = Modifier
.semantics { testTag = "FolderCell" } .testTag("FolderCell")
.clickable( .clickable(
interactionSource = remember { MutableInteractionSource() }, interactionSource = remember { MutableInteractionSource() },
indication = rememberRipple(color = MaterialTheme.colorScheme.primary), indication = rememberRipple(color = MaterialTheme.colorScheme.primary),
@ -178,7 +178,7 @@ private fun FoldersContent(
) { ) {
Text( Text(
modifier = Modifier modifier = Modifier
.semantics { testTag = "FolderName" } .testTag("FolderName")
.padding(start = 16.dp) .padding(start = 16.dp)
.weight(1f), .weight(1f),
text = it.name, text = it.name,

View file

@ -18,9 +18,9 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
@ -110,7 +110,7 @@ fun FolderAddEditScreen(
onClick = remember(viewModel) { onClick = remember(viewModel) {
{ viewModel.trySendAction(FolderAddEditAction.SaveClick) } { viewModel.trySendAction(FolderAddEditAction.SaveClick) }
}, },
modifier = Modifier.semantics { testTag = "SaveButton" }, modifier = Modifier.testTag("SaveButton"),
) )
if (state.shouldShowOverflowMenu) { if (state.shouldShowOverflowMenu) {
BitwardenOverflowActionItem( BitwardenOverflowActionItem(

View file

@ -24,9 +24,9 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
@ -98,7 +98,7 @@ fun OtherScreen(
}, },
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "SyncOnRefreshSwitch" } .testTag("SyncOnRefreshSwitch")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -111,7 +111,7 @@ fun OtherScreen(
label = stringResource(id = R.string.sync_now), label = stringResource(id = R.string.sync_now),
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "SyncNowButton" } .testTag("SyncNowButton")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -120,7 +120,7 @@ fun OtherScreen(
Row( Row(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "LastSyncLabel" } .testTag("LastSyncLabel")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Start, horizontalArrangement = Arrangement.Start,
@ -144,7 +144,7 @@ fun OtherScreen(
{ viewModel.trySendAction(OtherAction.ClearClipboardFrequencyChange(it)) } { viewModel.trySendAction(OtherAction.ClearClipboardFrequencyChange(it)) }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "ClearClipboardChooser" } .testTag("ClearClipboardChooser")
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -155,7 +155,7 @@ fun OtherScreen(
}, },
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "AllowScreenCaptureSwitch" } .testTag("AllowScreenCaptureSwitch")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -217,7 +217,7 @@ private fun ClearClipboardFrequencyRow(
text = currentSelection.displayLabel.invoke(), text = currentSelection.displayLabel.invoke(),
style = MaterialTheme.typography.labelSmall, style = MaterialTheme.typography.labelSmall,
color = MaterialTheme.colorScheme.onSurfaceVariant, color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.semantics { testTag = "ClearClipboardAfterLabel" }, modifier = Modifier.testTag("ClearClipboardAfterLabel"),
) )
} }

View file

@ -15,9 +15,9 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.core.net.toUri import androidx.core.net.toUri
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
@ -92,7 +92,7 @@ fun VaultSettingsScreen(
}, },
withDivider = true, withDivider = true,
modifier = Modifier modifier = Modifier
.semantics { testTag = "FoldersLabel" } .testTag("FoldersLabel")
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -103,7 +103,7 @@ fun VaultSettingsScreen(
}, },
withDivider = true, withDivider = true,
modifier = Modifier modifier = Modifier
.semantics { testTag = "ExportVaultLabel" } .testTag("ExportVaultLabel")
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -120,7 +120,7 @@ fun VaultSettingsScreen(
state.value.importUrl, state.value.importUrl,
), ),
modifier = Modifier modifier = Modifier
.semantics { testTag = "ImportItemsLinkItemView" } .testTag("ImportItemsLinkItemView")
.fillMaxWidth(), .fillMaxWidth(),
) )
} }

View file

@ -28,9 +28,9 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.text.style.TextOverflow
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
@ -317,7 +317,7 @@ private fun VaultBottomAppBar(
selectedTextColor = MaterialTheme.colorScheme.onSecondaryContainer, selectedTextColor = MaterialTheme.colorScheme.onSecondaryContainer,
unselectedTextColor = MaterialTheme.colorScheme.onSurface, unselectedTextColor = MaterialTheme.colorScheme.onSurface,
), ),
modifier = Modifier.semantics { testTag = destination.testTag }, modifier = Modifier.testTag(destination.testTag),
) )
} }
} }

View file

@ -39,6 +39,7 @@ import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.testTag
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.semantics
@ -283,7 +284,7 @@ private fun ModalAppBar(
BitwardenTextButton( BitwardenTextButton(
label = stringResource(id = R.string.select), label = stringResource(id = R.string.select),
onClick = onSelectClick, onClick = onSelectClick,
modifier = Modifier.semantics { testTag = "SelectButton" }, modifier = Modifier.testTag("SelectButton"),
) )
}, },
) )
@ -321,7 +322,7 @@ private fun ScrollContent(
BitwardenPolicyWarningText( BitwardenPolicyWarningText(
text = stringResource(id = R.string.password_generator_policy_in_effect), text = stringResource(id = R.string.password_generator_policy_in_effect),
modifier = Modifier modifier = Modifier
.semantics { testTag = "PasswordGeneratorPolicyInEffectLabel" } .testTag("PasswordGeneratorPolicyInEffectLabel")
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -398,7 +399,7 @@ private fun GeneratedStringItem(
contentDescription = stringResource(id = R.string.copy), contentDescription = stringResource(id = R.string.copy),
), ),
onClick = onCopyClick, onClick = onCopyClick,
modifier = Modifier.semantics { testTag = "CopyValueButton" }, modifier = Modifier.testTag("CopyValueButton"),
) )
BitwardenIconButtonWithResource( BitwardenIconButtonWithResource(
iconRes = IconResource( iconRes = IconResource(
@ -406,7 +407,7 @@ private fun GeneratedStringItem(
contentDescription = stringResource(id = R.string.generate_password), contentDescription = stringResource(id = R.string.generate_password),
), ),
onClick = onRegenerateClick, onClick = onRegenerateClick,
modifier = Modifier.semantics { testTag = "RegenerateValueButton" }, modifier = Modifier.testTag("RegenerateValueButton"),
) )
}, },
onValueChange = {}, onValueChange = {},
@ -438,7 +439,7 @@ private fun MainStateOptionsItem(
modifier = Modifier modifier = Modifier
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "GeneratorTypePicker" }, .testTag("GeneratorTypePicker"),
) )
} }
@ -492,7 +493,7 @@ private fun PasscodeOptionsItem(
modifier = Modifier modifier = Modifier
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "PasswordTypePicker" }, .testTag("PasswordTypePicker"),
) )
} }
@ -613,7 +614,7 @@ private fun PasswordLengthSliderItem(
singleLine = true, singleLine = true,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number), keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
modifier = Modifier modifier = Modifier
.semantics { testTag = "PasswordLengthLabel" } .testTag("PasswordLengthLabel")
.wrapContentWidth() .wrapContentWidth()
.width(labelTextWidth + 16.dp + 16.dp), .width(labelTextWidth + 16.dp + 16.dp),
) )
@ -635,7 +636,7 @@ private fun PasswordLengthSliderItem(
disabledInactiveTickColor = Color.Transparent, disabledInactiveTickColor = Color.Transparent,
), ),
modifier = Modifier modifier = Modifier
.semantics { testTag = "PasswordLengthSlider" } .testTag("PasswordLengthSlider")
.weight(1f), .weight(1f),
) )
} }
@ -654,7 +655,7 @@ private fun PasswordCapitalLettersToggleItem(
enabled = enabled, enabled = enabled,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "UppercaseAtoZToggle" } .testTag("UppercaseAtoZToggle")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
contentDescription = stringResource(id = R.string.uppercase_ato_z), contentDescription = stringResource(id = R.string.uppercase_ato_z),
) )
@ -673,7 +674,7 @@ private fun PasswordLowercaseLettersToggleItem(
enabled = enabled, enabled = enabled,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "LowercaseAtoZToggle" } .testTag("LowercaseAtoZToggle")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
contentDescription = stringResource(id = R.string.lowercase_ato_z), contentDescription = stringResource(id = R.string.lowercase_ato_z),
) )
@ -692,7 +693,7 @@ private fun PasswordNumbersToggleItem(
enabled = enabled, enabled = enabled,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "NumbersZeroToNineToggle" } .testTag("NumbersZeroToNineToggle")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
contentDescription = stringResource(id = R.string.numbers_zero_to_nine), contentDescription = stringResource(id = R.string.numbers_zero_to_nine),
) )
@ -711,7 +712,7 @@ private fun PasswordSpecialCharactersToggleItem(
enabled = enabled, enabled = enabled,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "SpecialCharactersToggle" } .testTag("SpecialCharactersToggle")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
contentDescription = stringResource(id = R.string.special_characters), contentDescription = stringResource(id = R.string.special_characters),
) )
@ -732,7 +733,7 @@ private fun PasswordMinNumbersCounterItem(
increaseButtonTestTag = "MinNumberIncreaseButton", increaseButtonTestTag = "MinNumberIncreaseButton",
decreaseButtonTestTag = "MinNumberDecreaseButton", decreaseButtonTestTag = "MinNumberDecreaseButton",
modifier = Modifier modifier = Modifier
.semantics { testTag = "MinNumberValueLabel" } .testTag("MinNumberValueLabel")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -752,7 +753,7 @@ private fun PasswordMinSpecialCharactersCounterItem(
increaseButtonTestTag = "MinSpecialIncreaseButton", increaseButtonTestTag = "MinSpecialIncreaseButton",
decreaseButtonTestTag = "MinSpecialDecreaseButton", decreaseButtonTestTag = "MinSpecialDecreaseButton",
modifier = Modifier modifier = Modifier
.semantics { testTag = "MinSpecialValueLabel" } .testTag("MinSpecialValueLabel")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -770,7 +771,7 @@ private fun PasswordAvoidAmbiguousCharsToggleItem(
onCheckedChange = onPasswordToggleAvoidAmbiguousCharsChange, onCheckedChange = onPasswordToggleAvoidAmbiguousCharsChange,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "AvoidAmbiguousCharsToggle" } .testTag("AvoidAmbiguousCharsToggle")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -839,7 +840,7 @@ private fun PassphraseNumWordsCounterItem(
increaseButtonTestTag = "NumberOfWordsIncreaseButton", increaseButtonTestTag = "NumberOfWordsIncreaseButton",
decreaseButtonTestTag = "NumberOfWordsDecreaseButton", decreaseButtonTestTag = "NumberOfWordsDecreaseButton",
modifier = Modifier modifier = Modifier
.semantics { testTag = "NumberOfWordsLabel" } .testTag("NumberOfWordsLabel")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -862,7 +863,7 @@ private fun PassphraseWordSeparatorInputItem(
} }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "WordSeparatorEntry" } .testTag("WordSeparatorEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -880,7 +881,7 @@ private fun PassphraseCapitalizeToggleItem(
onCheckedChange = onPassphraseCapitalizeToggleChange, onCheckedChange = onPassphraseCapitalizeToggleChange,
enabled = enabled, enabled = enabled,
modifier = Modifier modifier = Modifier
.semantics { testTag = "CapitalizePassphraseToggle" } .testTag("CapitalizePassphraseToggle")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -898,7 +899,7 @@ private fun PassphraseIncludeNumberToggleItem(
enabled = enabled, enabled = enabled,
onCheckedChange = onPassphraseIncludeNumberToggleChange, onCheckedChange = onPassphraseIncludeNumberToggleChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IncludeNumbersToggle" } .testTag("IncludeNumbersToggle")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -972,7 +973,7 @@ private fun UsernameOptionsItem(
modifier = Modifier modifier = Modifier
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "UsernameTypePicker" }, .testTag("UsernameTypePicker"),
supportingText = currentSubState.selectedType.supportingStringResId?.let { supportingText = currentSubState.selectedType.supportingStringResId?.let {
stringResource(id = it) stringResource(id = it)
}, },
@ -1012,7 +1013,7 @@ private fun ColumnScope.ForwardedEmailAliasTypeContent(
showPasswordTestTag = "ShowForwardedEmailApiSecretButton", showPasswordTestTag = "ShowForwardedEmailApiSecretButton",
modifier = Modifier modifier = Modifier
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.semantics { testTag = "ForwardedEmailApiSecretEntry" } .testTag("ForwardedEmailApiSecretEntry")
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -1024,7 +1025,7 @@ private fun ColumnScope.ForwardedEmailAliasTypeContent(
onValueChange = forwardedEmailAliasHandlers.onAddyIoDomainNameTextChange, onValueChange = forwardedEmailAliasHandlers.onAddyIoDomainNameTextChange,
modifier = Modifier modifier = Modifier
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.semantics { testTag = "AnonAddyDomainNameEntry" } .testTag("AnonAddyDomainNameEntry")
.fillMaxWidth(), .fillMaxWidth(),
) )
} }
@ -1037,7 +1038,7 @@ private fun ColumnScope.ForwardedEmailAliasTypeContent(
showPasswordTestTag = "ShowForwardedEmailApiSecretButton", showPasswordTestTag = "ShowForwardedEmailApiSecretButton",
modifier = Modifier modifier = Modifier
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.semantics { testTag = "ForwardedEmailApiSecretEntry" } .testTag("ForwardedEmailApiSecretEntry")
.fillMaxWidth(), .fillMaxWidth(),
) )
} }
@ -1050,7 +1051,7 @@ private fun ColumnScope.ForwardedEmailAliasTypeContent(
showPasswordTestTag = "ShowForwardedEmailApiSecretButton", showPasswordTestTag = "ShowForwardedEmailApiSecretButton",
modifier = Modifier modifier = Modifier
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.semantics { testTag = "ForwardedEmailApiSecretEntry" } .testTag("ForwardedEmailApiSecretEntry")
.fillMaxWidth(), .fillMaxWidth(),
) )
} }
@ -1063,7 +1064,7 @@ private fun ColumnScope.ForwardedEmailAliasTypeContent(
showPasswordTestTag = "ShowForwardedEmailApiSecretButton", showPasswordTestTag = "ShowForwardedEmailApiSecretButton",
modifier = Modifier modifier = Modifier
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.semantics { testTag = "ForwardedEmailApiSecretEntry" } .testTag("ForwardedEmailApiSecretEntry")
.fillMaxWidth(), .fillMaxWidth(),
) )
} }
@ -1076,7 +1077,7 @@ private fun ColumnScope.ForwardedEmailAliasTypeContent(
showPasswordTestTag = "ShowForwardedEmailApiSecretButton", showPasswordTestTag = "ShowForwardedEmailApiSecretButton",
modifier = Modifier modifier = Modifier
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.semantics { testTag = "ForwardedEmailApiSecretEntry" } .testTag("ForwardedEmailApiSecretEntry")
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -1088,7 +1089,7 @@ private fun ColumnScope.ForwardedEmailAliasTypeContent(
onValueChange = forwardedEmailAliasHandlers.onForwardEmailDomainNameTextChange, onValueChange = forwardedEmailAliasHandlers.onForwardEmailDomainNameTextChange,
modifier = Modifier modifier = Modifier
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.semantics { testTag = "ForwardedEmailDomainNameEntry" } .testTag("ForwardedEmailDomainNameEntry")
.fillMaxWidth(), .fillMaxWidth(),
) )
} }
@ -1101,7 +1102,7 @@ private fun ColumnScope.ForwardedEmailAliasTypeContent(
showPasswordTestTag = "ShowForwardedEmailApiSecretButton", showPasswordTestTag = "ShowForwardedEmailApiSecretButton",
modifier = Modifier modifier = Modifier
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.semantics { testTag = "ForwardedEmailApiSecretEntry" } .testTag("ForwardedEmailApiSecretEntry")
.fillMaxWidth(), .fillMaxWidth(),
) )
} }
@ -1115,7 +1116,7 @@ private fun ColumnScope.ForwardedEmailAliasTypeContent(
showPasswordTestTag = "ShowForwardedEmailApiSecretButton", showPasswordTestTag = "ShowForwardedEmailApiSecretButton",
modifier = Modifier modifier = Modifier
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.semantics { testTag = "ForwardedEmailApiSecretEntry" } .testTag("ForwardedEmailApiSecretEntry")
.fillMaxWidth(), .fillMaxWidth(),
) )
} }
@ -1143,7 +1144,7 @@ private fun ServiceTypeOptionsItem(
}, },
modifier = Modifier modifier = Modifier
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.semantics { testTag = "ServiceTypePicker" } .testTag("ServiceTypePicker")
.fillMaxWidth(), .fillMaxWidth(),
) )
} }
@ -1176,7 +1177,7 @@ private fun PlusAddressedEmailTextInputItem(
}, },
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "PlusAddressedEmailEntry" } .testTag("PlusAddressedEmailEntry")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -1211,7 +1212,7 @@ private fun CatchAllEmailTextInputItem(
}, },
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "CatchAllEmailDomainEntry" } .testTag("CatchAllEmailDomainEntry")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -1249,7 +1250,7 @@ private fun RandomWordCapitalizeToggleItem(
onCheckedChange = onRandomWordCapitalizeToggleChange, onCheckedChange = onRandomWordCapitalizeToggleChange,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "CapitalizeRandomWordUsernameToggle" } .testTag("CapitalizeRandomWordUsernameToggle")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -1265,7 +1266,7 @@ private fun RandomWordIncludeNumberToggleItem(
onCheckedChange = onRandomWordIncludeNumberToggleChange, onCheckedChange = onRandomWordIncludeNumberToggleChange,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "IncludeNumberRandomWordUsernameToggle" } .testTag("IncludeNumberRandomWordUsernameToggle")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }

View file

@ -17,9 +17,9 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
@ -65,7 +65,7 @@ fun PasswordHistoryListItem(
style = textStyle, style = textStyle,
color = MaterialTheme.colorScheme.onSurface, color = MaterialTheme.colorScheme.onSurface,
modifier = Modifier modifier = Modifier
.semantics { testTag = "GeneratedPasswordValue" } .testTag("GeneratedPasswordValue")
.fillMaxWidth() .fillMaxWidth()
.onGloballyPositioned { widthPx = it.size.width }, .onGloballyPositioned { widthPx = it.size.width },
) )
@ -74,7 +74,7 @@ fun PasswordHistoryListItem(
text = supportingLabel, text = supportingLabel,
style = MaterialTheme.typography.bodyMedium, style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant, color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.semantics { testTag = "GeneratedPasswordDateLabel" }, modifier = Modifier.testTag("GeneratedPasswordDateLabel"),
) )
} }
@ -83,7 +83,7 @@ fun PasswordHistoryListItem(
colors = IconButtonDefaults.iconButtonColors( colors = IconButtonDefaults.iconButtonColors(
contentColor = MaterialTheme.colorScheme.primary, contentColor = MaterialTheme.colorScheme.primary,
), ),
modifier = Modifier.semantics { testTag = "CopyPasswordValueButton" }, modifier = Modifier.testTag("CopyPasswordValueButton"),
) { ) {
Icon( Icon(
painter = painterResource(id = R.drawable.ic_copy), painter = painterResource(id = R.drawable.ic_copy),

View file

@ -26,9 +26,9 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
@ -170,7 +170,7 @@ private fun PasswordHistoryContent(
supportingLabel = password.date, supportingLabel = password.date,
onCopyClick = { onPasswordCopyClick(password) }, onCopyClick = { onPasswordCopyClick(password) },
modifier = Modifier modifier = Modifier
.semantics { testTag = "GeneratedPasswordRow" } .testTag("GeneratedPasswordRow")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -210,7 +210,7 @@ private fun PasswordHistoryEmpty(modifier: Modifier = Modifier) {
contentAlignment = Alignment.Center, contentAlignment = Alignment.Center,
) { ) {
Text( Text(
modifier = Modifier.semantics { testTag = "NoPasswordsDisplayedLabel" }, modifier = Modifier.testTag("NoPasswordsDisplayedLabel"),
text = stringResource(id = R.string.no_passwords_to_list), text = stringResource(id = R.string.no_passwords_to_list),
style = MaterialTheme.typography.bodyMedium, style = MaterialTheme.typography.bodyMedium,
) )

View file

@ -9,9 +9,9 @@ import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items import androidx.compose.foundation.lazy.items
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R import com.x8bit.bitwarden.R
@ -39,7 +39,7 @@ fun SendContent(
BitwardenPolicyWarningText( BitwardenPolicyWarningText(
text = stringResource(id = R.string.send_disabled_warning), text = stringResource(id = R.string.send_disabled_warning),
modifier = Modifier modifier = Modifier
.semantics { testTag = "SendOptionsPolicyInEffectLabel" } .testTag("SendOptionsPolicyInEffectLabel")
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -63,7 +63,7 @@ fun SendContent(
onClick = sendHandlers.onTextTypeClick, onClick = sendHandlers.onTextTypeClick,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "SendTextFilter" } .testTag("SendTextFilter")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -76,7 +76,7 @@ fun SendContent(
onClick = sendHandlers.onFileTypeClick, onClick = sendHandlers.onFileTypeClick,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "SendFileFilter" } .testTag("SendFileFilter")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -110,7 +110,7 @@ fun SendContent(
null null
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "SendCell" } .testTag("SendCell")
.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

View file

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

View file

@ -29,6 +29,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clipToBounds import androidx.compose.ui.draw.clipToBounds
import androidx.compose.ui.platform.testTag
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.semantics
@ -86,7 +87,7 @@ fun AddSendContent(
BitwardenPolicyWarningText( BitwardenPolicyWarningText(
text = stringResource(id = R.string.send_options_policy_in_effect), text = stringResource(id = R.string.send_options_policy_in_effect),
modifier = Modifier modifier = Modifier
.semantics { testTag = "SendOptionsPolicyInEffectLabel" } .testTag("SendOptionsPolicyInEffectLabel")
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
) )
@ -96,7 +97,7 @@ fun AddSendContent(
BitwardenTextField( BitwardenTextField(
modifier = Modifier modifier = Modifier
.semantics { testTag = "SendNameEntry" } .testTag("SendNameEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
label = stringResource(id = R.string.name), label = stringResource(id = R.string.name),
@ -168,7 +169,7 @@ fun AddSendContent(
} else if (isAddMode) { } else if (isAddMode) {
Text( Text(
modifier = Modifier modifier = Modifier
.semantics { testTag = "SendCurrentFileNameLabel" } .testTag("SendCurrentFileNameLabel")
.align(Alignment.CenterHorizontally), .align(Alignment.CenterHorizontally),
text = type.name ?: stringResource(id = R.string.no_file_chosen), text = type.name ?: stringResource(id = R.string.no_file_chosen),
color = MaterialTheme.colorScheme.onSurfaceVariant, color = MaterialTheme.colorScheme.onSurfaceVariant,
@ -187,7 +188,7 @@ fun AddSendContent(
} }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "SendChooseFileButton" } .testTag("SendChooseFileButton")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -234,7 +235,7 @@ fun AddSendContent(
is AddSendState.ViewState.Content.SendType.Text -> { is AddSendState.ViewState.Content.SendType.Text -> {
BitwardenTextField( BitwardenTextField(
modifier = Modifier modifier = Modifier
.semantics { testTag = "SendTextContentEntry" } .testTag("SendTextContentEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
label = stringResource(id = R.string.text), label = stringResource(id = R.string.text),
@ -247,7 +248,7 @@ fun AddSendContent(
Spacer(modifier = Modifier.height(16.dp)) Spacer(modifier = Modifier.height(16.dp))
BitwardenWideSwitch( BitwardenWideSwitch(
modifier = Modifier modifier = Modifier
.semantics { testTag = "SendHideTextByDefaultToggle" } .testTag("SendHideTextByDefaultToggle")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
label = stringResource(id = R.string.hide_text_by_default), label = stringResource(id = R.string.hide_text_by_default),
@ -292,7 +293,7 @@ private fun AddSendOptions(
var isExpanded by rememberSaveable { mutableStateOf(false) } var isExpanded by rememberSaveable { mutableStateOf(false) }
Row( Row(
modifier = Modifier modifier = Modifier
.semantics { testTag = "SendShowHideOptionsButton" } .testTag("SendShowHideOptionsButton")
.fillMaxWidth() .fillMaxWidth()
.clickable( .clickable(
onClickLabel = if (isExpanded) { onClickLabel = if (isExpanded) {
@ -333,7 +334,7 @@ private fun AddSendOptions(
if (isAddMode) { if (isAddMode) {
SendDeletionDateChooser( SendDeletionDateChooser(
modifier = Modifier modifier = Modifier
.semantics { testTag = "SendDeletionOptionsPicker" } .testTag("SendDeletionOptionsPicker")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
dateFormatPattern = state.common.dateFormatPattern, dateFormatPattern = state.common.dateFormatPattern,
@ -345,7 +346,7 @@ private fun AddSendOptions(
Spacer(modifier = Modifier.height(8.dp)) Spacer(modifier = Modifier.height(8.dp))
SendExpirationDateChooser( SendExpirationDateChooser(
modifier = Modifier modifier = Modifier
.semantics { testTag = "SendExpirationOptionsPicker" } .testTag("SendExpirationOptionsPicker")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
dateFormatPattern = state.common.dateFormatPattern, dateFormatPattern = state.common.dateFormatPattern,
@ -364,7 +365,7 @@ private fun AddSendOptions(
Spacer(modifier = Modifier.height(8.dp)) Spacer(modifier = Modifier.height(8.dp))
AddSendCustomDateChooser( AddSendCustomDateChooser(
modifier = Modifier modifier = Modifier
.semantics { testTag = "SendCustomDeletionDatePicker" } .testTag("SendCustomDeletionDatePicker")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
dateLabel = stringResource(id = R.string.deletion_date), dateLabel = stringResource(id = R.string.deletion_date),
@ -395,7 +396,7 @@ private fun AddSendOptions(
Spacer(modifier = Modifier.height(8.dp)) Spacer(modifier = Modifier.height(8.dp))
AddSendCustomDateChooser( AddSendCustomDateChooser(
modifier = Modifier modifier = Modifier
.semantics { testTag = "SendCustomExpirationDatePicker" } .testTag("SendCustomExpirationDatePicker")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
dateLabel = stringResource(id = R.string.expiration_date), dateLabel = stringResource(id = R.string.expiration_date),
@ -425,7 +426,7 @@ private fun AddSendOptions(
onClick = addSendHandlers.onClearExpirationDateClick, onClick = addSendHandlers.onClearExpirationDateClick,
isEnabled = state.common.expirationDate != null && !sendRestrictionPolicy, isEnabled = state.common.expirationDate != null && !sendRestrictionPolicy,
modifier = Modifier modifier = Modifier
.semantics { testTag = "SendClearExpirationDateButton" } .testTag("SendClearExpirationDateButton")
.wrapContentWidth(), .wrapContentWidth(),
) )
} }
@ -440,7 +441,7 @@ private fun AddSendOptions(
range = 0..Int.MAX_VALUE, range = 0..Int.MAX_VALUE,
textFieldReadOnly = sendRestrictionPolicy, textFieldReadOnly = sendRestrictionPolicy,
modifier = Modifier modifier = Modifier
.semantics { testTag = "SendMaxAccessCountEntry" } .testTag("SendMaxAccessCountEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -485,7 +486,7 @@ private fun AddSendOptions(
value = state.common.passwordInput, value = state.common.passwordInput,
onValueChange = addSendHandlers.onPasswordChange, onValueChange = addSendHandlers.onPasswordChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "SendNewPasswordEntry" } .testTag("SendNewPasswordEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -504,7 +505,7 @@ private fun AddSendOptions(
Spacer(modifier = Modifier.height(16.dp)) Spacer(modifier = Modifier.height(16.dp))
BitwardenWideSwitch( BitwardenWideSwitch(
modifier = Modifier modifier = Modifier
.semantics { testTag = "SendHideEmailSwitch" } .testTag("SendHideEmailSwitch")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
label = stringResource(id = R.string.hide_email), label = stringResource(id = R.string.hide_email),
@ -516,7 +517,7 @@ private fun AddSendOptions(
Spacer(modifier = Modifier.height(16.dp)) Spacer(modifier = Modifier.height(16.dp))
BitwardenWideSwitch( BitwardenWideSwitch(
modifier = Modifier modifier = Modifier
.semantics { testTag = "SendDeactivateSwitch" } .testTag("SendDeactivateSwitch")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
label = stringResource(id = R.string.disable_send), label = stringResource(id = R.string.disable_send),

View file

@ -17,9 +17,9 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.collectAsStateWithLifecycle
@ -146,7 +146,7 @@ fun AddSendScreen(
onClick = remember(viewModel) { onClick = remember(viewModel) {
{ viewModel.trySendAction(AddSendAction.SaveClick) } { viewModel.trySendAction(AddSendAction.SaveClick) }
}, },
modifier = Modifier.semantics { testTag = "SaveButton" }, modifier = Modifier.testTag("SaveButton"),
) )
if (!state.isAddMode) { if (!state.isAddMode) {
BitwardenOverflowActionItem( BitwardenOverflowActionItem(

View file

@ -11,8 +11,8 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R import com.x8bit.bitwarden.R
@ -52,7 +52,7 @@ fun LazyListScope.collectionItemsSelector(
}, },
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "CollectionItemCell" } .testTag("CollectionItemCell")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }

View file

@ -11,9 +11,9 @@ import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
@ -52,7 +52,7 @@ fun LazyListScope.vaultAddEditCardItems(
value = commonState.name, value = commonState.name,
onValueChange = commonHandlers.onNameTextChange, onValueChange = commonHandlers.onNameTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "ItemNameEntry" } .testTag("ItemNameEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -64,7 +64,7 @@ fun LazyListScope.vaultAddEditCardItems(
value = cardState.cardHolderName, value = cardState.cardHolderName,
onValueChange = cardHandlers.onCardHolderNameTextChange, onValueChange = cardHandlers.onCardHolderNameTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "CardholderNameEntry" } .testTag("CardholderNameEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -76,7 +76,7 @@ fun LazyListScope.vaultAddEditCardItems(
value = cardState.number, value = cardState.number,
onValueChange = cardHandlers.onNumberTextChange, onValueChange = cardHandlers.onNumberTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "CardNumberEntry" } .testTag("CardNumberEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
showPasswordTestTag = "ShowCardNumberButton", showPasswordTestTag = "ShowCardNumberButton",
@ -100,7 +100,7 @@ fun LazyListScope.vaultAddEditCardItems(
) )
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "CardBrandPicker" } .testTag("CardBrandPicker")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -122,7 +122,7 @@ fun LazyListScope.vaultAddEditCardItems(
) )
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "CardExpirationMonthPicker" } .testTag("CardExpirationMonthPicker")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -134,7 +134,7 @@ fun LazyListScope.vaultAddEditCardItems(
onValueChange = cardHandlers.onExpirationYearTextChange, onValueChange = cardHandlers.onExpirationYearTextChange,
keyboardType = KeyboardType.Number, keyboardType = KeyboardType.Number,
modifier = Modifier modifier = Modifier
.semantics { testTag = "CardExpirationYearEntry" } .testTag("CardExpirationYearEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -147,7 +147,7 @@ fun LazyListScope.vaultAddEditCardItems(
onValueChange = cardHandlers.onSecurityCodeTextChange, onValueChange = cardHandlers.onSecurityCodeTextChange,
keyboardType = KeyboardType.NumberPassword, keyboardType = KeyboardType.NumberPassword,
modifier = Modifier modifier = Modifier
.semantics { testTag = "CardSecurityCodeEntry" } .testTag("CardSecurityCodeEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
showPasswordTestTag = "CardShowSecurityCodeButton", showPasswordTestTag = "CardShowSecurityCodeButton",
@ -179,7 +179,7 @@ fun LazyListScope.vaultAddEditCardItems(
) )
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "FolderPicker" } .testTag("FolderPicker")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -193,7 +193,7 @@ fun LazyListScope.vaultAddEditCardItems(
isChecked = commonState.favorite, isChecked = commonState.favorite,
onCheckedChange = commonHandlers.onToggleFavorite, onCheckedChange = commonHandlers.onToggleFavorite,
modifier = Modifier modifier = Modifier
.semantics { testTag = "ItemFavoriteToggle" } .testTag("ItemFavoriteToggle")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -206,7 +206,7 @@ fun LazyListScope.vaultAddEditCardItems(
isChecked = commonState.masterPasswordReprompt, isChecked = commonState.masterPasswordReprompt,
onCheckedChange = commonHandlers.onToggleMasterPasswordReprompt, onCheckedChange = commonHandlers.onToggleMasterPasswordReprompt,
modifier = Modifier modifier = Modifier
.semantics { testTag = "MasterPasswordRepromptToggle" } .testTag("MasterPasswordRepromptToggle")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
actions = { actions = {
@ -242,7 +242,7 @@ fun LazyListScope.vaultAddEditCardItems(
value = commonState.notes, value = commonState.notes,
onValueChange = commonHandlers.onNotesTextChange, onValueChange = commonHandlers.onNotesTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "ItemNotesEntry" } .testTag("ItemNotesEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -315,7 +315,7 @@ fun LazyListScope.vaultAddEditCardItems(
) )
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "ItemOwnershipPicker" } .testTag("ItemOwnershipPicker")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )

View file

@ -6,8 +6,8 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import com.x8bit.bitwarden.R import com.x8bit.bitwarden.R
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledTonalButton import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledTonalButton
@ -76,6 +76,6 @@ fun VaultAddEditCustomFieldsButton(
BitwardenFilledTonalButton( BitwardenFilledTonalButton(
label = stringResource(id = R.string.new_custom_field), label = stringResource(id = R.string.new_custom_field),
onClick = { shouldShowChooserDialog = true }, onClick = { shouldShowChooserDialog = true },
modifier = modifier.semantics { testTag = "NewCustomFieldButton" }, modifier = modifier.testTag("NewCustomFieldButton"),
) )
} }

View file

@ -12,9 +12,9 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R import com.x8bit.bitwarden.R
@ -49,7 +49,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = commonState.name, value = commonState.name,
onValueChange = commonTypeHandlers.onNameTextChange, onValueChange = commonTypeHandlers.onNameTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "ItemNameEntry" } .testTag("ItemNameEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -60,7 +60,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
selectedTitle = identityState.selectedTitle, selectedTitle = identityState.selectedTitle,
onTitleSelected = identityItemTypeHandlers.onTitleSelected, onTitleSelected = identityItemTypeHandlers.onTitleSelected,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityTitlePicker" } .testTag("IdentityTitlePicker")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -72,7 +72,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.firstName, value = identityState.firstName,
onValueChange = identityItemTypeHandlers.onFirstNameTextChange, onValueChange = identityItemTypeHandlers.onFirstNameTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityFirstNameEntry" } .testTag("IdentityFirstNameEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -84,7 +84,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.middleName, value = identityState.middleName,
onValueChange = identityItemTypeHandlers.onMiddleNameTextChange, onValueChange = identityItemTypeHandlers.onMiddleNameTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityMiddleNameEntry" } .testTag("IdentityMiddleNameEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -96,7 +96,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.lastName, value = identityState.lastName,
onValueChange = identityItemTypeHandlers.onLastNameTextChange, onValueChange = identityItemTypeHandlers.onLastNameTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityLastNameEntry" } .testTag("IdentityLastNameEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -108,7 +108,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.username, value = identityState.username,
onValueChange = identityItemTypeHandlers.onUsernameTextChange, onValueChange = identityItemTypeHandlers.onUsernameTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityUsernameEntry" } .testTag("IdentityUsernameEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -120,7 +120,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.company, value = identityState.company,
onValueChange = identityItemTypeHandlers.onCompanyTextChange, onValueChange = identityItemTypeHandlers.onCompanyTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityCompanyEntry" } .testTag("IdentityCompanyEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -132,7 +132,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.ssn, value = identityState.ssn,
onValueChange = identityItemTypeHandlers.onSsnTextChange, onValueChange = identityItemTypeHandlers.onSsnTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentitySsnEntry" } .testTag("IdentitySsnEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -144,7 +144,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.passportNumber, value = identityState.passportNumber,
onValueChange = identityItemTypeHandlers.onPassportNumberTextChange, onValueChange = identityItemTypeHandlers.onPassportNumberTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityPassportNumberEntry" } .testTag("IdentityPassportNumberEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -156,7 +156,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.licenseNumber, value = identityState.licenseNumber,
onValueChange = identityItemTypeHandlers.onLicenseNumberTextChange, onValueChange = identityItemTypeHandlers.onLicenseNumberTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityLicenseNumberEntry" } .testTag("IdentityLicenseNumberEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -168,7 +168,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.email, value = identityState.email,
onValueChange = identityItemTypeHandlers.onEmailTextChange, onValueChange = identityItemTypeHandlers.onEmailTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityEmailEntry" } .testTag("IdentityEmailEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -180,7 +180,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.phone, value = identityState.phone,
onValueChange = identityItemTypeHandlers.onPhoneTextChange, onValueChange = identityItemTypeHandlers.onPhoneTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityPhoneEntry" } .testTag("IdentityPhoneEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -192,7 +192,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.address1, value = identityState.address1,
onValueChange = identityItemTypeHandlers.onAddress1TextChange, onValueChange = identityItemTypeHandlers.onAddress1TextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityAddressOneEntry" } .testTag("IdentityAddressOneEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -204,7 +204,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.address2, value = identityState.address2,
onValueChange = identityItemTypeHandlers.onAddress2TextChange, onValueChange = identityItemTypeHandlers.onAddress2TextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityAddressTwoEntry" } .testTag("IdentityAddressTwoEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -216,7 +216,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.address3, value = identityState.address3,
onValueChange = identityItemTypeHandlers.onAddress3TextChange, onValueChange = identityItemTypeHandlers.onAddress3TextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityAddressThreeEntry" } .testTag("IdentityAddressThreeEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -228,7 +228,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.city, value = identityState.city,
onValueChange = identityItemTypeHandlers.onCityTextChange, onValueChange = identityItemTypeHandlers.onCityTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityCityEntry" } .testTag("IdentityCityEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -240,7 +240,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.state, value = identityState.state,
onValueChange = identityItemTypeHandlers.onStateTextChange, onValueChange = identityItemTypeHandlers.onStateTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityStateEntry" } .testTag("IdentityStateEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -252,7 +252,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.zip, value = identityState.zip,
onValueChange = identityItemTypeHandlers.onZipTextChange, onValueChange = identityItemTypeHandlers.onZipTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityPostalCodeEntry" } .testTag("IdentityPostalCodeEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -264,7 +264,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.country, value = identityState.country,
onValueChange = identityItemTypeHandlers.onCountryTextChange, onValueChange = identityItemTypeHandlers.onCountryTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityCountryEntry" } .testTag("IdentityCountryEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -295,7 +295,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
) )
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "FolderPicker" } .testTag("FolderPicker")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -309,7 +309,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
isChecked = commonState.favorite, isChecked = commonState.favorite,
onCheckedChange = commonTypeHandlers.onToggleFavorite, onCheckedChange = commonTypeHandlers.onToggleFavorite,
modifier = Modifier modifier = Modifier
.semantics { testTag = "ItemFavoriteToggle" } .testTag("ItemFavoriteToggle")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -323,7 +323,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
isChecked = commonState.masterPasswordReprompt, isChecked = commonState.masterPasswordReprompt,
onCheckedChange = commonTypeHandlers.onToggleMasterPasswordReprompt, onCheckedChange = commonTypeHandlers.onToggleMasterPasswordReprompt,
modifier = Modifier modifier = Modifier
.semantics { testTag = "MasterPasswordRepromptToggle" } .testTag("MasterPasswordRepromptToggle")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
actions = { actions = {
@ -359,7 +359,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = commonState.notes, value = commonState.notes,
onValueChange = commonTypeHandlers.onNotesTextChange, onValueChange = commonTypeHandlers.onNotesTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "ItemNotesEntry" } .testTag("ItemNotesEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -445,7 +445,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
) )
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "ItemOwnershipPicker" } .testTag("ItemOwnershipPicker")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )

View file

@ -9,8 +9,8 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R import com.x8bit.bitwarden.R
@ -60,7 +60,7 @@ fun VaultAddEditContent(
text = stringResource(R.string.personal_ownership_policy_in_effect), text = stringResource(R.string.personal_ownership_policy_in_effect),
modifier = Modifier modifier = Modifier
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.semantics { testTag = "PersonalOwnershipPolicyLabel" } .testTag("PersonalOwnershipPolicyLabel")
.fillMaxWidth(), .fillMaxWidth(),
) )
} }
@ -81,7 +81,7 @@ fun VaultAddEditContent(
itemType = state.type, itemType = state.type,
onTypeOptionClicked = onTypeOptionClicked, onTypeOptionClicked = onTypeOptionClicked,
modifier = Modifier modifier = Modifier
.semantics { testTag = "ItemTypePicker" } .testTag("ItemTypePicker")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }

View file

@ -15,9 +15,9 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R import com.x8bit.bitwarden.R
@ -61,7 +61,7 @@ fun LazyListScope.vaultAddEditLoginItems(
value = commonState.name, value = commonState.name,
onValueChange = commonActionHandler.onNameTextChange, onValueChange = commonActionHandler.onNameTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "ItemNameEntry" } .testTag("ItemNameEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -111,7 +111,7 @@ fun LazyListScope.vaultAddEditLoginItems(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.semantics { testTag = "LoginTotpEntry" }, .testTag("LoginTotpEntry"),
label = stringResource(id = R.string.totp), label = stringResource(id = R.string.totp),
value = loginState.totp, value = loginState.totp,
trailingIconContent = { trailingIconContent = {
@ -155,7 +155,7 @@ fun LazyListScope.vaultAddEditLoginItems(
icon = painterResource(id = R.drawable.ic_light_bulb), icon = painterResource(id = R.drawable.ic_light_bulb),
onClick = onTotpSetupClick, onClick = onTotpSetupClick,
modifier = Modifier modifier = Modifier
.semantics { testTag = "SetupTotpButton" } .testTag("SetupTotpButton")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -187,7 +187,7 @@ fun LazyListScope.vaultAddEditLoginItems(
label = stringResource(id = R.string.new_uri), label = stringResource(id = R.string.new_uri),
onClick = loginItemTypeHandlers.onAddNewUriClick, onClick = loginItemTypeHandlers.onAddNewUriClick,
modifier = Modifier modifier = Modifier
.semantics { testTag = "LoginAddNewUriButton" } .testTag("LoginAddNewUriButton")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -220,7 +220,7 @@ fun LazyListScope.vaultAddEditLoginItems(
) )
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "FolderPicker" } .testTag("FolderPicker")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -234,7 +234,7 @@ fun LazyListScope.vaultAddEditLoginItems(
isChecked = commonState.favorite, isChecked = commonState.favorite,
onCheckedChange = commonActionHandler.onToggleFavorite, onCheckedChange = commonActionHandler.onToggleFavorite,
modifier = Modifier modifier = Modifier
.semantics { testTag = "ItemFavoriteToggle" } .testTag("ItemFavoriteToggle")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -247,7 +247,7 @@ fun LazyListScope.vaultAddEditLoginItems(
isChecked = commonState.masterPasswordReprompt, isChecked = commonState.masterPasswordReprompt,
onCheckedChange = commonActionHandler.onToggleMasterPasswordReprompt, onCheckedChange = commonActionHandler.onToggleMasterPasswordReprompt,
modifier = Modifier modifier = Modifier
.semantics { testTag = "MasterPasswordRepromptToggle" } .testTag("MasterPasswordRepromptToggle")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
actions = { actions = {
@ -283,7 +283,7 @@ fun LazyListScope.vaultAddEditLoginItems(
value = commonState.notes, value = commonState.notes,
onValueChange = commonActionHandler.onNotesTextChange, onValueChange = commonActionHandler.onNotesTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "ItemNotesEntry" } .testTag("ItemNotesEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -352,7 +352,7 @@ fun LazyListScope.vaultAddEditLoginItems(
) )
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "ItemOwnershipPicker" } .testTag("ItemOwnershipPicker")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -395,11 +395,11 @@ private fun UsernameRow(
shouldShowDialog = true shouldShowDialog = true
} }
}, },
modifier = Modifier.semantics { testTag = "GenerateUsernameButton" }, modifier = Modifier.testTag("GenerateUsernameButton"),
) )
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "LoginUsernameEntry" } .testTag("LoginUsernameEntry")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -452,7 +452,7 @@ private fun PasswordRow(
), ),
onClick = loginItemTypeHandlers.onPasswordCheckerClick, onClick = loginItemTypeHandlers.onPasswordCheckerClick,
modifier = Modifier modifier = Modifier
.semantics { testTag = "CheckPasswordButton" }, .testTag("CheckPasswordButton"),
) )
BitwardenIconButtonWithResource( BitwardenIconButtonWithResource(
iconRes = IconResource( iconRes = IconResource(
@ -467,7 +467,7 @@ private fun PasswordRow(
} }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "RegeneratePasswordButton" }, .testTag("RegeneratePasswordButton"),
) )
if (shouldShowDialog) { if (shouldShowDialog) {
@ -499,7 +499,7 @@ private fun PasswordRow(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.semantics { testTag = "LoginPasswordEntry" }, .testTag("LoginPasswordEntry"),
) )
} }
} }

View file

@ -16,9 +16,9 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.core.net.toUri import androidx.core.net.toUri
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
@ -182,7 +182,7 @@ fun VaultAddEditScreen(
onClick = remember(viewModel) { onClick = remember(viewModel) {
{ viewModel.trySendAction(VaultAddEditAction.Common.SaveClick) } { viewModel.trySendAction(VaultAddEditAction.Common.SaveClick) }
}, },
modifier = Modifier.semantics { testTag = "SaveButton" }, modifier = Modifier.testTag("SaveButton"),
) )
BitwardenOverflowActionItem( BitwardenOverflowActionItem(
menuItemDataList = persistentListOfNotNull( menuItemDataList = persistentListOfNotNull(

View file

@ -10,9 +10,9 @@ import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R import com.x8bit.bitwarden.R
@ -43,7 +43,7 @@ fun LazyListScope.vaultAddEditSecureNotesItems(
value = commonState.name, value = commonState.name,
onValueChange = commonTypeHandlers.onNameTextChange, onValueChange = commonTypeHandlers.onNameTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "ItemNameEntry" } .testTag("ItemNameEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -76,7 +76,7 @@ fun LazyListScope.vaultAddEditSecureNotesItems(
) )
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "FolderPicker" } .testTag("FolderPicker")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -88,7 +88,7 @@ fun LazyListScope.vaultAddEditSecureNotesItems(
isChecked = commonState.favorite, isChecked = commonState.favorite,
onCheckedChange = commonTypeHandlers.onToggleFavorite, onCheckedChange = commonTypeHandlers.onToggleFavorite,
modifier = Modifier modifier = Modifier
.semantics { testTag = "ItemFavoriteToggle" } .testTag("ItemFavoriteToggle")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -102,7 +102,7 @@ fun LazyListScope.vaultAddEditSecureNotesItems(
isChecked = commonState.masterPasswordReprompt, isChecked = commonState.masterPasswordReprompt,
onCheckedChange = commonTypeHandlers.onToggleMasterPasswordReprompt, onCheckedChange = commonTypeHandlers.onToggleMasterPasswordReprompt,
modifier = Modifier modifier = Modifier
.semantics { testTag = "MasterPasswordRepromptToggle" } .testTag("MasterPasswordRepromptToggle")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
actions = { actions = {
@ -138,7 +138,7 @@ fun LazyListScope.vaultAddEditSecureNotesItems(
value = commonState.notes, value = commonState.notes,
onValueChange = commonTypeHandlers.onNotesTextChange, onValueChange = commonTypeHandlers.onNotesTextChange,
modifier = Modifier modifier = Modifier
.semantics { testTag = "ItemNotesEntry" } .testTag("ItemNotesEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -207,7 +207,7 @@ fun LazyListScope.vaultAddEditSecureNotesItems(
) )
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "ItemOwnershipPicker" } .testTag("ItemOwnershipPicker")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )

View file

@ -7,9 +7,9 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R import com.x8bit.bitwarden.R
@ -48,11 +48,11 @@ fun VaultAddEditUriItem(
contentDescription = stringResource(id = R.string.options), contentDescription = stringResource(id = R.string.options),
), ),
onClick = { shouldShowOptionsDialog = true }, onClick = { shouldShowOptionsDialog = true },
modifier = Modifier.semantics { testTag = "LoginUriOptionsButton" }, modifier = Modifier.testTag("LoginUriOptionsButton"),
) )
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "LoginUriEntry" } .testTag("LoginUriEntry")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )

View file

@ -22,9 +22,9 @@ import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.text.style.TextOverflow
@ -56,7 +56,7 @@ fun AttachmentsContent(
color = MaterialTheme.colorScheme.onSurface, color = MaterialTheme.colorScheme.onSurface,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
modifier = Modifier modifier = Modifier
.semantics { testTag = "NoAttachmentsLabel" } .testTag("NoAttachmentsLabel")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -155,7 +155,7 @@ private fun AttachmentListEntry(
color = MaterialTheme.colorScheme.outlineVariant, color = MaterialTheme.colorScheme.outlineVariant,
) )
.defaultMinSize(minHeight = 56.dp) .defaultMinSize(minHeight = 56.dp)
.semantics { testTag = "AttachmentRow" } .testTag("AttachmentRow")
.padding(vertical = 8.dp) .padding(vertical = 8.dp)
.then(modifier), .then(modifier),
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,

View file

@ -12,9 +12,9 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.collectAsStateWithLifecycle
@ -94,7 +94,7 @@ fun AttachmentsScreen(
BitwardenTextButton( BitwardenTextButton(
label = stringResource(id = R.string.save), label = stringResource(id = R.string.save),
onClick = attachmentsHandlers.onSaveClick, onClick = attachmentsHandlers.onSaveClick,
modifier = Modifier.semantics { testTag = "SaveButton" }, modifier = Modifier.testTag("SaveButton"),
) )
}, },
) )

View file

@ -9,9 +9,9 @@ import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items import androidx.compose.foundation.lazy.items
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R import com.x8bit.bitwarden.R
@ -55,7 +55,7 @@ fun VaultItemCardContent(
readOnly = true, readOnly = true,
singleLine = false, singleLine = false,
modifier = Modifier modifier = Modifier
.semantics { testTag = "CardItemNameEntry" } .testTag("CardItemNameEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -70,7 +70,7 @@ fun VaultItemCardContent(
readOnly = true, readOnly = true,
singleLine = false, singleLine = false,
modifier = Modifier modifier = Modifier
.semantics { testTag = "CardholderNameEntry" } .testTag("CardholderNameEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -92,7 +92,7 @@ fun VaultItemCardContent(
contentDescription = stringResource(id = R.string.copy_number), contentDescription = stringResource(id = R.string.copy_number),
), ),
onClick = vaultCardItemTypeHandlers.onCopyNumberClick, onClick = vaultCardItemTypeHandlers.onCopyNumberClick,
modifier = Modifier.semantics { testTag = "CardCopyNumberButton" }, modifier = Modifier.testTag("CardCopyNumberButton"),
) )
}, },
passwordFieldTestTag = "CardNumberEntry", passwordFieldTestTag = "CardNumberEntry",
@ -114,7 +114,7 @@ fun VaultItemCardContent(
readOnly = true, readOnly = true,
singleLine = false, singleLine = false,
modifier = Modifier modifier = Modifier
.semantics { testTag = "CardBrandEntry" } .testTag("CardBrandEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -131,7 +131,7 @@ fun VaultItemCardContent(
readOnly = true, readOnly = true,
singleLine = false, singleLine = false,
modifier = Modifier modifier = Modifier
.semantics { testTag = "CardExpirationEntry" } .testTag("CardExpirationEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -157,7 +157,7 @@ fun VaultItemCardContent(
), ),
onClick = vaultCardItemTypeHandlers.onCopySecurityCodeClick, onClick = vaultCardItemTypeHandlers.onCopySecurityCodeClick,
modifier = Modifier modifier = Modifier
.semantics { testTag = "CardCopySecurityCodeButton" }, .testTag("CardCopySecurityCodeButton"),
) )
}, },
modifier = Modifier modifier = Modifier
@ -186,7 +186,7 @@ fun VaultItemCardContent(
readOnly = true, readOnly = true,
singleLine = false, singleLine = false,
modifier = Modifier modifier = Modifier
.semantics { testTag = "CipherNotesLabel" } .testTag("CipherNotesLabel")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -230,7 +230,7 @@ fun VaultItemCardContent(
items(attachments) { attachmentItem -> items(attachments) { attachmentItem ->
AttachmentItemContent( AttachmentItemContent(
modifier = Modifier modifier = Modifier
.semantics { testTag = "CipherAttachment" } .testTag("CipherAttachment")
.fillMaxWidth() .fillMaxWidth()
.padding(start = 16.dp), .padding(start = 16.dp),
attachmentItem = attachmentItem, attachmentItem = attachmentItem,

View file

@ -9,8 +9,8 @@ import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items import androidx.compose.foundation.lazy.items
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R import com.x8bit.bitwarden.R
@ -47,7 +47,7 @@ fun VaultItemIdentityContent(
readOnly = true, readOnly = true,
singleLine = false, singleLine = false,
modifier = Modifier modifier = Modifier
.semantics { testTag = "ItemNameEntry" } .testTag("ItemNameEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -62,7 +62,7 @@ fun VaultItemIdentityContent(
readOnly = true, readOnly = true,
singleLine = false, singleLine = false,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityNameEntry" } .testTag("IdentityNameEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -78,7 +78,7 @@ fun VaultItemIdentityContent(
readOnly = true, readOnly = true,
singleLine = false, singleLine = false,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityUsernameEntry" } .testTag("IdentityUsernameEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -94,7 +94,7 @@ fun VaultItemIdentityContent(
readOnly = true, readOnly = true,
singleLine = false, singleLine = false,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityCompanyEntry" } .testTag("IdentityCompanyEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -110,7 +110,7 @@ fun VaultItemIdentityContent(
readOnly = true, readOnly = true,
singleLine = false, singleLine = false,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentitySsnEntry" } .testTag("IdentitySsnEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -126,7 +126,7 @@ fun VaultItemIdentityContent(
readOnly = true, readOnly = true,
singleLine = false, singleLine = false,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityPassportNumberEntry" } .testTag("IdentityPassportNumberEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -142,7 +142,7 @@ fun VaultItemIdentityContent(
readOnly = true, readOnly = true,
singleLine = false, singleLine = false,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityLicenseNumberEntry" } .testTag("IdentityLicenseNumberEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -158,7 +158,7 @@ fun VaultItemIdentityContent(
readOnly = true, readOnly = true,
singleLine = false, singleLine = false,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityEmailEntry" } .testTag("IdentityEmailEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -174,7 +174,7 @@ fun VaultItemIdentityContent(
readOnly = true, readOnly = true,
singleLine = false, singleLine = false,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityPhoneEntry" } .testTag("IdentityPhoneEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -190,7 +190,7 @@ fun VaultItemIdentityContent(
readOnly = true, readOnly = true,
singleLine = false, singleLine = false,
modifier = Modifier modifier = Modifier
.semantics { testTag = "IdentityAddressEntry" } .testTag("IdentityAddressEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -214,7 +214,7 @@ fun VaultItemIdentityContent(
readOnly = true, readOnly = true,
singleLine = false, singleLine = false,
modifier = Modifier modifier = Modifier
.semantics { testTag = "CipherNotesLabel" } .testTag("CipherNotesLabel")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -258,7 +258,7 @@ fun VaultItemIdentityContent(
items(attachments) { attachmentItem -> items(attachments) { attachmentItem ->
AttachmentItemContent( AttachmentItemContent(
modifier = Modifier modifier = Modifier
.semantics { testTag = "CipherAttachment" } .testTag("CipherAttachment")
.fillMaxWidth() .fillMaxWidth()
.padding(start = 16.dp), .padding(start = 16.dp),
attachmentItem = attachmentItem, attachmentItem = attachmentItem,

View file

@ -13,6 +13,7 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
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.semantics
@ -66,7 +67,7 @@ fun VaultItemLoginContent(
readOnly = true, readOnly = true,
singleLine = false, singleLine = false,
modifier = Modifier modifier = Modifier
.semantics { testTag = "LoginItemNameEntry" } .testTag("LoginItemNameEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -120,7 +121,7 @@ fun VaultItemLoginContent(
isPremiumUser = loginItemState.isPremiumUser, isPremiumUser = loginItemState.isPremiumUser,
onCopyTotpClick = vaultLoginItemTypeHandlers.onCopyTotpCodeClick, onCopyTotpClick = vaultLoginItemTypeHandlers.onCopyTotpCodeClick,
modifier = Modifier modifier = Modifier
.semantics { testTag = "LoginTotpEntry" } .testTag("LoginTotpEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -163,7 +164,7 @@ fun VaultItemLoginContent(
NotesField( NotesField(
notes = notes, notes = notes,
modifier = Modifier modifier = Modifier
.semantics { testTag = "CipherNotesLabel" } .testTag("CipherNotesLabel")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -207,7 +208,7 @@ fun VaultItemLoginContent(
items(attachments) { attachmentItem -> items(attachments) { attachmentItem ->
AttachmentItemContent( AttachmentItemContent(
modifier = Modifier modifier = Modifier
.semantics { testTag = "CipherAttachment" } .testTag("CipherAttachment")
.fillMaxWidth() .fillMaxWidth()
.padding(start = 16.dp), .padding(start = 16.dp),
attachmentItem = attachmentItem, attachmentItem = attachmentItem,
@ -316,7 +317,7 @@ private fun PasswordField(
), ),
), ),
onClick = onCheckForBreachClick, onClick = onCheckForBreachClick,
modifier = Modifier.semantics { testTag = "LoginCheckPasswordButton" }, modifier = Modifier.testTag("LoginCheckPasswordButton"),
) )
BitwardenIconButtonWithResource( BitwardenIconButtonWithResource(
iconRes = IconResource( iconRes = IconResource(
@ -324,7 +325,7 @@ private fun PasswordField(
contentDescription = stringResource(id = R.string.copy_password), contentDescription = stringResource(id = R.string.copy_password),
), ),
onClick = onCopyPasswordClick, onClick = onCopyPasswordClick,
modifier = Modifier.semantics { testTag = "LoginCopyPasswordButton" }, modifier = Modifier.testTag("LoginCopyPasswordButton"),
) )
}, },
modifier = modifier, modifier = modifier,
@ -336,7 +337,7 @@ private fun PasswordField(
label = stringResource(id = R.string.password), label = stringResource(id = R.string.password),
value = passwordData.password, value = passwordData.password,
modifier = modifier modifier = modifier
.semantics { testTag = "LoginPasswordEntry" }, .testTag("LoginPasswordEntry"),
) )
} }
} }
@ -392,7 +393,7 @@ private fun TotpField(
contentDescription = stringResource(id = R.string.copy_totp), contentDescription = stringResource(id = R.string.copy_totp),
), ),
onClick = onCopyTotpClick, onClick = onCopyTotpClick,
modifier = Modifier.semantics { testTag = "LoginCopyTotpButton" }, modifier = Modifier.testTag("LoginCopyTotpButton"),
) )
}, },
modifier = modifier, modifier = modifier,
@ -432,7 +433,7 @@ private fun UriField(
contentDescription = stringResource(id = R.string.launch), contentDescription = stringResource(id = R.string.launch),
), ),
onClick = { onLaunchUriClick(uriData.uri) }, onClick = { onLaunchUriClick(uriData.uri) },
modifier = Modifier.semantics { testTag = "LoginLaunchUriButton" }, modifier = Modifier.testTag("LoginLaunchUriButton"),
) )
} }
if (uriData.isCopyable) { if (uriData.isCopyable) {
@ -442,7 +443,7 @@ private fun UriField(
contentDescription = stringResource(id = R.string.copy), contentDescription = stringResource(id = R.string.copy),
), ),
onClick = { onCopyUriClick(uriData.uri) }, onClick = { onCopyUriClick(uriData.uri) },
modifier = Modifier.semantics { testTag = "LoginCopyUriButton" }, modifier = Modifier.testTag("LoginCopyUriButton"),
) )
} }
}, },
@ -470,7 +471,7 @@ private fun UsernameField(
contentDescription = stringResource(id = R.string.copy_username), contentDescription = stringResource(id = R.string.copy_username),
), ),
onClick = onCopyUsernameClick, onClick = onCopyUsernameClick,
modifier = Modifier.semantics { testTag = "LoginCopyUsernameButton" }, modifier = Modifier.testTag("LoginCopyUsernameButton"),
) )
}, },
modifier = modifier, modifier = modifier,

View file

@ -22,9 +22,9 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.core.net.toUri import androidx.core.net.toUri
@ -191,7 +191,7 @@ fun VaultItemScreen(
BitwardenTextButton( BitwardenTextButton(
label = stringResource(id = R.string.restore), label = stringResource(id = R.string.restore),
onClick = { pendingRestoreCipher = true }, onClick = { pendingRestoreCipher = true },
modifier = Modifier.semantics { testTag = "RestoreButton" }, modifier = Modifier.testTag("RestoreButton"),
) )
} }
BitwardenOverflowActionItem( BitwardenOverflowActionItem(
@ -262,7 +262,7 @@ fun VaultItemScreen(
{ viewModel.trySendAction(VaultItemAction.Common.EditClick) } { viewModel.trySendAction(VaultItemAction.Common.EditClick) }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "EditItemButton" } .testTag("EditItemButton")
.padding(bottom = 16.dp), .padding(bottom = 16.dp),
) { ) {
Icon( Icon(

View file

@ -12,6 +12,7 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag import androidx.compose.ui.semantics.testTag
@ -51,7 +52,7 @@ fun VaultItemSecureNoteContent(
readOnly = true, readOnly = true,
singleLine = false, singleLine = false,
modifier = Modifier modifier = Modifier
.semantics { testTag = "ItemNameEntry" } .testTag("ItemNameEntry")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -74,7 +75,7 @@ fun VaultItemSecureNoteContent(
readOnly = true, readOnly = true,
singleLine = false, singleLine = false,
modifier = Modifier modifier = Modifier
.semantics { testTag = "CipherNotesLabel" } .testTag("CipherNotesLabel")
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -119,7 +120,7 @@ fun VaultItemSecureNoteContent(
items(attachments) { attachmentItem -> items(attachments) { attachmentItem ->
AttachmentItemContent( AttachmentItemContent(
modifier = Modifier modifier = Modifier
.semantics { testTag = "CipherAttachment" } .testTag("CipherAttachment")
.fillMaxWidth() .fillMaxWidth()
.padding(start = 16.dp), .padding(start = 16.dp),
attachmentItem = attachmentItem, attachmentItem = attachmentItem,

View file

@ -22,9 +22,9 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.core.net.toUri import androidx.core.net.toUri
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
@ -230,7 +230,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" }, modifier = Modifier.testTag("AddItemButton"),
) { ) {
Icon( Icon(
painter = painterResource(id = R.drawable.ic_plus), painter = painterResource(id = R.drawable.ic_plus),

View file

@ -11,8 +11,8 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
@ -55,7 +55,7 @@ fun VaultMoveToOrganizationContent(
) )
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "OrganizationListDropdown" } .testTag("OrganizationListDropdown")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }

View file

@ -13,9 +13,9 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.collectAsStateWithLifecycle
@ -122,7 +122,7 @@ private fun VaultMoveToOrganizationScaffold(
onClick = moveClick, onClick = moveClick,
isEnabled = state.viewState is isEnabled = state.viewState is
VaultMoveToOrganizationState.ViewState.Content, VaultMoveToOrganizationState.ViewState.Content,
modifier = Modifier.semantics { testTag = "MoveButton" }, modifier = Modifier.testTag("MoveButton"),
) )
}, },
) )

View file

@ -10,9 +10,9 @@ import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R import com.x8bit.bitwarden.R
@ -57,7 +57,7 @@ fun VaultContent(
showDivider = true, showDivider = true,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "FolderFilter" } .testTag("FolderFilter")
.padding(16.dp), .padding(16.dp),
) )
} }
@ -101,7 +101,7 @@ fun VaultContent(
}, },
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "CipherCell" } .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
@ -146,7 +146,7 @@ fun VaultContent(
showDivider = false, showDivider = false,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "LoginFilter" } .testTag("LoginFilter")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -161,7 +161,7 @@ fun VaultContent(
showDivider = false, showDivider = false,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "CardFilter" } .testTag("CardFilter")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -176,7 +176,7 @@ fun VaultContent(
showDivider = false, showDivider = false,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "IdentityFilter" } .testTag("IdentityFilter")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -191,7 +191,7 @@ fun VaultContent(
showDivider = false, showDivider = false,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "SecureNoteFilter" } .testTag("SecureNoteFilter")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -230,7 +230,7 @@ fun VaultContent(
showDivider = false, showDivider = false,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "FolderFilter" } .testTag("FolderFilter")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -279,7 +279,7 @@ fun VaultContent(
}, },
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "CipherCell" } .testTag("CipherCell")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -315,7 +315,7 @@ fun VaultContent(
showDivider = false, showDivider = false,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "CollectionFilter" } .testTag("CollectionFilter")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }
@ -354,7 +354,7 @@ fun VaultContent(
showDivider = false, showDivider = false,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.semantics { testTag = "TrashFilter" } .testTag("TrashFilter")
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
} }

View file

@ -17,9 +17,9 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R import com.x8bit.bitwarden.R
@ -75,7 +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" } .testTag("ActiveFilterRow")
.then(modifier), .then(modifier),
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {
@ -87,7 +87,7 @@ fun VaultFilter(
style = MaterialTheme.typography.bodyLarge, style = MaterialTheme.typography.bodyLarge,
color = MaterialTheme.colorScheme.onSurface, color = MaterialTheme.colorScheme.onSurface,
modifier = Modifier modifier = Modifier
.semantics { testTag = "ActiveFilterLabel" } .testTag("ActiveFilterLabel")
.weight(1f), .weight(1f),
) )
@ -95,7 +95,7 @@ fun VaultFilter(
IconButton( IconButton(
onClick = { shouldShowSelectionDialog = true }, onClick = { shouldShowSelectionDialog = true },
modifier = Modifier.semantics { testTag = "OpenOrgFilter" }, modifier = Modifier.testTag("OpenOrgFilter"),
) { ) {
Icon( Icon(
painter = painterResource(id = R.drawable.ic_more_horizontal), painter = painterResource(id = R.drawable.ic_more_horizontal),

View file

@ -28,9 +28,9 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
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.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.core.net.toUri import androidx.core.net.toUri
@ -254,7 +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" }, modifier = Modifier.testTag("AddItemButton"),
) { ) {
Icon( Icon(
painter = painterResource(id = R.drawable.ic_plus), painter = painterResource(id = R.drawable.ic_plus),