Compose Unstyled 2.0 is out! Check the official announcement blog ->
Function

onSubspaceNode

Finds a semantics node in the Subspace hierarchy that matches the given condition.

onSubspaceNode

Source set: Android
public fun AndroidComposeTestRule<*, *>.onSubspaceNode(
    matcher: SubspaceSemanticsMatcher
): SubspaceSemanticsNodeInteraction

Finds a semantics node in the Subspace hierarchy that matches the given condition.

This function only locates nodes within the Subspace hierarchy and does not include nodes from standard 2D compose contexts. For example, it targets SpatialPanel, SpatialRow, or SpatialColumn nodes but not standard Row, Column, or Text nodes. For locating 2D nodes, use AndroidComposeTestRule.onNode.

Any subsequent operation on the returned interaction expects exactly one element to be found (unless SubspaceSemanticsNodeInteraction.assertDoesNotExist is used) and throws an AssertionError if zero or multiple elements are found.

Parameters

matcher the SubspaceSemanticsMatcher used to identify the matching semantics node.

Returns

the SubspaceSemanticsNodeInteraction for the matched node.

Last updated: