Relative Content

Tag Archive for android-jetpack-composeaccessibility

Is there a problem if I add a contentDescription semantic modifier to just about every element of my UI to simplify testing?

I’m starting to make UI tests for my app. In order to probe certain parts of the screen, there’s a suite of onNode* functions that come with the ComposeRule. In particular, there’s onNodeWithContentDescription which will try to find elements with a specific contentDescription value. Some stuff like Icon expose this in their constructor, but there’s also the modifier Modifier.semantics {this.contentDescription = "desc"} that could be applied to any composable.