3

Consider the following assertions:

class BasicTest {

    @get:Rule
    val composeTestRule = createComposeRule()

    @Test
    fun myTest(): Unit = with(composeTestRule) {
        setContent { App() }
 
        // To check if a single node has a click action:
        onNodeWithText("foo").assertHasClickAction() // OK
        // To check if multiple nodes have a click action:
        onAllNodesWithText("foo").assertAll(hasClickAction()) // OK
        
        // To check if a single node exists:
        onNodeWithText("foo").assertExists() // OK
        // To check if a multiple nodes exists, there is no fitting method??
        onAllNodesWithText("foo").assertAll(exists()) // No exists() or similar method for assertExists()
    }
}

With the result of onAllNodesWithText("foo"), how would I check all the fitting nodes exist?

Fudge Fudge
  • 1,024
  • 1
  • 10
  • 25

0 Answers0