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

AndroidComposeTestRule

class AndroidComposeTestRule<T : ComponentActivity> : ComposeTestRule
kotlin.Any
   ↳ androidx.ui.test.android.AndroidComposeTestRule

Android specific implementation of ComposeTestRule.

Summary

Nested classes
inner

Public constructors
<init>(activityRule: ActivityScenarioRule<T>, disableTransitions: Boolean = false, disableBlinkingCursor: Boolean = true)

Android specific implementation of ComposeTestRule.

Public methods
Statement
apply(base: Statement, description: Description?)

Unit
setContent(composable: () -> Unit)

Properties
ActivityScenarioRule<T>

AnimationClockTestRule

A test rule that allows you to control the animation clock

Density

Current device screen's density.

DisplayMetrics

Public constructors

<init>

AndroidComposeTestRule(
    activityRule: ActivityScenarioRule<T>,
    disableTransitions: Boolean = false,
    disableBlinkingCursor: Boolean = true)

Android specific implementation of ComposeTestRule.

Public methods

apply

fun apply(
    base: Statement,
    description: Description?
): Statement

setContent

fun setContent(composable: () -> Unit): Unit
Exceptions
IllegalStateException if called more than once per test.

Properties

activityRule

val activityRule: ActivityScenarioRule<T>

clockTestRule

val clockTestRule: AnimationClockTestRule

A test rule that allows you to control the animation clock

density

val density: Density

Current device screen's density.

displayMetrics

val displayMetrics: DisplayMetrics