-
Notifications
You must be signed in to change notification settings - Fork 0
Important information on compose testing.
Devrath edited this page Mar 4, 2024
·
5 revisions
- We use semantics in compose to interact with the UI.
- A UI can be anything from a UI ranging from a
piece
to an entirescreen
. So it can be a small composable or a collection of composables. - How much semantics is exposed by the developer depends on how much testing needs to be done.
- Finders: Select one or multiple nodes.
- Assertions: Check if the nodes contain certain properties.
-
Actions: Now act on the selected nodes such as
click action
, andgestures
.
OnNodeWithText
OnNodeWithTag
OnNodeWithContentDescription
performClick()
performSemanticsAction(key)
performKeyPress(keyEvent)
performGesture { swipeLeft() }
* composeTestRule.waitUntil(timeoutMs) { condition }
* composeTestRule.waitUntilAtLeastOneExists(matcher, timeoutMs)
* composeTestRule.waitUntilDoesNotExist(matcher, timeoutMs)
* composeTestRule.waitUntilExactlyOneExists(matcher, timeoutMs)
* composeTestRule.waitUntilNodeCount(matcher, count, timeoutMs)