diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/attachments/AttachmentsContent.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/attachments/AttachmentsContent.kt index 6d2d62cf861..422cef1406a 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/attachments/AttachmentsContent.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/attachments/AttachmentsContent.kt @@ -65,7 +65,8 @@ fun AttachmentsContent( onDeleteClick = attachmentsHandlers.onDeleteClick, modifier = Modifier .fillMaxWidth() - .padding(horizontal = 16.dp), + .padding(horizontal = 16.dp) + .testTag("AttachmentList"), ) } } @@ -92,7 +93,8 @@ fun AttachmentsContent( textAlign = TextAlign.Center, modifier = Modifier .fillMaxWidth() - .padding(horizontal = 16.dp), + .padding(horizontal = 16.dp) + .testTag("SelectedFileNameLabel"), ) } @@ -103,7 +105,8 @@ fun AttachmentsContent( onClick = attachmentsHandlers.onChooseFileClick, modifier = Modifier .fillMaxWidth() - .padding(horizontal = 16.dp), + .padding(horizontal = 16.dp) + .testTag("AttachmentSelectFileButton"), ) Spacer(modifier = Modifier.height(4.dp)) Text( @@ -159,7 +162,9 @@ private fun AttachmentListEntry( style = BitwardenTheme.typography.bodyMedium, maxLines = 1, overflow = TextOverflow.Ellipsis, - modifier = Modifier.weight(1f), + modifier = Modifier + .weight(1f) + .testTag("AttachmentNameLabel"), ) Spacer(modifier = Modifier.width(16.dp)) @@ -168,7 +173,8 @@ private fun AttachmentListEntry( text = attachmentItem.displaySize, color = BitwardenTheme.colorScheme.text.primary, style = BitwardenTheme.typography.labelSmall, - modifier = Modifier, + modifier = Modifier + .testTag("AttachmentSizeLabel"), ) Spacer(modifier = Modifier.width(8.dp)) @@ -177,6 +183,8 @@ private fun AttachmentListEntry( vectorIconRes = R.drawable.ic_trash, contentDescription = stringResource(id = R.string.delete), onClick = { shouldShowDeleteDialog = true }, + modifier = Modifier + .testTag("AttachmentDeleteButton"), ) } } diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemAttachmentContent.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemAttachmentContent.kt index 1df2c1d6e5c..a94e9dc0df7 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemAttachmentContent.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemAttachmentContent.kt @@ -14,6 +14,7 @@ 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.stringResource import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp @@ -40,7 +41,8 @@ fun AttachmentItemContent( modifier = modifier .bottomDivider() .defaultMinSize(minHeight = 56.dp) - .padding(vertical = 8.dp), + .padding(vertical = 8.dp) + .testTag("CipherAttachment"), verticalAlignment = Alignment.CenterVertically, ) { Text( @@ -49,7 +51,8 @@ fun AttachmentItemContent( style = BitwardenTheme.typography.bodyMedium, maxLines = 1, overflow = TextOverflow.Ellipsis, - modifier = Modifier.weight(1f), + modifier = Modifier.weight(1f) + .testTag("AttachmentNameLabel"), ) Spacer(modifier = Modifier.width(16.dp)) @@ -58,7 +61,8 @@ fun AttachmentItemContent( text = attachmentItem.displaySize, color = BitwardenTheme.colorScheme.text.primary, style = BitwardenTheme.typography.labelSmall, - modifier = Modifier, + modifier = Modifier + .testTag("AttachmentSizeLabel"), ) Spacer(modifier = Modifier.width(8.dp)) @@ -79,6 +83,8 @@ fun AttachmentItemContent( onAttachmentDownloadClick(attachmentItem) }, + modifier = Modifier + .testTag("AttachmentDownloadButton"), ) } diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemLoginContent.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemLoginContent.kt index 5f7631dd7db..eb1e7c87cee 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemLoginContent.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemLoginContent.kt @@ -203,7 +203,6 @@ fun VaultItemLoginContent( items(attachments) { attachmentItem -> AttachmentItemContent( modifier = Modifier - .testTag("CipherAttachment") .fillMaxWidth() .padding(start = 16.dp), attachmentItem = attachmentItem,