Kivia Brito
04/05/2022, 6:09 PMModifier.
.clickable(enable = true)
.focusable(enable = true)
And using the method
fun SemanticsNodeInteraction.assertIsNotEnabled(): SemanticsNodeInteraction = assert(isNotEnabled())
but my SemanticsConfiguration
doesn't seems to contain the
SemanticsProperties.Disabled
key.
Any thoughts in how to include this key to my SemanticsConfiguration
?FunkyMuse
04/05/2022, 6:56 PMvar isButtonEnabled by remember { mutableStateOf(false) }
Button(
enabled = isButtonEnabled,
){
}
You can test the variable this way
Or access the semantics through the InspectorInfo > properties > properties[“enabled”]Kivia Brito
04/05/2022, 7:38 PMSemanticsProperties.Disabled
wasn't there, I was getting the wrong node when looking for the button by its text. Now I am trying to figure out how to get a node from its Role. Any idea?ritesh
04/05/2022, 9:55 PMNow I am trying to figure out how to get a node from its Role. Any idea?Everything related to Compose test api's are here https://developer.android.com/jetpack/compose/testing-cheatsheet Including
tree-traversal
api's.
Still if you are not able to get the required node, you can tag it and use the same tag to get the node.