Created
December 29, 2023 14:34
-
-
Save ngallazzi/faa195ac4b40cd743a8dfd19e916b32f to your computer and use it in GitHub Desktop.
compose_ui_finders
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyLayoutTest { | |
@get:Rule | |
val composeTestRule = createAndroidComposeRule<ComponentActivity>() | |
@Test | |
fun testGreetingButtonClick() { | |
// Start the app | |
composeTestRule.setContent { | |
MyLayout() | |
} | |
// Finds a node with "Greeting Button" as content description | |
composeTestRule.onNodeWithContentDescription( | |
"Greeting Button" | |
).performClick() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment