guys, is it posible to automate `contentDescriptio...
# compose
d
guys, is it posible to automate
contentDescription
generation for every composable in the project?
Copy code
modifier = Modifier.semantics {
      contentDescription = "back button"
    }
maybe with reflection or some AOP tool? ideally i would name each contentDescription with a current composable function name
b
The
contentDescription
is what accessibility services such as TalkBack will read to your users who need assistance reading what is on the screen. I think you will find that trying to automatically generate a
contentDescription
is unlikely to result in a meaningful experience for those users.
4
d
i'm trying to prepare our app for appium tests
b
Abusing
contentDescription
for automated testing is an unfortunately common pattern. I’m not particularly familiar with Appium, but if it doesn’t support tests via
Modifier.testTag()
that is a huge miss. Test tags are the best replacement for using
contentDescription
as a automation tag and for finding a view by its ID when a description is unavailable. Regardless, I’d encourage you to prioritize the experience of users with accessibility services over automated testing.
d
the compose support in appium isn't great at this moment. still, i'm searching the automated way to fill all the
Modifier.testTag()
(or whatever modifier) for every single composable. it's hard to switch from OOP world to fully functional, so i'm kinda stuck now