Skip to content

Most visited

Recently visited

navigation

Samples

The android-testing GitHub repository contains several collections of samples, which this document lists.

Espresso samples

Name Description
BasicSample Basic Espresso sample
CustomMatcherSample Shows how to extend Espresso to match the hint property of an EditText
DataAdapterSample Showcases the onData() entry point for Espresso, for lists and AdapterViews
IdlingResourceSample Synchronization with background jobs
IntentsBasicSample Basic usage of intended() and intending()
IntentsAdvancedSample Simulates a user fetching a bitmap using the camera
MultiWindowSample Shows how to point Espresso to different windows
RecyclerViewSample RecyclerView actions for Espresso
WebBasicSample Use Espresso-web to interact with WebViews.
BasicSampleBundled Basic sample for Eclipse and other IDEs

UiAutomator sample

Name Description
BasicSample Basic UI Automator sample

AndroidJUnitRunner sample

Name Description
AndroidJunitRunnerSample Showcases test annotations, parameterized tests and test suite creation

JUnit4 Rules sample

All previous samples use ActivityTestRule or IntentsTestRule, but there’s one specific to ServiceTestRule:

Name Description
BasicSample Simple usage of ActivityTestRule
IntentsBasicSample Simple usage of IntentsTestRule
ServiceTestRuleSample Simple usage of ServiceTestRule
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)