# SubspaceSemanticsNodeInteraction

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.kt+class:androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction) Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)


```
class SubspaceSemanticsNodeInteraction
```

<br />

*** ** * ** ***

Represents a semantics node and the path to fetch it from the subspace semantics tree.

Allows performing assertions or retrieving the underlying semantics node information. An instance of this class can be obtained from `onSubspaceNode` or convenience methods that use a specific filter, such as `onSubspaceNodeWithTag`.

For real usage patterns and explicit semantic properties validation, see the referenced samples.

```kotlin
import androidx.compose.material3.Button
import androidx.compose.material3.Text
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import androidx.compose.ui.unit.dp
import androidx.xr.compose.spatial.Subspace
import androidx.xr.compose.subspace.SpatialPanel
import androidx.xr.compose.subspace.layout.SubspaceModifier
import androidx.xr.compose.subspace.semantics.testTag
import androidx.xr.compose.testing.assertPositionInRootIsEqualTo
import androidx.xr.compose.testing.onSubspaceNode
import androidx.xr.compose.testing.onSubspaceNodeWithTag

var count = 0

composeTestRule.setContent {
    Subspace {
        SpatialPanel(SubspaceModifier.testTag("spatialPanel")) {
            Button(onClick = { count++ }) { Text("Increment") }
        }
    }
}

// Assert subspace node existence, position, and dimensions in the Spatial hierarchy
composeTestRule
    .onSubspaceNodeWithTag("spatialPanel")
    .assertExists()
    .assertPositionInRootIsEqualTo(0.dp, 0.dp, 0.dp)

// Interact with the 2D Compose node nested within the Spatial container
composeTestRule.onNodeWithText("Increment").performClick()

composeTestRule.waitForIdle()

// Verify outcomes
assert(count == 1)
```

```kotlin
import androidx.compose.ui.unit.dp
import androidx.xr.compose.spatial.Subspace
import androidx.xr.compose.subspace.SpatialPanel
import androidx.xr.compose.subspace.layout.SubspaceModifier
import androidx.xr.compose.subspace.layout.height
import androidx.xr.compose.subspace.layout.width
import androidx.xr.compose.subspace.semantics.testTag
import androidx.xr.compose.testing.assertHeightIsEqualTo
import androidx.xr.compose.testing.assertPositionInRootIsEqualTo
import androidx.xr.compose.testing.assertWidthIsEqualTo
import androidx.xr.compose.testing.onSubspaceNode
import androidx.xr.compose.testing.onSubspaceNodeWithTag

composeTestRule.setContent {
    Subspace {
        SpatialPanel(SubspaceModifier.width(100.dp).height(100.dp).testTag("myPanel")) {}
    }
}

// Check existence and exact spatial dimensions in DP using semantic matchers
composeTestRule
    .onSubspaceNodeWithTag("myPanel")
    .assertExists()
    .assertPositionInRootIsEqualTo(0.dp, 0.dp, 0.dp)
    .assertWidthIsEqualTo(100.dp)
    .assertHeightIsEqualTo(100.dp)
```

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#SubspaceSemanticsNodeInteraction(androidx.xr.compose.testing.SubspaceTestContext,androidx.xr.compose.testing.SubspaceSemanticsMatcher)( testContext: https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceTestContext, matcher: https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsMatcher )` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#assertDoesNotExist()()` Asserts that no matching item was found or that the item is no longer in the hierarchy. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#assertExists(kotlin.String)(errorMessageOnFail: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)` Asserts that the component was found and is part of the component tree. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/node/SubspaceSemanticsInfo` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#fetchSemanticsNode(kotlin.String)(errorMessageOnFail: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)` Returns the semantics node captured by this interaction. |

