mattinger
05/07/2025, 6:51 PMwithText
do not work because we're not extending TextView. I can write explicit matchers on properties of that wrapper, but i'd like to be able to use the root view and execute any composed based matcher on that. Anyone have any idea if this is possible?
Something like:
onView(
allOf(
withId(R.id.button),
withComposeText(buttonText)
)
)
And someone internally look at the compose tree for that view and execute the text assertion there.mattinger
05/07/2025, 7:56 PMonView(withId(R.id.button)).check(isDisplayed())
composeTestRule.onNodeWithTag("button").assertIsDisplayed()
but it's not really ensuring they're the same element. Honestly, for now i think i'm going to write some custom matchers. All the properties are controlled via attributes on the subclass of AbstractComposeView, so i can write matchers for those attributes that operate only on that subclass. Similar to what withText does for TextView.mattinger
05/07/2025, 7:56 PMJonathan
05/07/2025, 9:01 PMmattinger
05/07/2025, 10:34 PMmattinger
05/07/2025, 10:36 PMephemient
05/07/2025, 10:36 PMmattinger
05/07/2025, 10:37 PMmattinger
05/07/2025, 10:37 PM