The Developer Preview for Android 11 is now available; test it out and share your feedback.

AndroidComposeTestCaseSetup

class AndroidComposeTestCaseSetup : ComposeTestCaseSetup
kotlin.Any
   ↳ androidx.ui.test.android.AndroidComposeTestCaseSetup

Summary

Public constructors

<init>(testRule: ComposeTestRule, testCase: ComposeTestCase, activity: Activity)

Public methods

Unit

Takes the content provided via ComposeTestRule#setContent and runs the given test instruction.

Inherited extension functions

From androidx.compose
operator T

IMPORTANT: This global operator is TEMPORARY, and should be removed whenever an answer for contextual composers is reached.

Public constructors

<init>

AndroidComposeTestCaseSetup(
    testRule: ComposeTestRule,
    testCase: ComposeTestCase,
    activity: Activity)

Public methods

performTestWithEventsControl

fun performTestWithEventsControl(block: ComposeExecutionControl.() -> Unit): Unit

Takes the content provided via ComposeTestRule#setContent and runs the given test instruction. The test is executed on the main thread and prevents interference from Activity so the frames can be controlled manually. See ComposeExecutionControl for available methods.