| ### Extension functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertDepthIsAtLeast(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)( expectedMinDepth: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp )` Asserts that the layout of this node has depth that is greater than or equal to `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/package-summary#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertDepthIsAtLeast(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertDepthIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)( expectedDepth: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp )` Asserts that the layout of this node has depth equal to `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/package-summary#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertDepthIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertDepthIsNotEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)( expectedDepth: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp )` Asserts that the layout of this node has depth that is NOT equal to `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/package-summary#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertDepthIsNotEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertHeightIsAtLeast(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)( expectedMinHeight: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp )` Asserts that the layout of this node has height that is greater than or equal to `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/package-summary#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertHeightIsAtLeast(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertHeightIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)( expectedHeight: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp )` Asserts that the layout of this node has height equal to `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/package-summary#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertHeightIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertHeightIsNotEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)( expectedHeight: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp )` Asserts that the layout of this node has height that is NOT equal to `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/package-summary#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertHeightIsNotEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertLeftPositionInRootIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)( expectedLeft: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp )` Asserts that the layout of this node has the left position in the root composable that is equal to the given position. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertPositionInRootIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)( expectedX: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, expectedY: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, expectedZ: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp )` Asserts that the layout of this node has position in the root composable that is equal to the given position. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertPositionIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)( expectedX: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, expectedY: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, expectedZ: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp )` Asserts that the layout of this node has position that is equal to the given position. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertRotationInRootIsEqualTo(androidx.xr.runtime.math.Quaternion,kotlin.Float)( expected: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quaternion, tolerance: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` Asserts that the layout of this node has rotation in the root composable that is equal to the given rotation. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertRotationIsEqualTo(androidx.xr.runtime.math.Quaternion,kotlin.Float)( expected: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quaternion, tolerance: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` Asserts that the layout of this node has rotation that is equal to the given rotation. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertTopPositionInRootIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)( expectedTop: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp )` Asserts that the layout of this node has the top position in the root composable that is equal to the given position. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertWidthIsAtLeast(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)( expectedMinWidth: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp )` Asserts that the layout of this node has width that is greater than or equal to `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/package-summary#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertWidthIsAtLeast(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertWidthIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)( expectedWidth: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp )` Asserts that the layout of this node has width equal to `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/package-summary#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertWidthIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertWidthIsNotEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)( expectedWidth: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp )` Asserts that the layout of this node has width that is NOT equal to `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/package-summary#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertWidthIsNotEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertXPositionInRootIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)( expectedX: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp )` Asserts that the layout of this node has the x position in the root composable that is equal to the given position. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertXPositionIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)( expectedX: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp )` Asserts that the layout of this node has the x position that is equal to the given position. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertYPositionInRootIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)( expectedY: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp )` Asserts that the layout of this node has the y position in the root composable that is equal to the given position. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertYPositionIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)( expectedY: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp )` Asserts that the layout of this node has the y position that is equal to the given position. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertZPositionInRootIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)( expectedZ: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp )` Asserts that the layout of this node has the z position in the root composable that is equal to the given position. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertZPositionIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)( expectedZ: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp )` Asserts that the layout of this node has the z position that is equal to the given position. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).getPosition()()` Returns the position of the node relative to its parent layout node. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).getPositionInRoot()()` Returns the position of the node relative to the root node. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quaternion` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).getRotation()()` Returns the rotation of the node relative to its parent layout node. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quaternion` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).getRotationInRoot()()` Returns the rotation of the node relative to the root node. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/unit/DpVolumeSize` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction.https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).getSize()()` Returns the size of the node. |

## Public constructors

### SubspaceSemanticsNodeInteraction

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
SubspaceSemanticsNodeInteraction(
    testContext: SubspaceTestContext,
    matcher: SubspaceSemanticsMatcher
)
```

## Public functions

### assertDoesNotExist

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
fun assertDoesNotExist(): Unit
```

Asserts that no matching item was found or that the item is no longer in the hierarchy.

This operation synchronizes with the UI and fetches all nodes to ensure it has the latest data. It is useful for verifying that an element has been correctly removed or was never present.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if one or more matching nodes are found. |

### assertExists

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
@CanIgnoreReturnValue
fun assertExists(errorMessageOnFail: String? = null): SubspaceSemanticsNodeInteraction
```

Asserts that the component was found and is part of the component tree.

This operation synchronizes with the UI and fetches all nodes to ensure it has the latest data. Note that if you are already calling `fetchSemanticsNode`, calling this method is redundant and introduces unnecessary overhead.

| Parameters |
|---|---|
| `errorMessageOnFail: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html? = null` | the prefix to be added to the error message if the assertion fails. Typically used by operations that rely on this assertion. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/SubspaceSemanticsNodeInteraction` | this interaction object to allow chaining of further assertions. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if zero or multiple matching nodes are found. |

