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.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.CustomAccessibilityAction
@ -180,7 +181,7 @@ fun CreateAccountScreen(
onClick = remember(viewModel) {
{ viewModel.trySendAction(SubmitClick) }
},
modifier = Modifier.semantics { testTag = "SubmitButton" },
modifier = Modifier.testTag("SubmitButton"),
)
},
)
@ -201,7 +202,7 @@ fun CreateAccountScreen(
{ viewModel.trySendAction(EmailInputChange(it)) }
},
modifier = Modifier
.semantics { testTag = "EmailAddressEntry" }
.testTag("EmailAddressEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
keyboardType = KeyboardType.Email,
@ -218,7 +219,7 @@ fun CreateAccountScreen(
{ viewModel.trySendAction(PasswordInputChange(it)) }
},
modifier = Modifier
.semantics { testTag = "MasterPasswordEntry" }
.testTag("MasterPasswordEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
showPasswordTestTag = "PasswordVisibilityToggle",
@ -238,7 +239,7 @@ fun CreateAccountScreen(
{ viewModel.trySendAction(ConfirmPasswordInputChange(it)) }
},
modifier = Modifier
.semantics { testTag = "ConfirmMasterPasswordEntry" }
.testTag("ConfirmMasterPasswordEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
showPasswordTestTag = "ConfirmPasswordVisibilityToggle",
@ -252,7 +253,7 @@ fun CreateAccountScreen(
},
hint = stringResource(id = R.string.master_password_hint_description),
modifier = Modifier
.semantics { testTag = "MasterPasswordHintLabel" }
.testTag("MasterPasswordHintLabel")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -266,7 +267,7 @@ fun CreateAccountScreen(
}
},
modifier = Modifier
.semantics { testTag = "CheckExposedMasterPasswordToggle" }
.testTag("CheckExposedMasterPasswordToggle")
.padding(horizontal = 16.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.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
@ -122,7 +122,7 @@ fun EnterpriseSignOnScreen(
onClick = remember(viewModel) {
{ 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.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.unit.dp
@ -94,7 +94,7 @@ fun EnvironmentScreen(
onClick = remember(viewModel) {
{ viewModel.trySendAction(EnvironmentAction.SaveClick) }
},
modifier = Modifier.semantics { testTag = "SaveButton" },
modifier = Modifier.testTag("SaveButton"),
)
},
)
@ -127,7 +127,7 @@ fun EnvironmentScreen(
keyboardType = KeyboardType.Uri,
modifier = Modifier
.fillMaxWidth()
.semantics { testTag = "ServerUrlEntry" }
.testTag("ServerUrlEntry")
.padding(horizontal = 16.dp),
)
@ -151,7 +151,7 @@ fun EnvironmentScreen(
keyboardType = KeyboardType.Uri,
modifier = Modifier
.fillMaxWidth()
.semantics { testTag = "WebVaultUrlEntry" }
.testTag("WebVaultUrlEntry")
.padding(horizontal = 16.dp),
)
@ -166,7 +166,7 @@ fun EnvironmentScreen(
keyboardType = KeyboardType.Uri,
modifier = Modifier
.fillMaxWidth()
.semantics { testTag = "ApiUrlEntry" }
.testTag("ApiUrlEntry")
.padding(horizontal = 16.dp),
)
@ -181,7 +181,7 @@ fun EnvironmentScreen(
keyboardType = KeyboardType.Uri,
modifier = Modifier
.fillMaxWidth()
.semantics { testTag = "IdentityUrlEntry" }
.testTag("IdentityUrlEntry")
.padding(horizontal = 16.dp),
)
@ -197,7 +197,7 @@ fun EnvironmentScreen(
keyboardType = KeyboardType.Uri,
modifier = Modifier
.fillMaxWidth()
.semantics { testTag = "IconsUrlEntry" }
.testTag("IconsUrlEntry")
.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.graphics.ColorFilter
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.style.TextAlign
@ -257,7 +257,7 @@ private fun LandingScreenContent(
BitwardenTextField(
modifier = Modifier
.semantics { testTag = "EmailAddressEntry" }
.testTag("EmailAddressEntry")
.padding(horizontal = 16.dp)
.fillMaxWidth(),
value = state.emailInput,
@ -272,7 +272,7 @@ private fun LandingScreenContent(
selectedOption = state.selectedEnvironmentType,
onOptionSelected = onEnvironmentTypeSelect,
modifier = Modifier
.semantics { testTag = "RegionSelectorDropdown" }
.testTag("RegionSelectorDropdown")
.padding(horizontal = 16.dp)
.fillMaxWidth(),
)
@ -282,7 +282,7 @@ private fun LandingScreenContent(
isChecked = state.isRememberMeEnabled,
onCheckedChange = onRememberMeToggle,
modifier = Modifier
.semantics { testTag = "RememberMeSwitch" }
.testTag("RememberMeSwitch")
.padding(horizontal = 16.dp)
.fillMaxWidth(),
)
@ -294,7 +294,7 @@ private fun LandingScreenContent(
onClick = onContinueClick,
isEnabled = state.isContinueButtonEnabled,
modifier = Modifier
.semantics { testTag = "ContinueButton" }
.testTag("ContinueButton")
.padding(horizontal = 16.dp)
.fillMaxWidth(),
)
@ -319,7 +319,7 @@ private fun LandingScreenContent(
label = stringResource(id = R.string.create_account),
onClick = onCreateAccountClick,
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.LocalSoftwareKeyboardController
import androidx.compose.ui.platform.SoftwareKeyboardController
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
@ -240,7 +240,7 @@ private fun LoginScreenContent(
) {
BitwardenPasswordField(
modifier = Modifier
.semantics { testTag = "MasterPasswordEntry" }
.testTag("MasterPasswordEntry")
.padding(horizontal = 16.dp)
.fillMaxWidth(),
value = state.passwordInput,
@ -255,7 +255,7 @@ private fun LoginScreenContent(
style = MaterialTheme.typography.bodySmall,
modifier = Modifier
.padding(horizontal = 16.dp)
.semantics { testTag = "GetMasterPasswordHintLabel" },
.testTag("GetMasterPasswordHintLabel"),
)
Spacer(modifier = Modifier.height(20.dp))
@ -265,7 +265,7 @@ private fun LoginScreenContent(
onClick = onLoginButtonClick,
isEnabled = state.isLoginButtonEnabled,
modifier = Modifier
.semantics { testTag = "LogInWithMasterPasswordButton" }
.testTag("LogInWithMasterPasswordButton")
.padding(horizontal = 16.dp)
.fillMaxWidth(),
)
@ -278,7 +278,7 @@ private fun LoginScreenContent(
icon = painterResource(id = R.drawable.ic_device),
onClick = onLoginWithDeviceClick,
modifier = Modifier
.semantics { testTag = "LogInWithAnotherDeviceButton" }
.testTag("LogInWithAnotherDeviceButton")
.padding(horizontal = 16.dp)
.fillMaxWidth(),
)
@ -291,7 +291,7 @@ private fun LoginScreenContent(
icon = painterResource(id = R.drawable.ic_briefcase),
onClick = onSingleSignOnClick,
modifier = Modifier
.semantics { testTag = "LogInWithSsoButton" }
.testTag("LogInWithSsoButton")
.padding(horizontal = 16.dp)
.fillMaxWidth(),
)
@ -308,7 +308,7 @@ private fun LoginScreenContent(
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier
.semantics { testTag = "LoggingInAsLabel" }
.testTag("LoggingInAsLabel")
.padding(horizontal = 16.dp)
.fillMaxWidth(),
)
@ -318,7 +318,7 @@ private fun LoginScreenContent(
onClick = onNotYouButtonClick,
style = MaterialTheme.typography.labelLarge,
innerPadding = PaddingValues(vertical = 8.dp, horizontal = 16.dp),
modifier = Modifier.semantics { testTag = "NotYouLabel" },
modifier = Modifier.testTag("NotYouLabel"),
)
Spacer(modifier = Modifier.navigationBarsPadding())
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -12,8 +12,8 @@ import androidx.compose.material3.TopAppBarScrollBehavior
import androidx.compose.material3.rememberTopAppBarState
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.tooling.preview.Preview
import com.x8bit.bitwarden.R
@ -54,10 +54,10 @@ fun BitwardenMediumTopAppBar(
Text(
text = title,
style = MaterialTheme.typography.titleLarge,
modifier = Modifier.semantics { testTag = "PageTitleLabel" },
modifier = Modifier.testTag("PageTitleLabel"),
)
},
modifier = modifier.semantics { testTag = "HeaderBarComponent" },
modifier = modifier.testTag("HeaderBarComponent"),
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.graphics.Color
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.text.input.ImeAction
import com.x8bit.bitwarden.R
@ -46,7 +46,7 @@ fun BitwardenSearchTopAppBar(
) {
val focusRequester = remember { FocusRequester() }
TopAppBar(
modifier = modifier.semantics { testTag = "HeaderBarComponent" },
modifier = modifier.testTag("HeaderBarComponent"),
colors = TopAppBarDefaults.topAppBarColors(
containerColor = MaterialTheme.colorScheme.surface,
scrolledContainerColor = MaterialTheme.colorScheme.surfaceContainer,
@ -59,7 +59,7 @@ fun BitwardenSearchTopAppBar(
navigationIcon?.let {
IconButton(
onClick = it.onNavigationIconClick,
modifier = Modifier.semantics { testTag = "CloseButton" },
modifier = Modifier.testTag("CloseButton"),
) {
Icon(
modifier = Modifier.mirrorIfRtl(),

View file

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

View file

@ -17,6 +17,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
@ -54,7 +55,7 @@ fun BitwardenOverflowActionItem(
) {
IconButton(
onClick = { isOverflowMenuVisible = !isOverflowMenuVisible },
modifier = Modifier.semantics { testTag = "HeaderBarOptionsButton" },
modifier = Modifier.testTag("HeaderBarOptionsButton"),
) {
Icon(
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.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.tooling.preview.Preview
import com.x8bit.bitwarden.R
@ -27,7 +27,7 @@ fun BitwardenSearchActionItem(
) {
IconButton(
onClick = onClick,
modifier = Modifier.semantics { testTag = "SearchButton" },
modifier = Modifier.testTag("SearchButton"),
) {
Icon(
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.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
@ -75,7 +76,7 @@ fun BitwardenTextFieldWithActions(
visualTransformation = visualTransformation,
)
BitwardenRowOfActions(
modifier = Modifier.run { actionsTestTag?.let { semantics { testTag = it } } ?: this },
modifier = Modifier.run { actionsTestTag?.let { testTag(it) } ?: this },
actions = actions,
)
}

View file

@ -7,7 +7,7 @@ import androidx.compose.material3.SegmentedButtonDefaults
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.semantics.testTag
/**
@ -35,7 +35,7 @@ fun BitwardenSegmentedButton(
),
label = { Text(text = option.text) },
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.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R
@ -158,7 +158,7 @@ fun SearchContent(
}
.toPersistentList(),
modifier = Modifier
.semantics { testTag = searchType.searchItemTestTag }
.testTag(searchType.searchItemTestTag)
.fillMaxWidth()
.padding(
start = 16.dp,

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -17,9 +17,9 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
@ -65,7 +65,7 @@ fun PasswordHistoryListItem(
style = textStyle,
color = MaterialTheme.colorScheme.onSurface,
modifier = Modifier
.semantics { testTag = "GeneratedPasswordValue" }
.testTag("GeneratedPasswordValue")
.fillMaxWidth()
.onGloballyPositioned { widthPx = it.size.width },
)
@ -74,7 +74,7 @@ fun PasswordHistoryListItem(
text = supportingLabel,
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.semantics { testTag = "GeneratedPasswordDateLabel" },
modifier = Modifier.testTag("GeneratedPasswordDateLabel"),
)
}
@ -83,7 +83,7 @@ fun PasswordHistoryListItem(
colors = IconButtonDefaults.iconButtonColors(
contentColor = MaterialTheme.colorScheme.primary,
),
modifier = Modifier.semantics { testTag = "CopyPasswordValueButton" },
modifier = Modifier.testTag("CopyPasswordValueButton"),
) {
Icon(
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.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
@ -170,7 +170,7 @@ private fun PasswordHistoryContent(
supportingLabel = password.date,
onCopyClick = { onPasswordCopyClick(password) },
modifier = Modifier
.semantics { testTag = "GeneratedPasswordRow" }
.testTag("GeneratedPasswordRow")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -210,7 +210,7 @@ private fun PasswordHistoryEmpty(modifier: Modifier = Modifier) {
contentAlignment = Alignment.Center,
) {
Text(
modifier = Modifier.semantics { testTag = "NoPasswordsDisplayedLabel" },
modifier = Modifier.testTag("NoPasswordsDisplayedLabel"),
text = stringResource(id = R.string.no_passwords_to_list),
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.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R
@ -39,7 +39,7 @@ fun SendContent(
BitwardenPolicyWarningText(
text = stringResource(id = R.string.send_disabled_warning),
modifier = Modifier
.semantics { testTag = "SendOptionsPolicyInEffectLabel" }
.testTag("SendOptionsPolicyInEffectLabel")
.padding(horizontal = 16.dp)
.fillMaxWidth(),
)
@ -63,7 +63,7 @@ fun SendContent(
onClick = sendHandlers.onTextTypeClick,
modifier = Modifier
.fillMaxWidth()
.semantics { testTag = "SendTextFilter" }
.testTag("SendTextFilter")
.padding(horizontal = 16.dp),
)
}
@ -76,7 +76,7 @@ fun SendContent(
onClick = sendHandlers.onFileTypeClick,
modifier = Modifier
.fillMaxWidth()
.semantics { testTag = "SendFileFilter" }
.testTag("SendFileFilter")
.padding(horizontal = 16.dp),
)
}
@ -110,7 +110,7 @@ fun SendContent(
null
},
modifier = Modifier
.semantics { testTag = "SendCell" }
.testTag("SendCell")
.padding(
start = 16.dp,
// 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.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.core.net.toUri
import androidx.hilt.navigation.compose.hiltViewModel
@ -161,7 +161,7 @@ fun SendScreen(
onClick = remember(viewModel) {
{ viewModel.trySendAction(SendAction.AddSendClick) }
},
modifier = Modifier.semantics { testTag = "AddItemButton" },
modifier = Modifier.testTag("AddItemButton"),
) {
Icon(
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.Modifier
import androidx.compose.ui.draw.clipToBounds
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
@ -86,7 +87,7 @@ fun AddSendContent(
BitwardenPolicyWarningText(
text = stringResource(id = R.string.send_options_policy_in_effect),
modifier = Modifier
.semantics { testTag = "SendOptionsPolicyInEffectLabel" }
.testTag("SendOptionsPolicyInEffectLabel")
.padding(horizontal = 16.dp)
.fillMaxWidth(),
)
@ -96,7 +97,7 @@ fun AddSendContent(
BitwardenTextField(
modifier = Modifier
.semantics { testTag = "SendNameEntry" }
.testTag("SendNameEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
label = stringResource(id = R.string.name),
@ -168,7 +169,7 @@ fun AddSendContent(
} else if (isAddMode) {
Text(
modifier = Modifier
.semantics { testTag = "SendCurrentFileNameLabel" }
.testTag("SendCurrentFileNameLabel")
.align(Alignment.CenterHorizontally),
text = type.name ?: stringResource(id = R.string.no_file_chosen),
color = MaterialTheme.colorScheme.onSurfaceVariant,
@ -187,7 +188,7 @@ fun AddSendContent(
}
},
modifier = Modifier
.semantics { testTag = "SendChooseFileButton" }
.testTag("SendChooseFileButton")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -234,7 +235,7 @@ fun AddSendContent(
is AddSendState.ViewState.Content.SendType.Text -> {
BitwardenTextField(
modifier = Modifier
.semantics { testTag = "SendTextContentEntry" }
.testTag("SendTextContentEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
label = stringResource(id = R.string.text),
@ -247,7 +248,7 @@ fun AddSendContent(
Spacer(modifier = Modifier.height(16.dp))
BitwardenWideSwitch(
modifier = Modifier
.semantics { testTag = "SendHideTextByDefaultToggle" }
.testTag("SendHideTextByDefaultToggle")
.fillMaxWidth()
.padding(horizontal = 16.dp),
label = stringResource(id = R.string.hide_text_by_default),
@ -292,7 +293,7 @@ private fun AddSendOptions(
var isExpanded by rememberSaveable { mutableStateOf(false) }
Row(
modifier = Modifier
.semantics { testTag = "SendShowHideOptionsButton" }
.testTag("SendShowHideOptionsButton")
.fillMaxWidth()
.clickable(
onClickLabel = if (isExpanded) {
@ -333,7 +334,7 @@ private fun AddSendOptions(
if (isAddMode) {
SendDeletionDateChooser(
modifier = Modifier
.semantics { testTag = "SendDeletionOptionsPicker" }
.testTag("SendDeletionOptionsPicker")
.fillMaxWidth()
.padding(horizontal = 16.dp),
dateFormatPattern = state.common.dateFormatPattern,
@ -345,7 +346,7 @@ private fun AddSendOptions(
Spacer(modifier = Modifier.height(8.dp))
SendExpirationDateChooser(
modifier = Modifier
.semantics { testTag = "SendExpirationOptionsPicker" }
.testTag("SendExpirationOptionsPicker")
.fillMaxWidth()
.padding(horizontal = 16.dp),
dateFormatPattern = state.common.dateFormatPattern,
@ -364,7 +365,7 @@ private fun AddSendOptions(
Spacer(modifier = Modifier.height(8.dp))
AddSendCustomDateChooser(
modifier = Modifier
.semantics { testTag = "SendCustomDeletionDatePicker" }
.testTag("SendCustomDeletionDatePicker")
.fillMaxWidth()
.padding(horizontal = 16.dp),
dateLabel = stringResource(id = R.string.deletion_date),
@ -395,7 +396,7 @@ private fun AddSendOptions(
Spacer(modifier = Modifier.height(8.dp))
AddSendCustomDateChooser(
modifier = Modifier
.semantics { testTag = "SendCustomExpirationDatePicker" }
.testTag("SendCustomExpirationDatePicker")
.fillMaxWidth()
.padding(horizontal = 16.dp),
dateLabel = stringResource(id = R.string.expiration_date),
@ -425,7 +426,7 @@ private fun AddSendOptions(
onClick = addSendHandlers.onClearExpirationDateClick,
isEnabled = state.common.expirationDate != null && !sendRestrictionPolicy,
modifier = Modifier
.semantics { testTag = "SendClearExpirationDateButton" }
.testTag("SendClearExpirationDateButton")
.wrapContentWidth(),
)
}
@ -440,7 +441,7 @@ private fun AddSendOptions(
range = 0..Int.MAX_VALUE,
textFieldReadOnly = sendRestrictionPolicy,
modifier = Modifier
.semantics { testTag = "SendMaxAccessCountEntry" }
.testTag("SendMaxAccessCountEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -485,7 +486,7 @@ private fun AddSendOptions(
value = state.common.passwordInput,
onValueChange = addSendHandlers.onPasswordChange,
modifier = Modifier
.semantics { testTag = "SendNewPasswordEntry" }
.testTag("SendNewPasswordEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -504,7 +505,7 @@ private fun AddSendOptions(
Spacer(modifier = Modifier.height(16.dp))
BitwardenWideSwitch(
modifier = Modifier
.semantics { testTag = "SendHideEmailSwitch" }
.testTag("SendHideEmailSwitch")
.fillMaxWidth()
.padding(horizontal = 16.dp),
label = stringResource(id = R.string.hide_email),
@ -516,7 +517,7 @@ private fun AddSendOptions(
Spacer(modifier = Modifier.height(16.dp))
BitwardenWideSwitch(
modifier = Modifier
.semantics { testTag = "SendDeactivateSwitch" }
.testTag("SendDeactivateSwitch")
.fillMaxWidth()
.padding(horizontal = 16.dp),
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.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
@ -146,7 +146,7 @@ fun AddSendScreen(
onClick = remember(viewModel) {
{ viewModel.trySendAction(AddSendAction.SaveClick) }
},
modifier = Modifier.semantics { testTag = "SaveButton" },
modifier = Modifier.testTag("SaveButton"),
)
if (!state.isAddMode) {
BitwardenOverflowActionItem(

View file

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

View file

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

View file

@ -6,8 +6,8 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import com.x8bit.bitwarden.R
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledTonalButton
@ -76,6 +76,6 @@ fun VaultAddEditCustomFieldsButton(
BitwardenFilledTonalButton(
label = stringResource(id = R.string.new_custom_field),
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.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R
@ -49,7 +49,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = commonState.name,
onValueChange = commonTypeHandlers.onNameTextChange,
modifier = Modifier
.semantics { testTag = "ItemNameEntry" }
.testTag("ItemNameEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -60,7 +60,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
selectedTitle = identityState.selectedTitle,
onTitleSelected = identityItemTypeHandlers.onTitleSelected,
modifier = Modifier
.semantics { testTag = "IdentityTitlePicker" }
.testTag("IdentityTitlePicker")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -72,7 +72,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.firstName,
onValueChange = identityItemTypeHandlers.onFirstNameTextChange,
modifier = Modifier
.semantics { testTag = "IdentityFirstNameEntry" }
.testTag("IdentityFirstNameEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -84,7 +84,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.middleName,
onValueChange = identityItemTypeHandlers.onMiddleNameTextChange,
modifier = Modifier
.semantics { testTag = "IdentityMiddleNameEntry" }
.testTag("IdentityMiddleNameEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -96,7 +96,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.lastName,
onValueChange = identityItemTypeHandlers.onLastNameTextChange,
modifier = Modifier
.semantics { testTag = "IdentityLastNameEntry" }
.testTag("IdentityLastNameEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -108,7 +108,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.username,
onValueChange = identityItemTypeHandlers.onUsernameTextChange,
modifier = Modifier
.semantics { testTag = "IdentityUsernameEntry" }
.testTag("IdentityUsernameEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -120,7 +120,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.company,
onValueChange = identityItemTypeHandlers.onCompanyTextChange,
modifier = Modifier
.semantics { testTag = "IdentityCompanyEntry" }
.testTag("IdentityCompanyEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -132,7 +132,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.ssn,
onValueChange = identityItemTypeHandlers.onSsnTextChange,
modifier = Modifier
.semantics { testTag = "IdentitySsnEntry" }
.testTag("IdentitySsnEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -144,7 +144,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.passportNumber,
onValueChange = identityItemTypeHandlers.onPassportNumberTextChange,
modifier = Modifier
.semantics { testTag = "IdentityPassportNumberEntry" }
.testTag("IdentityPassportNumberEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -156,7 +156,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.licenseNumber,
onValueChange = identityItemTypeHandlers.onLicenseNumberTextChange,
modifier = Modifier
.semantics { testTag = "IdentityLicenseNumberEntry" }
.testTag("IdentityLicenseNumberEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -168,7 +168,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.email,
onValueChange = identityItemTypeHandlers.onEmailTextChange,
modifier = Modifier
.semantics { testTag = "IdentityEmailEntry" }
.testTag("IdentityEmailEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -180,7 +180,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.phone,
onValueChange = identityItemTypeHandlers.onPhoneTextChange,
modifier = Modifier
.semantics { testTag = "IdentityPhoneEntry" }
.testTag("IdentityPhoneEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -192,7 +192,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.address1,
onValueChange = identityItemTypeHandlers.onAddress1TextChange,
modifier = Modifier
.semantics { testTag = "IdentityAddressOneEntry" }
.testTag("IdentityAddressOneEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -204,7 +204,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.address2,
onValueChange = identityItemTypeHandlers.onAddress2TextChange,
modifier = Modifier
.semantics { testTag = "IdentityAddressTwoEntry" }
.testTag("IdentityAddressTwoEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -216,7 +216,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.address3,
onValueChange = identityItemTypeHandlers.onAddress3TextChange,
modifier = Modifier
.semantics { testTag = "IdentityAddressThreeEntry" }
.testTag("IdentityAddressThreeEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -228,7 +228,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.city,
onValueChange = identityItemTypeHandlers.onCityTextChange,
modifier = Modifier
.semantics { testTag = "IdentityCityEntry" }
.testTag("IdentityCityEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -240,7 +240,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.state,
onValueChange = identityItemTypeHandlers.onStateTextChange,
modifier = Modifier
.semantics { testTag = "IdentityStateEntry" }
.testTag("IdentityStateEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -252,7 +252,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.zip,
onValueChange = identityItemTypeHandlers.onZipTextChange,
modifier = Modifier
.semantics { testTag = "IdentityPostalCodeEntry" }
.testTag("IdentityPostalCodeEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -264,7 +264,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = identityState.country,
onValueChange = identityItemTypeHandlers.onCountryTextChange,
modifier = Modifier
.semantics { testTag = "IdentityCountryEntry" }
.testTag("IdentityCountryEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -295,7 +295,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
)
},
modifier = Modifier
.semantics { testTag = "FolderPicker" }
.testTag("FolderPicker")
.padding(horizontal = 16.dp),
)
}
@ -309,7 +309,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
isChecked = commonState.favorite,
onCheckedChange = commonTypeHandlers.onToggleFavorite,
modifier = Modifier
.semantics { testTag = "ItemFavoriteToggle" }
.testTag("ItemFavoriteToggle")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -323,7 +323,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
isChecked = commonState.masterPasswordReprompt,
onCheckedChange = commonTypeHandlers.onToggleMasterPasswordReprompt,
modifier = Modifier
.semantics { testTag = "MasterPasswordRepromptToggle" }
.testTag("MasterPasswordRepromptToggle")
.fillMaxWidth()
.padding(horizontal = 16.dp),
actions = {
@ -359,7 +359,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
value = commonState.notes,
onValueChange = commonTypeHandlers.onNotesTextChange,
modifier = Modifier
.semantics { testTag = "ItemNotesEntry" }
.testTag("ItemNotesEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -445,7 +445,7 @@ fun LazyListScope.vaultAddEditIdentityItems(
)
},
modifier = Modifier
.semantics { testTag = "ItemOwnershipPicker" }
.testTag("ItemOwnershipPicker")
.fillMaxWidth()
.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.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R
@ -60,7 +60,7 @@ fun VaultAddEditContent(
text = stringResource(R.string.personal_ownership_policy_in_effect),
modifier = Modifier
.padding(horizontal = 16.dp)
.semantics { testTag = "PersonalOwnershipPolicyLabel" }
.testTag("PersonalOwnershipPolicyLabel")
.fillMaxWidth(),
)
}
@ -81,7 +81,7 @@ fun VaultAddEditContent(
itemType = state.type,
onTypeOptionClicked = onTypeOptionClicked,
modifier = Modifier
.semantics { testTag = "ItemTypePicker" }
.testTag("ItemTypePicker")
.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.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R
@ -61,7 +61,7 @@ fun LazyListScope.vaultAddEditLoginItems(
value = commonState.name,
onValueChange = commonActionHandler.onNameTextChange,
modifier = Modifier
.semantics { testTag = "ItemNameEntry" }
.testTag("ItemNameEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -111,7 +111,7 @@ fun LazyListScope.vaultAddEditLoginItems(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp)
.semantics { testTag = "LoginTotpEntry" },
.testTag("LoginTotpEntry"),
label = stringResource(id = R.string.totp),
value = loginState.totp,
trailingIconContent = {
@ -155,7 +155,7 @@ fun LazyListScope.vaultAddEditLoginItems(
icon = painterResource(id = R.drawable.ic_light_bulb),
onClick = onTotpSetupClick,
modifier = Modifier
.semantics { testTag = "SetupTotpButton" }
.testTag("SetupTotpButton")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -187,7 +187,7 @@ fun LazyListScope.vaultAddEditLoginItems(
label = stringResource(id = R.string.new_uri),
onClick = loginItemTypeHandlers.onAddNewUriClick,
modifier = Modifier
.semantics { testTag = "LoginAddNewUriButton" }
.testTag("LoginAddNewUriButton")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -220,7 +220,7 @@ fun LazyListScope.vaultAddEditLoginItems(
)
},
modifier = Modifier
.semantics { testTag = "FolderPicker" }
.testTag("FolderPicker")
.padding(horizontal = 16.dp),
)
}
@ -234,7 +234,7 @@ fun LazyListScope.vaultAddEditLoginItems(
isChecked = commonState.favorite,
onCheckedChange = commonActionHandler.onToggleFavorite,
modifier = Modifier
.semantics { testTag = "ItemFavoriteToggle" }
.testTag("ItemFavoriteToggle")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -247,7 +247,7 @@ fun LazyListScope.vaultAddEditLoginItems(
isChecked = commonState.masterPasswordReprompt,
onCheckedChange = commonActionHandler.onToggleMasterPasswordReprompt,
modifier = Modifier
.semantics { testTag = "MasterPasswordRepromptToggle" }
.testTag("MasterPasswordRepromptToggle")
.fillMaxWidth()
.padding(horizontal = 16.dp),
actions = {
@ -283,7 +283,7 @@ fun LazyListScope.vaultAddEditLoginItems(
value = commonState.notes,
onValueChange = commonActionHandler.onNotesTextChange,
modifier = Modifier
.semantics { testTag = "ItemNotesEntry" }
.testTag("ItemNotesEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -352,7 +352,7 @@ fun LazyListScope.vaultAddEditLoginItems(
)
},
modifier = Modifier
.semantics { testTag = "ItemOwnershipPicker" }
.testTag("ItemOwnershipPicker")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -395,11 +395,11 @@ private fun UsernameRow(
shouldShowDialog = true
}
},
modifier = Modifier.semantics { testTag = "GenerateUsernameButton" },
modifier = Modifier.testTag("GenerateUsernameButton"),
)
},
modifier = Modifier
.semantics { testTag = "LoginUsernameEntry" }
.testTag("LoginUsernameEntry")
.padding(horizontal = 16.dp),
)
@ -452,7 +452,7 @@ private fun PasswordRow(
),
onClick = loginItemTypeHandlers.onPasswordCheckerClick,
modifier = Modifier
.semantics { testTag = "CheckPasswordButton" },
.testTag("CheckPasswordButton"),
)
BitwardenIconButtonWithResource(
iconRes = IconResource(
@ -467,7 +467,7 @@ private fun PasswordRow(
}
},
modifier = Modifier
.semantics { testTag = "RegeneratePasswordButton" },
.testTag("RegeneratePasswordButton"),
)
if (shouldShowDialog) {
@ -499,7 +499,7 @@ private fun PasswordRow(
modifier = Modifier
.fillMaxWidth()
.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.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.core.net.toUri
import androidx.hilt.navigation.compose.hiltViewModel
@ -182,7 +182,7 @@ fun VaultAddEditScreen(
onClick = remember(viewModel) {
{ viewModel.trySendAction(VaultAddEditAction.Common.SaveClick) }
},
modifier = Modifier.semantics { testTag = "SaveButton" },
modifier = Modifier.testTag("SaveButton"),
)
BitwardenOverflowActionItem(
menuItemDataList = persistentListOfNotNull(

View file

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

View file

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

View file

@ -12,9 +12,9 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
@ -94,7 +94,7 @@ fun AttachmentsScreen(
BitwardenTextButton(
label = stringResource(id = R.string.save),
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.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R
@ -55,7 +55,7 @@ fun VaultItemCardContent(
readOnly = true,
singleLine = false,
modifier = Modifier
.semantics { testTag = "CardItemNameEntry" }
.testTag("CardItemNameEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -70,7 +70,7 @@ fun VaultItemCardContent(
readOnly = true,
singleLine = false,
modifier = Modifier
.semantics { testTag = "CardholderNameEntry" }
.testTag("CardholderNameEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -92,7 +92,7 @@ fun VaultItemCardContent(
contentDescription = stringResource(id = R.string.copy_number),
),
onClick = vaultCardItemTypeHandlers.onCopyNumberClick,
modifier = Modifier.semantics { testTag = "CardCopyNumberButton" },
modifier = Modifier.testTag("CardCopyNumberButton"),
)
},
passwordFieldTestTag = "CardNumberEntry",
@ -114,7 +114,7 @@ fun VaultItemCardContent(
readOnly = true,
singleLine = false,
modifier = Modifier
.semantics { testTag = "CardBrandEntry" }
.testTag("CardBrandEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -131,7 +131,7 @@ fun VaultItemCardContent(
readOnly = true,
singleLine = false,
modifier = Modifier
.semantics { testTag = "CardExpirationEntry" }
.testTag("CardExpirationEntry")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -157,7 +157,7 @@ fun VaultItemCardContent(
),
onClick = vaultCardItemTypeHandlers.onCopySecurityCodeClick,
modifier = Modifier
.semantics { testTag = "CardCopySecurityCodeButton" },
.testTag("CardCopySecurityCodeButton"),
)
},
modifier = Modifier
@ -186,7 +186,7 @@ fun VaultItemCardContent(
readOnly = true,
singleLine = false,
modifier = Modifier
.semantics { testTag = "CipherNotesLabel" }
.testTag("CipherNotesLabel")
.fillMaxWidth()
.padding(horizontal = 16.dp),
)
@ -230,7 +230,7 @@ fun VaultItemCardContent(
items(attachments) { attachmentItem ->
AttachmentItemContent(
modifier = Modifier
.semantics { testTag = "CipherAttachment" }
.testTag("CipherAttachment")
.fillMaxWidth()
.padding(start = 16.dp),
attachmentItem = attachmentItem,

View file

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

View file

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

View file

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

View file

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

View file

@ -22,9 +22,9 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.core.net.toUri
import androidx.hilt.navigation.compose.hiltViewModel
@ -230,7 +230,7 @@ private fun VaultItemListingScaffold(
FloatingActionButton(
containerColor = MaterialTheme.colorScheme.primaryContainer,
onClick = vaultItemListingHandlers.addVaultItemClick,
modifier = Modifier.semantics { testTag = "AddItemButton" },
modifier = Modifier.testTag("AddItemButton"),
) {
Icon(
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.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
@ -55,7 +55,7 @@ fun VaultMoveToOrganizationContent(
)
},
modifier = Modifier
.semantics { testTag = "OrganizationListDropdown" }
.testTag("OrganizationListDropdown")
.padding(horizontal = 16.dp),
)
}

View file

@ -13,9 +13,9 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
@ -122,7 +122,7 @@ private fun VaultMoveToOrganizationScaffold(
onClick = moveClick,
isEnabled = state.viewState is
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.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R
@ -57,7 +57,7 @@ fun VaultContent(
showDivider = true,
modifier = Modifier
.fillMaxWidth()
.semantics { testTag = "FolderFilter" }
.testTag("FolderFilter")
.padding(16.dp),
)
}
@ -101,7 +101,7 @@ fun VaultContent(
},
modifier = Modifier
.fillMaxWidth()
.semantics { testTag = "CipherCell" }
.testTag("CipherCell")
.padding(
start = 16.dp,
// There is some built-in padding to the menu button that makes up
@ -146,7 +146,7 @@ fun VaultContent(
showDivider = false,
modifier = Modifier
.fillMaxWidth()
.semantics { testTag = "LoginFilter" }
.testTag("LoginFilter")
.padding(horizontal = 16.dp),
)
}
@ -161,7 +161,7 @@ fun VaultContent(
showDivider = false,
modifier = Modifier
.fillMaxWidth()
.semantics { testTag = "CardFilter" }
.testTag("CardFilter")
.padding(horizontal = 16.dp),
)
}
@ -176,7 +176,7 @@ fun VaultContent(
showDivider = false,
modifier = Modifier
.fillMaxWidth()
.semantics { testTag = "IdentityFilter" }
.testTag("IdentityFilter")
.padding(horizontal = 16.dp),
)
}
@ -191,7 +191,7 @@ fun VaultContent(
showDivider = false,
modifier = Modifier
.fillMaxWidth()
.semantics { testTag = "SecureNoteFilter" }
.testTag("SecureNoteFilter")
.padding(horizontal = 16.dp),
)
}
@ -230,7 +230,7 @@ fun VaultContent(
showDivider = false,
modifier = Modifier
.fillMaxWidth()
.semantics { testTag = "FolderFilter" }
.testTag("FolderFilter")
.padding(horizontal = 16.dp),
)
}
@ -279,7 +279,7 @@ fun VaultContent(
},
modifier = Modifier
.fillMaxWidth()
.semantics { testTag = "CipherCell" }
.testTag("CipherCell")
.padding(horizontal = 16.dp),
)
}
@ -315,7 +315,7 @@ fun VaultContent(
showDivider = false,
modifier = Modifier
.fillMaxWidth()
.semantics { testTag = "CollectionFilter" }
.testTag("CollectionFilter")
.padding(horizontal = 16.dp),
)
}
@ -354,7 +354,7 @@ fun VaultContent(
showDivider = false,
modifier = Modifier
.fillMaxWidth()
.semantics { testTag = "TrashFilter" }
.testTag("TrashFilter")
.padding(horizontal = 16.dp),
)
}

View file

@ -17,9 +17,9 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.unit.dp
import com.x8bit.bitwarden.R
@ -75,7 +75,7 @@ fun VaultFilter(
.scrolledContainerBackground(topAppBarScrollBehavior)
.bottomDivider(color = MaterialTheme.colorScheme.outlineVariant)
.padding(vertical = 8.dp)
.semantics { testTag = "ActiveFilterRow" }
.testTag("ActiveFilterRow")
.then(modifier),
verticalAlignment = Alignment.CenterVertically,
) {
@ -87,7 +87,7 @@ fun VaultFilter(
style = MaterialTheme.typography.bodyLarge,
color = MaterialTheme.colorScheme.onSurface,
modifier = Modifier
.semantics { testTag = "ActiveFilterLabel" }
.testTag("ActiveFilterLabel")
.weight(1f),
)
@ -95,7 +95,7 @@ fun VaultFilter(
IconButton(
onClick = { shouldShowSelectionDialog = true },
modifier = Modifier.semantics { testTag = "OpenOrgFilter" },
modifier = Modifier.testTag("OpenOrgFilter"),
) {
Icon(
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.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.unit.dp
import androidx.core.net.toUri
@ -254,7 +254,7 @@ private fun VaultScreenScaffold(
FloatingActionButton(
containerColor = MaterialTheme.colorScheme.primaryContainer,
onClick = vaultHandlers.addItemClickAction,
modifier = Modifier.semantics { testTag = "AddItemButton" },
modifier = Modifier.testTag("AddItemButton"),
) {
Icon(
painter = painterResource(id = R.drawable.ic_plus),