0PricingLogin
Jetpack Compose Academy · Lesson

Assertions & Performing Actions

Verify state and simulate user input.

Find, Then Verify

Finding a node is only half the job. To prove your UI behaves, you add an assertion that states what should be true about that node. ✅

assertIsDisplayed

The most common assertion is assertIsDisplayed. It confirms the node is actually visible to the user, not just present in the tree.

composeTestRule.onNodeWithText("Welcome")
    .assertIsDisplayed()

All lessons in this course

  1. createComposeRule & Finders
  2. Assertions & Performing Actions
  3. Semantics & Test Tags
  4. Testing ViewModels & Flows
← Back to Jetpack Compose Academy