### fetchSemanticsNode

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
fun fetchSemanticsNode(errorMessageOnFail: String? = null): SubspaceSemanticsInfo
```

Returns the semantics node captured by this interaction.

This operation synchronizes with the UI to ensure the latest semantics tree data is fetched. Since synchronization introduces performance overhead, it is recommended to cache the result if accessed multiple times within a single atomic operation.

| Parameters |
|---|---|
| `errorMessageOnFail: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html? = null` | the prefix to be added to the error message if the fetch operation fails. Typically used by higher-level operations that rely on this fetch. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/node/SubspaceSemanticsInfo` | the underlying `SubspaceSemanticsInfo` corresponding to the matched node. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if zero or multiple matching nodes are found. |

## Extension functions

### SubspaceSemanticsNodeInteraction.assertDepthIsAtLeast

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:assertDepthIsAtLeast)

```
@CanIgnoreReturnValue
fun SubspaceSemanticsNodeInteraction.assertDepthIsAtLeast(
    expectedMinDepth: Dp,
    tolerance: Dp = Dp(.5f)
): SubspaceSemanticsNodeInteraction
```

Asserts that the layout of this node has depth that is greater than or equal to `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/package-summary#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertDepthIsAtLeast(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`.

| Parameters |
|---|---|
| `expectedMinDepth: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The minimum depth to assert. |
| `tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = Dp(.5f)` | The tolerance within which the values should be treated as equal. Defaults to 0.5.dp. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if comparison fails. |

### SubspaceSemanticsNodeInteraction.assertDepthIsEqualTo

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:assertDepthIsEqualTo)

```
@CanIgnoreReturnValue
fun SubspaceSemanticsNodeInteraction.assertDepthIsEqualTo(
    expectedDepth: Dp,
    tolerance: Dp = Dp(.5f)
): SubspaceSemanticsNodeInteraction
```

Asserts that the layout of this node has depth equal to `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/package-summary#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertDepthIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`.

| Parameters |
|---|---|
| `expectedDepth: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The depth to assert. |
| `tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = Dp(.5f)` | The tolerance within which the values should be treated as equal. Defaults to 0.5.dp. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if comparison fails. |

### SubspaceSemanticsNodeInteraction.assertDepthIsNotEqualTo

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:assertDepthIsNotEqualTo)

```
@CanIgnoreReturnValue
fun SubspaceSemanticsNodeInteraction.assertDepthIsNotEqualTo(
    expectedDepth: Dp,
    tolerance: Dp = Dp(.5f)
): SubspaceSemanticsNodeInteraction
```

Asserts that the layout of this node has depth that is NOT equal to `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/package-summary#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertDepthIsNotEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`.

| Parameters |
|---|---|
| `expectedDepth: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The depth to assert. |
| `tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = Dp(.5f)` | The tolerance within which the values should be treated as equal. Defaults to 0.5.dp. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if comparison fails. |

### SubspaceSemanticsNodeInteraction.assertHeightIsAtLeast

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:assertHeightIsAtLeast)

```
@CanIgnoreReturnValue
fun SubspaceSemanticsNodeInteraction.assertHeightIsAtLeast(
    expectedMinHeight: Dp,
    tolerance: Dp = Dp(.5f)
): SubspaceSemanticsNodeInteraction
```

Asserts that the layout of this node has height that is greater than or equal to `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/package-summary#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertHeightIsAtLeast(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`.

| Parameters |
|---|---|
| `expectedMinHeight: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The minimum height to assert. |
| `tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = Dp(.5f)` | The tolerance within which the values should be treated as equal. Defaults to 0.5.dp. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if comparison fails. |

### SubspaceSemanticsNodeInteraction.assertHeightIsEqualTo

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:assertHeightIsEqualTo)

```
@CanIgnoreReturnValue
fun SubspaceSemanticsNodeInteraction.assertHeightIsEqualTo(
    expectedHeight: Dp,
    tolerance: Dp = Dp(.5f)
): SubspaceSemanticsNodeInteraction
```

Asserts that the layout of this node has height equal to `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/package-summary#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertHeightIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`.

