{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

IntentsTestRule

class IntentsTestRule<T : Activity?> : ActivityTestRule

kotlin.Any
   ↳ androidx.test.rule.ActivityTestRule
     ↳ androidx.test.espresso.intent.rule.IntentsTestRule

This rule makes it easy to use Espresso-Intents APIs in functional UI tests. This class is an extension of ActivityTestRule, which initializes Espresso-Intents before each test annotated with Test and releases Espresso-Intents after each test run. The Activity will be terminated after each test and this rule can be used in the same way as ActivityTestRule.

Espresso-Intents APIs can be used in two ways:

Parameters
<T : Activity?>

The activity to test

Summary

Public constructors

IntentsTestRule(activityClass: Class<T!>!)
IntentsTestRule(activityClass: Class<T!>!, initialTouchMode: Boolean)
IntentsTestRule(
    activityClass: Class<T!>!,
    initialTouchMode: Boolean,
    launchActivity: Boolean
)

Protected functions

Unit
Unit

Inherited functions

From class androidx.test.rule.ActivityTestRule

Inherited properties

From class androidx.test.rule.ActivityTestRule

Public constructors

IntentsTestRule

IntentsTestRule(activityClass: Class<T!>!)

IntentsTestRule

IntentsTestRule(activityClass: Class<T!>!, initialTouchMode: Boolean)

IntentsTestRule

IntentsTestRule(
    activityClass: Class<T!>!,
    initialTouchMode: Boolean,
    launchActivity: Boolean
)

Protected functions

afterActivityFinished

protected fun afterActivityFinished(): Unit

afterActivityLaunched

protected fun afterActivityLaunched(): Unit