Espresso

Use Espresso to write concise, beautiful, and reliable Android UI tests like this:

@Test
public void greeterSaysHello() {
  onView(withId(R.id.name_field))
    .perform(typeText("Steve"));
  onView(withId(R.id.greet_button))
    .perform(click());
  onView(withText("Hello Steve!"))
    .check(matches(isDisplayed()));
}

Read more about Espresso.

Android JUnit Runner

AndroidJUnitRunner is a new unbundled test runner for Android. It features:

  • JUnit4 support
  • Instrumentation Registry
  • Test Filters
  • Test timeouts
  • Sharding of tests
  • RunListener support to hook into the test run life-cycle
  • Activity and Application life-cycle monitoring
  • Intent Monitoring and Stubbing

Read more about the Android JUnit Runner.

JUnit4 Rules

With the Android Testing Support Library we provide a set of JUnit rules to be used with the Android JUnit Runner. JUnit rules provide more flexibility and reduce the boilerplate code required in tests.

Read more about the JUnit4 Rules.

UI Automator

UI Automator is a UI testing framework suitable for cross-app functional UI testing across system and installed apps.

Read more about UI Automator