```kotlin
import androidx.compose.ui.unit.dp
import androidx.xr.compose.spatial.Subspace
import androidx.xr.compose.subspace.SpatialPanel
import androidx.xr.compose.subspace.layout.SubspaceModifier
import androidx.xr.compose.subspace.layout.height
import androidx.xr.compose.subspace.layout.width
import androidx.xr.compose.subspace.semantics.testTag
import androidx.xr.compose.testing.assertHeightIsEqualTo
import androidx.xr.compose.testing.assertPositionInRootIsEqualTo
import androidx.xr.compose.testing.assertWidthIsEqualTo
import androidx.xr.compose.testing.onSubspaceNode
import androidx.xr.compose.testing.onSubspaceNodeWithTag

composeTestRule.setContent {
    Subspace {
        SpatialPanel(SubspaceModifier.width(100.dp).height(100.dp).testTag("myPanel")) {}
    }
}

// Check existence and exact spatial dimensions in DP using semantic matchers
composeTestRule
    .onSubspaceNodeWithTag("myPanel")
    .assertExists()
    .assertPositionInRootIsEqualTo(0.dp, 0.dp, 0.dp)
    .assertWidthIsEqualTo(100.dp)
    .assertHeightIsEqualTo(100.dp)
```

| Parameters |
|---|---|
| `expectedHeight: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The height to assert. |
| `tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = Dp(.5f)` | The tolerance within which the values should be treated as equal. Defaults to 0.5.dp. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if comparison fails. |

### SubspaceSemanticsNodeInteraction.assertHeightIsNotEqualTo

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:assertHeightIsNotEqualTo)

```
@CanIgnoreReturnValue
fun SubspaceSemanticsNodeInteraction.assertHeightIsNotEqualTo(
    expectedHeight: Dp,
    tolerance: Dp = Dp(.5f)
): SubspaceSemanticsNodeInteraction
```

Asserts that the layout of this node has height that is NOT equal to `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/package-summary#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertHeightIsNotEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`.

| Parameters |
|---|---|
| `expectedHeight: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The height to assert. |
| `tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = Dp(.5f)` | The tolerance within which the values should be treated as equal. Defaults to 0.5.dp. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if comparison fails. |

### SubspaceSemanticsNodeInteraction.assertLeftPositionInRootIsEqualTo

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:assertLeftPositionInRootIsEqualTo)

```
@CanIgnoreReturnValue
fun SubspaceSemanticsNodeInteraction.assertLeftPositionInRootIsEqualTo(
    expectedLeft: Dp,
    tolerance: Dp = Dp(.5f)
): SubspaceSemanticsNodeInteraction
```

Asserts that the layout of this node has the left position in the root composable that is equal to the given position.

In Subspace, the x position (e.g. `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/package-summary#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertXPositionInRootIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`) refers to the center of the node along the X-axis. The left position refers to the position of the left edge (minimum X boundary) of the node's bounding volume, calculated as (center X - width / 2).

| Parameters |
|---|---|
| `expectedLeft: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The left position to assert. |
| `tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = Dp(.5f)` | The tolerance within which the values should be treated as equal. Defaults to 0.5.dp. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if comparison fails. |

### SubspaceSemanticsNodeInteraction.assertPositionInRootIsEqualTo

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:assertPositionInRootIsEqualTo)

```
@CanIgnoreReturnValue
fun SubspaceSemanticsNodeInteraction.assertPositionInRootIsEqualTo(
    expectedX: Dp,
    expectedY: Dp,
    expectedZ: Dp,
    tolerance: Dp = Dp(.5f)
): SubspaceSemanticsNodeInteraction
```

Asserts that the layout of this node has position in the root composable that is equal to the given position.

| Parameters |
|---|---|
| `expectedX: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The x position to assert. |
| `expectedY: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The y position to assert. |
| `expectedZ: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The z position to assert. |
| `tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = Dp(.5f)` | The tolerance within which the values should be treated as equal. Defaults to 0.5.dp. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if comparison fails. |

