mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 11:07:10 +00:00
feat(folio): add screen root contentDescription for scoped ax selection
Each screen root gets semantics { contentDescription = "ScreenName" } so
sanderling specs can scope element lookups through the screen: desc:LoginScreen > desc:login_submit.
This commit is contained in:
1 parent
3feb7b2d7f
commit
cd11faf1fa
5 files changed
+11
-5
No files matched your search
+3
-1
@@ -14,6 +14,8 @@ 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.semantics.contentDescription
|
||||
import androidx.compose.ui.semantics.semantics
|
||||
import androidx.compose.ui.unit.dp
|
||||
import app.folio.data.Repository
|
||||
import app.folio.navigation.Navigator
|
||||
@@ -60,7 +62,7 @@ fun AddAccountScreen() {
|
||||
}
|
||||
|
||||
Screen(
|
||||
modifier = Modifier.testTag("AddAccountScreen"),
|
||||
modifier = Modifier.testTag("AddAccountScreen").semantics { contentDescription = "AddAccountScreen" },
|
||||
header = {
|
||||
Header(title = "New account", left = { BackButton(onClick = { Navigator.back(Route.Home) }) })
|
||||
},
|
||||
|
||||
+3
-1
@@ -16,6 +16,8 @@ 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.semantics.contentDescription
|
||||
import androidx.compose.ui.semantics.semantics
|
||||
import androidx.compose.ui.text.input.KeyboardType
|
||||
import androidx.compose.ui.unit.dp
|
||||
import app.folio.data.Repository
|
||||
@@ -60,7 +62,7 @@ fun LoginScreen(onLoggedIn: (String) -> Unit) {
|
||||
onLoggedIn(user)
|
||||
}
|
||||
|
||||
Screen(modifier = Modifier.testTag("LoginScreen")) {
|
||||
Screen(modifier = Modifier.testTag("LoginScreen").semantics { contentDescription = "LoginScreen" }) {
|
||||
Spacer(Modifier.height(16.dp))
|
||||
Column(
|
||||
modifier = Modifier.fillMaxWidth().padding(vertical = 8.dp),
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ fun HomeScreen(user: String, onLogout: () -> Unit) {
|
||||
val total = balanceOf(txns)
|
||||
|
||||
Screen(
|
||||
modifier = Modifier.testTag("HomeScreen"),
|
||||
modifier = Modifier.testTag("HomeScreen").semantics { contentDescription = "HomeScreen" },
|
||||
header = {
|
||||
Header(
|
||||
title = "Accounts",
|
||||
|
||||
+3
-1
@@ -13,6 +13,8 @@ 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.semantics.contentDescription
|
||||
import androidx.compose.ui.semantics.semantics
|
||||
import androidx.compose.ui.text.input.KeyboardType
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
@@ -91,7 +93,7 @@ fun AddTransactionScreen(accountId: String) {
|
||||
}
|
||||
|
||||
Screen(
|
||||
modifier = Modifier.testTag("AddTransactionScreen"),
|
||||
modifier = Modifier.testTag("AddTransactionScreen").semantics { contentDescription = "AddTransactionScreen" },
|
||||
header = {
|
||||
Header(
|
||||
title = "Add transaction",
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ fun LedgerScreen(accountId: String) {
|
||||
val balance = balanceOf(txns)
|
||||
|
||||
Screen(
|
||||
modifier = Modifier.testTag("LedgerScreen"),
|
||||
modifier = Modifier.testTag("LedgerScreen").semantics { contentDescription = "LedgerScreen" },
|
||||
header = {
|
||||
Header(
|
||||
title = account.name,
|
||||
|
||||
Reference in new issue
Block a user