Google is committed to advancing racial equity for Black communities. See how.

androidx.compose.ui.test

Interfaces

IdlingResource

Represents a resource of an application under test which can cause asynchronous background work to happen during test execution (e.

SemanticsNodeInteractionsProvider

Provides the main entry point into testing.

TestAnimationClock

Interface for animation clocks that can report their idleness and can switch between ticking automatically (e.

TestOwner

Provides necessary services to facilitate testing.

Classes

GestureScope

The receiver scope for injecting gestures on the semanticsNode identified by the corresponding SemanticsNodeInteraction.

SelectionResult

Result of SemanticsSelector projection.

SemanticsMatcher

Wrapper for semantics matcher lambdas that allows to build string explaining to the developer what conditions were being tested.

SemanticsNodeInteraction

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

SemanticsNodeInteractionCollection

Represents a collection of semantics nodes and the path to fetch them from the semantics tree.

SemanticsSelector

Projects the given set of nodes to a new set of nodes.

TestContext

TestMonotonicFrameClock

A MonotonicFrameClock with a time source controlled by a kotlinx-coroutines-test DelayController.

Annotations

ExperimentalTestApi

ExperimentalTesting

InternalTestApi

InternalTestingApi

Top-level functions summary

TestMonotonicFrameClock
TestMonotonicFrameClock(coroutineScope: CoroutineScope, frameDelayNanos: Long = DefaultFrameDelay)

Construct a TestMonotonicFrameClock for coroutineScope, obtaining the DelayController from the scope's context.

TestContext

SemanticsMatcher

Returns whether the node has at least one ancestor that satisfies the given matcher.

SemanticsMatcher

Returns whether the node has at least one child that satisfies the given matcher.

SemanticsMatcher

Returns whether the node has at least one descendant that satisfies the given matcher.

SemanticsMatcher

Returns whether the node has at least one sibling that satisfies the given matcher.

SemanticsMatcher

Return whether the node has a semantics click action defined.

SemanticsMatcher
hasContentDescription(label: String, ignoreCase: Boolean = false)

Returns whether the node's label matches exactly to the given text.

SemanticsMatcher
hasImeAction(actionType: ImeAction)

Returns whether the node defines the given IME action.

SemanticsMatcher

Return whether the node supports input methods.

SemanticsMatcher

Return whether the node has no semantics click action defined.

SemanticsMatcher

Return whether the node has no semantics scrollable action defined.

SemanticsMatcher

Returns whether the node's parent satisfies the given matcher.

SemanticsMatcher

Returns whether the node's range info matches exactly to the given accessibility range info.

SemanticsMatcher

Return whether the node has a semantics scrollable action defined.

SemanticsMatcher

Returns whether the node defines semantics action to set text to it.

SemanticsMatcher
hasSubstring(substring: String, ignoreCase: Boolean = false)

Returns whether the node's text contains the given substring.

SemanticsMatcher
hasTestTag(testTag: String)

Returns whether the node is annotated by the given test tag.

SemanticsMatcher
hasText(text: String, ignoreCase: Boolean = false)

Returns whether the node's text matches exactly to the given text.

SemanticsMatcher
hasValue(value: String)

Returns whether the node's value matches exactly to the given accessibility value.

SemanticsMatcher

Returns whether the node is a dialog.

SemanticsMatcher

Returns whether the node is enabled.

SemanticsMatcher

Return whether the node is able to receive focus

SemanticsMatcher

Returns whether the node is focused.

SemanticsMatcher

Returns whether the node is hidden.

SemanticsMatcher

Verifies that the node is in a mutually exclusive group.

SemanticsMatcher

Returns whether the node is not enabled.

SemanticsMatcher

Return whether the node is not able to receive focus.

SemanticsMatcher

Returns whether the node is not focused.

SemanticsMatcher

Returns whether the node is not hidden.

SemanticsMatcher

Returns whether the node is not selected.

SemanticsMatcher

Returns whether the node is not toggled.

SemanticsMatcher

Returns whether the node is toggled.

SemanticsMatcher

Returns whether the node is a popup.

SemanticsMatcher

Return whether the node is the root semantics node.

SemanticsMatcher

Return whether the node is selectable.

SemanticsMatcher

Returns whether the node is selected.

SemanticsMatcher

Return whether the node is checkable.

MonotonicFrameAnimationClock

Creates a MonotonicFrameAnimationClock from the given clock.

MonotonicFrameAnimationClock

Creates a MonotonicFrameAnimationClock from the given coroutineContext's clock.

Unit
runBlockingWithManualClock(compatibleWithManualAnimationClock: Boolean = false, block: suspend CoroutineScope.(clock: ManualFrameClock) -> R)

Runs a new coroutine and blocks the current thread interruptibly until it completes, passing a new ManualFrameClock to the code block.

Extension functions summary

For android.view.View
ImageBitmap

Captures the underlying view's surface into bitmap.

For SemanticsNodeInteraction
SemanticsNodeInteraction
SemanticsNodeInteraction.assert(matcher: SemanticsMatcher, messagePrefixOnError: () -> String = null)

Asserts that the provided matcher is satisfied for this node.

SemanticsNodeInteraction

Asserts that the current semantics node has a click action.

SemanticsNodeInteraction

Asserts that the current semantics node has doesn't have a click action.

SemanticsNodeInteraction

Asserts that the layout of this node has height that is greater ot equal to expectedMinHeight.

SemanticsNodeInteraction

Asserts that the layout of this node has height equal to expectedHeight.

SemanticsNodeInteraction

Asserts that the current semantics node is displayed on screen.

SemanticsNodeInteraction

Asserts that the current semantics node is enabled.

SemanticsNodeInteraction

Asserts that the current semantics node has a focus.

SemanticsNodeInteraction

Asserts that the current semantics node has hidden property set to true.

SemanticsNodeInteraction

Asserts the semantics node is in a mutually exclusive group.

SemanticsNodeInteraction

Asserts that the current semantics node is not displayed on screen.

SemanticsNodeInteraction

Asserts that the current semantics node is not enabled.

SemanticsNodeInteraction

Asserts that the current semantics node does not have a focus.

SemanticsNodeInteraction

Asserts that the current semantics node has hidden property set to false.

SemanticsNodeInteraction

Asserts that the current semantics node is not selected.