### SubspaceSemanticsNodeInteraction.assertPositionIsEqualTo

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:assertPositionIsEqualTo)

```
@CanIgnoreReturnValue
fun SubspaceSemanticsNodeInteraction.assertPositionIsEqualTo(
    expectedX: Dp,
    expectedY: Dp,
    expectedZ: Dp,
    tolerance: Dp = Dp(.5f)
): SubspaceSemanticsNodeInteraction
```

Asserts that the layout of this node has position that is equal to the given position.

| Parameters |
|---|---|
| `expectedX: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The x position to assert. |
| `expectedY: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The y position to assert. |
| `expectedZ: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The z position to assert. |
| `tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = Dp(.5f)` | The tolerance within which the values should be treated as equal. Defaults to 0.5.dp. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if comparison fails. |

### SubspaceSemanticsNodeInteraction.assertRotationInRootIsEqualTo

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:assertRotationInRootIsEqualTo)

```
@CanIgnoreReturnValue
fun SubspaceSemanticsNodeInteraction.assertRotationInRootIsEqualTo(
    expected: Quaternion,
    tolerance: Float = 0.01f
): SubspaceSemanticsNodeInteraction
```

Asserts that the layout of this node has rotation in the root composable that is equal to the given rotation.

This assertion uses a tolerance to account for floating-point inaccuracies.

| Parameters |
|---|---|
| `expected: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quaternion` | The expected rotation in the root space to assert. |
| `tolerance: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 0.01f` | The maximum allowed angular distance in degrees between the orientations. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if comparison fails. |

### SubspaceSemanticsNodeInteraction.assertRotationIsEqualTo

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:assertRotationIsEqualTo)

```
@CanIgnoreReturnValue
fun SubspaceSemanticsNodeInteraction.assertRotationIsEqualTo(
    expected: Quaternion,
    tolerance: Float = 0.01f
): SubspaceSemanticsNodeInteraction
```

Asserts that the layout of this node has rotation that is equal to the given rotation.

This assertion uses a tolerance to account for floating-point inaccuracies.

| Parameters |
|---|---|
| `expected: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quaternion` | The rotation to assert. |
| `tolerance: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 0.01f` | The maximum allowed angular distance in degrees between the orientations. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if comparison fails. |

### SubspaceSemanticsNodeInteraction.assertTopPositionInRootIsEqualTo

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:assertTopPositionInRootIsEqualTo)

```
@CanIgnoreReturnValue
fun SubspaceSemanticsNodeInteraction.assertTopPositionInRootIsEqualTo(
    expectedTop: Dp,
    tolerance: Dp = Dp(.5f)
): SubspaceSemanticsNodeInteraction
```

Asserts that the layout of this node has the top position in the root composable that is equal to the given position.

In Subspace, the y position (e.g. `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/package-summary#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertYPositionInRootIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`) refers to the center of the node along the Y-axis. The top position refers to the position of the top edge (maximum Y boundary) of the node's bounding volume, calculated as (center Y + height / 2).

| Parameters |
|---|---|
| `expectedTop: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The top position to assert. |
| `tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = Dp(.5f)` | The tolerance within which the values should be treated as equal. Defaults to 0.5.dp. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if comparison fails. |

### SubspaceSemanticsNodeInteraction.assertWidthIsAtLeast

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:assertWidthIsAtLeast)

```
@CanIgnoreReturnValue
fun SubspaceSemanticsNodeInteraction.assertWidthIsAtLeast(
    expectedMinWidth: Dp,
    tolerance: Dp = Dp(.5f)
): SubspaceSemanticsNodeInteraction
```

Asserts that the layout of this node has width that is greater than or equal to `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/package-summary#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertWidthIsAtLeast(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`.

| Parameters |
|---|---|
| `expectedMinWidth: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The minimum width to assert. |
| `tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = Dp(.5f)` | The tolerance within which the values should be treated as equal. Defaults to 0.5.dp. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if comparison fails. |

### SubspaceSemanticsNodeInteraction.assertWidthIsEqualTo

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:assertWidthIsEqualTo)

```
@CanIgnoreReturnValue
fun SubspaceSemanticsNodeInteraction.assertWidthIsEqualTo(
    expectedWidth: Dp,
    tolerance: Dp = Dp(.5f)
): SubspaceSemanticsNodeInteraction
```

Asserts that the layout of this node has width equal to `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/package-summary#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertWidthIsEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`.

