SemanticsNodeInteractionsProvider
interface SemanticsNodeInteractionsProvider
androidx.compose.ui.test.SemanticsNodeInteractionsProvider |
Provides the main entry point into testing.
Typically implemented by a test rule.
Summary
Public methods | |
---|---|
abstract SemanticsNodeInteractionCollection |
onAllNodes(matcher: SemanticsMatcher, useUnmergedTree: Boolean = false) Finds all semantics nodes that match the given condition. |
abstract SemanticsNodeInteraction |
onNode(matcher: SemanticsMatcher, useUnmergedTree: Boolean = false) Finds a semantics node that matches the given condition. |
Extension functions | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From androidx.compose.ui.test
|
Public methods
onAllNodes
abstract fun onAllNodes(
matcher: SemanticsMatcher,
useUnmergedTree: Boolean = false
): SemanticsNodeInteractionCollection
Finds all semantics nodes that match the given condition.
If you are working with elements that are not supposed to occur multiple times use onNode instead.
For usage patterns and semantics concepts see SemanticsNodeInteraction
Parameters | |
---|---|
useUnmergedTree: Boolean = false | Find within merged composables like Buttons. |
See Also
onNode
abstract fun onNode(
matcher: SemanticsMatcher,
useUnmergedTree: Boolean = false
): SemanticsNodeInteraction
Finds a semantics node that matches the given condition.
Any subsequent operation on its result will expect exactly one element found (unless SemanticsNodeInteraction.assertDoesNotExist is used) and will throw AssertionError if none or more than one element is found.
For usage patterns and semantics concepts see SemanticsNodeInteraction
Parameters | |
---|---|
useUnmergedTree: Boolean = false | Find within merged composables like Buttons. |
See Also