androidx.test.ext.junit.rules


Classes

ActivityScenarioRule

ActivityScenarioRule launches a given activity before the test starts and closes after the test.

AppComponentFactoryRule

JUnit Rule that let you define a AppComponentFactory before the tests starts and clean-up the factory after the test.

DeleteFilesRule

Deletes files recursively in Android storage directories after each test.

Top-level functions summary

inline ActivityScenarioRule<A>
<A : Activity> activityScenarioRule(intent: Intent?, activityOptions: Bundle?)

Constructs an ActivityScenarioRule of a given class.

Top-level functions

activityScenarioRule

inline fun <A : Activity> activityScenarioRule(
    intent: Intent? = null,
    activityOptions: Bundle? = null
): ActivityScenarioRule<A>

Constructs an ActivityScenarioRule of a given class.

Parameters
intent: Intent? = null

an intent to start activity or null to use the default one

activityOptions: Bundle? = null

an activity options bundle to be passed along with the intent to start activity

Returns
ActivityScenarioRule<A>

ActivityScenarioRule which you can use to access to ActivityScenario from your tests