```kotlin
import androidx.compose.ui.unit.dp
import androidx.xr.compose.spatial.Subspace
import androidx.xr.compose.subspace.SpatialPanel
import androidx.xr.compose.subspace.layout.SubspaceModifier
import androidx.xr.compose.subspace.layout.height
import androidx.xr.compose.subspace.layout.width
import androidx.xr.compose.subspace.semantics.testTag
import androidx.xr.compose.testing.assertHeightIsEqualTo
import androidx.xr.compose.testing.assertPositionInRootIsEqualTo
import androidx.xr.compose.testing.assertWidthIsEqualTo
import androidx.xr.compose.testing.onSubspaceNode
import androidx.xr.compose.testing.onSubspaceNodeWithTag

composeTestRule.setContent {
    Subspace {
        SpatialPanel(SubspaceModifier.width(100.dp).height(100.dp).testTag("myPanel")) {}
    }
}

// Check existence and exact spatial dimensions in DP using semantic matchers
composeTestRule
    .onSubspaceNodeWithTag("myPanel")
    .assertExists()
    .assertPositionInRootIsEqualTo(0.dp, 0.dp, 0.dp)
    .assertWidthIsEqualTo(100.dp)
    .assertHeightIsEqualTo(100.dp)
```

| Parameters |
|---|---|
| `expectedWidth: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The width to assert. |
| `tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = Dp(.5f)` | The tolerance within which the values should be treated as equal. Defaults to 0.5.dp. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if comparison fails. |

### SubspaceSemanticsNodeInteraction.assertWidthIsNotEqualTo

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:assertWidthIsNotEqualTo)

```
@CanIgnoreReturnValue
fun SubspaceSemanticsNodeInteraction.assertWidthIsNotEqualTo(
    expectedWidth: Dp,
    tolerance: Dp = Dp(.5f)
): SubspaceSemanticsNodeInteraction
```

Asserts that the layout of this node has width that is NOT equal to `https://developer.android.com/reference/kotlin/androidx/xr/compose/testing/package-summary#(androidx.xr.compose.testing.SubspaceSemanticsNodeInteraction).assertWidthIsNotEqualTo(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)`.

| Parameters |
|---|---|
| `expectedWidth: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The width to assert. |
| `tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = Dp(.5f)` | The tolerance within which the values should be treated as equal. Defaults to 0.5.dp. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if comparison fails. |

### SubspaceSemanticsNodeInteraction.assertXPositionInRootIsEqualTo

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:assertXPositionInRootIsEqualTo)

```
@CanIgnoreReturnValue
fun SubspaceSemanticsNodeInteraction.assertXPositionInRootIsEqualTo(
    expectedX: Dp,
    tolerance: Dp = Dp(.5f)
): SubspaceSemanticsNodeInteraction
```

Asserts that the layout of this node has the x position in the root composable that is equal to the given position.

| Parameters |
|---|---|
| `expectedX: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The x position to assert. |
| `tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = Dp(.5f)` | The tolerance within which the values should be treated as equal. Defaults to 0.5.dp. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if comparison fails. |

### SubspaceSemanticsNodeInteraction.assertXPositionIsEqualTo

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:assertXPositionIsEqualTo)

```
@CanIgnoreReturnValue
fun SubspaceSemanticsNodeInteraction.assertXPositionIsEqualTo(
    expectedX: Dp,
    tolerance: Dp = Dp(.5f)
): SubspaceSemanticsNodeInteraction
```

Asserts that the layout of this node has the x position that is equal to the given position.

