Function

assertLeftPositionInRootIsEqualTo

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

assertLeftPositionInRootIsEqualTo

Source set: Common
@Deprecated(
    message = "Use assertLeftPositionInRootIsEqualTo with tolerance",
    level = DeprecationLevel.HIDDEN,
)
public fun SemanticsNodeInteraction.assertLeftPositionInRootIsEqualTo(
    expectedLeft: Dp
): SemanticsNodeInteraction

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

Parameters

expectedLeft The left (x) position to assert.

Throws: AssertionError

if comparison fails.

assertLeftPositionInRootIsEqualTo

Source set: Common
public fun SemanticsNodeInteraction.assertLeftPositionInRootIsEqualTo(
    expectedLeft: Dp,
    tolerance: Dp = Dp.Unspecified,
): SemanticsNodeInteraction

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

Parameters

expectedLeft The left (x) position to assert.
tolerance The tolerance within which the values should be treated as equal. Defaults to the tolerance configured in ComposeUiTestConfig, or 0.5.dp if unspecified.

Throws: AssertionError

if comparison fails.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: