Assert that node exists containing text from two child nodes in Jetpack Compose

Viewed 24

I have a lazyColumn() in compose with each item in the list containing two text view elements. One item has text elements Foo and Bar.

The compose semantics tree has merged these two texts into the parent node so composeRule.onRoot().printToLog() outputs Text = '[Foo, Bar]'.

How can I assert that a node exists with both text elements Foo and Bar?

I have tried the below but get could not find any node that satisfies: ((Text + EditableText contains 'Foo' (ignoreCase: false)) && (Text + EditableText contains 'Bar' (ignoreCase: false))

composeRule.onNode(hasText("Foo") and hasText("Bar"), useUnmergedTree = true).assertExists()
0 Answers
Related