pajatopmr
02/13/2022, 10:50 AMZach Klippenstein (he/him) [MOD]
02/16/2022, 1:43 PMpajatopmr
02/16/2022, 4:24 PMcheckIsDisplayed()
. If so, did you have something in mind?
Right now, my leading path to a solution is to implement checkIsDisplayed()
.Zach Klippenstein (he/him) [MOD]
02/22/2022, 7:00 PMText
we automatically publish the text string as a semantics property, which is how onNodeWithText()
finds it. You probably want to do something similar with your black square.pajatopmr
02/22/2022, 10:38 PMYou use semantics to describe parts of your UI for both accessibility and testing.I do? Not intentionally in any case.
So e.g. when you useI'm curious, who is "we"? Doeswe automatically publish the text string as a semantics property, which is howText
finds it.onNodeWithText()
onNodeWithText()
finding a view mean that it is also visible with Compose Desktop? I seem to recall with Espresso that a view could exist and not be visible.
You probably want to do something similar with your black square.You might be onto something here. For example if the black square were an image, and there was an API something like
onNodeWithImage()
I can see how that might work. Or if a node has a unique tag, I could look for that tag. But I still have to wrestle with the visibility property, I think. I don't know Compose UI well enough to answer that today.Zach Klippenstein (he/him) [MOD]
02/23/2022, 12:42 AMImage
composable, it gets published as a semantics property, which then lets you search for it in tests. So yes, you're already “using” semantics in a sense even if you don't know it.Zach Klippenstein (he/him) [MOD]
02/23/2022, 12:42 AMpajatopmr
02/23/2022, 5:10 AMcheckIsDisplayed()
have an associated semantic property? And where can I study up on these semantic properties?Zach Klippenstein (he/him) [MOD]
02/23/2022, 3:12 PMonNodeWithText
), or some of the other assertions. The official docs have a section on semantics.