| Parameters |
|---|---|
| `expectedX: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The x position to assert. |
| `tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = Dp(.5f)` | The tolerance within which the values should be treated as equal. Defaults to 0.5.dp. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if comparison fails. |

### SubspaceSemanticsNodeInteraction.assertYPositionInRootIsEqualTo

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:assertYPositionInRootIsEqualTo)

```
@CanIgnoreReturnValue
fun SubspaceSemanticsNodeInteraction.assertYPositionInRootIsEqualTo(
    expectedY: Dp,
    tolerance: Dp = Dp(.5f)
): SubspaceSemanticsNodeInteraction
```

Asserts that the layout of this node has the y position in the root composable that is equal to the given position.

| Parameters |
|---|---|
| `expectedY: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The y position to assert. |
| `tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = Dp(.5f)` | The tolerance within which the values should be treated as equal. Defaults to 0.5.dp. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if comparison fails. |

### SubspaceSemanticsNodeInteraction.assertYPositionIsEqualTo

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:assertYPositionIsEqualTo)

```
@CanIgnoreReturnValue
fun SubspaceSemanticsNodeInteraction.assertYPositionIsEqualTo(
    expectedY: Dp,
    tolerance: Dp = Dp(.5f)
): SubspaceSemanticsNodeInteraction
```

Asserts that the layout of this node has the y position that is equal to the given position.

| Parameters |
|---|---|
| `expectedY: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The y position to assert. |
| `tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = Dp(.5f)` | The tolerance within which the values should be treated as equal. Defaults to 0.5.dp. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if comparison fails. |

### SubspaceSemanticsNodeInteraction.assertZPositionInRootIsEqualTo

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:assertZPositionInRootIsEqualTo)

```
@CanIgnoreReturnValue
fun SubspaceSemanticsNodeInteraction.assertZPositionInRootIsEqualTo(
    expectedZ: Dp,
    tolerance: Dp = Dp(.5f)
): SubspaceSemanticsNodeInteraction
```

Asserts that the layout of this node has the z position in the root composable that is equal to the given position.

| Parameters |
|---|---|
| `expectedZ: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The z position to assert. |
| `tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = Dp(.5f)` | The tolerance within which the values should be treated as equal. Defaults to 0.5.dp. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if comparison fails. |

### SubspaceSemanticsNodeInteraction.assertZPositionIsEqualTo

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:assertZPositionIsEqualTo)

```
@CanIgnoreReturnValue
fun SubspaceSemanticsNodeInteraction.assertZPositionIsEqualTo(
    expectedZ: Dp,
    tolerance: Dp = Dp(.5f)
): SubspaceSemanticsNodeInteraction
```

Asserts that the layout of this node has the z position that is equal to the given position.

| Parameters |
|---|---|
| `expectedZ: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The z position to assert. |
| `tolerance: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = Dp(.5f)` | The tolerance within which the values should be treated as equal. Defaults to 0.5.dp. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if comparison fails. |

### SubspaceSemanticsNodeInteraction.getPosition

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:getPosition)

```
fun SubspaceSemanticsNodeInteraction.getPosition(): Vector3
```

Returns the position of the node relative to its parent layout node.

Additional assertions with custom tolerances may be performed on the individual values.

### SubspaceSemanticsNodeInteraction.getPositionInRoot

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:getPositionInRoot)

```
fun SubspaceSemanticsNodeInteraction.getPositionInRoot(): Vector3
```

Returns the position of the node relative to the root node.

Additional assertions with custom tolerances may be performed on the individual values.

### SubspaceSemanticsNodeInteraction.getRotation

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:getRotation)

```
fun SubspaceSemanticsNodeInteraction.getRotation(): Quaternion
```

Returns the rotation of the node relative to its parent layout node.

Additional assertions with custom tolerances may be performed on the individual values.

### SubspaceSemanticsNodeInteraction.getRotationInRoot

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:getRotationInRoot)

```
fun SubspaceSemanticsNodeInteraction.getRotationInRoot(): Quaternion
```

Returns the rotation of the node relative to the root node.

Additional assertions with custom tolerances may be performed on the individual values.

### SubspaceSemanticsNodeInteraction.getSize

Artifact: [androidx.xr.compose:compose-testing](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/testing/SubspaceAssertions.kt+function:getSize)

```
fun SubspaceSemanticsNodeInteraction.getSize(): DpVolumeSize
```

Returns the size of the node.

Additional assertions with custom tolerances may be performed on the individual values.