Skip navigation links

Package de.nenick.espressomacchiato.intents

Validation and stubbing of Intents sent out by the application.

See: Description

Package de.nenick.espressomacchiato.intents Description

Validation and stubbing of Intents sent out by the application.

Many apps sent Intents to use third party applications but Espresso does only work in your app scope. A solution could be to use UiAutomator to handle third party Activities. But the preferred way is to stub the third party applications and let them report your configured result.

For Intent stubbing you must use the IntentsTestRule or it will not work. (Necessary dependencies already provided by Espresso Macchiato library)

public class MyTest {
  @Rule
  public IntentsTestRule<MyActivity> activityTestRule = new IntentsTestRule<>(MyActivity.class);
}

For more details about testing with Intents see Espresso documentation.

A registered stub works for multiple requests until your test is done. You can have multiple stubs registered then the best matching one will be used automatically.

See Also:
Ready to use test base for Intent stubbing.
Skip navigation links