BIT-1169: Adding element ids for the environment screen (#649)

This commit is contained in:
Joshua Queen 2024-01-17 16:46:00 -05:00 committed by Álison Fernandes
parent 1db2a25f4b
commit d66f707d14

View file

@ -17,11 +17,15 @@ import androidx.compose.material3.rememberTopAppBarState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext
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.semantics.testTagsAsResourceId
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
@ -41,7 +45,7 @@ import com.x8bit.bitwarden.ui.platform.components.BitwardenTopAppBar
* Displays the about self-hosted/custom environment screen.
*/
@Suppress("LongMethod")
@OptIn(ExperimentalMaterial3Api::class)
@OptIn(ExperimentalMaterial3Api::class, ExperimentalComposeUiApi::class)
@Composable
fun EnvironmentScreen(
onNavigateBack: () -> Unit,
@ -99,6 +103,7 @@ fun EnvironmentScreen(
) { innerPadding ->
Column(
Modifier
.semantics { testTagsAsResourceId = true }
.padding(innerPadding)
.fillMaxSize()
.imePadding()
@ -124,6 +129,7 @@ fun EnvironmentScreen(
keyboardType = KeyboardType.Uri,
modifier = Modifier
.fillMaxWidth()
.semantics { testTag = "ServerUrlEntry" }
.padding(horizontal = 16.dp),
)
@ -147,6 +153,7 @@ fun EnvironmentScreen(
keyboardType = KeyboardType.Uri,
modifier = Modifier
.fillMaxWidth()
.semantics { testTag = "WebVaultUrlEntry" }
.padding(horizontal = 16.dp),
)
@ -161,6 +168,7 @@ fun EnvironmentScreen(
keyboardType = KeyboardType.Uri,
modifier = Modifier
.fillMaxWidth()
.semantics { testTag = "ApiUrlEntry" }
.padding(horizontal = 16.dp),
)
@ -175,6 +183,7 @@ fun EnvironmentScreen(
keyboardType = KeyboardType.Uri,
modifier = Modifier
.fillMaxWidth()
.semantics { testTag = "IdentityUrlEntry" }
.padding(horizontal = 16.dp),
)
@ -190,6 +199,7 @@ fun EnvironmentScreen(
keyboardType = KeyboardType.Uri,
modifier = Modifier
.fillMaxWidth()
.semantics { testTag = "IconsUrlEntry" }
.padding(horizontal = 16.dp),
)