Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here


[DEPRECATED] A pure Gradle port of the Espresso testing utility for Android!

Subscribe to updates I use double-espresso

Statistics on double-espresso

Number of watchers on Github 359
Number of open issues 0
Main language Java
Average time to merge a PR 2 days
Open pull requests 0+
Closed pull requests 1+
Last commit almost 5 years ago
Repo Created over 5 years ago
Repo Last Updated over 1 year ago
Size 11.6 MB
Organization / Authorjakewharton
Page Updated
Do you use double-espresso? Leave a review!
View double-espresso activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating double-espresso for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)


This project is now deprecated. Espresso 2.0 is now available.

Double Espresso

A pure Gradle port of the Espresso testing utility for Android!

Note: From android gradle plugin 0.9, use androidTestCompile for dependencies instead of instrumentTestCompile (see plugin migration instructions)

No more fumbling with local jars or dependency conflicts. Pull it in with one line:

androidTestCompile 'com.jakewharton.espresso:espresso:1.1-r3'

Espresso also has an add-on module which provides helpers for the support-v4 library:

androidTestCompile 'com.jakewharton.espresso:espresso-support-v4:1.1-r3'

Configure the build to use Espresso's custom test runner:

defaultConfig {
  testInstrumentationRunner ""

The Espresso classes have not been modified from the original version. This exists only as a means of creating artifacts for native consumption by the new Gradle Android build system. This project will be immediately deprecated once Google releases a proper version of Espresso that can be consumed without hassle. A diff of the changes is available to view.

DO NOT submit pull requests for features, functionality, or bug fixes. Direct those to the original project on Google Code. Only changes to which further the port to Gradle will be accepted.

Duplicated Dependencies

Due to a bug in the current Android plugin, you may need to exclude dependencies which are duplicated in both the app and test app.

For example, if you have a dependency on Dagger you will need to manually exclude it from the test dependency for the time being.

androidTestCompile('com.jakewharton.espresso:espresso:1.1-r3') {
  exclude group: 'com.squareup.dagger'

The following are the dependencies of Espresso which may need to be temporarily excluded:


and those of the 'support-v4' module:


The following things are worth noting from the migration:

  • Module names have been shuffled to be structured more logically.

    OLD                        NEW
    ------------------------   ------------------------
    espresso/lib/              espresso/
    espresso/libtests/         espresso-tester/ (src/instrumentTest)
    espresso/contrib/          espresso-support-v4/
    espresso/contribtests/     espresso-support-v4-tester/ (src/instrumentTest)
    testapp/                   espresso-sample/
    testapp_test/              espresso-sample/ (src/instrumentTest)
    testrunner/                espresso-runner/
    testrunner-runtime/        espresso-runner-runtime/
  • The Maven build used the 'testapp' module for the 'libtests', 'contribtests', and 'testapp_test' tests. Since Gradle does not easily facilitate this, specific parts of 'testapp' were moved into the src/main/ folders of the 'espress-tester' and 'espresso-support-v4-tester' modules for direct use.

  • Declaring activities inside the instrumentation test for library projects is not supported. To work around this, we mirror the Maven technique of having tester projects adjacent to the libraries. The activities the tests exercise are in src/main/ with a proper manifest.

  • Dagger was updated to version 1.2.1.

  • Guava was updated to version 16.0.

double-espresso questions on Stackoverflow (View All Questions)
  • Double Espresso not working with Robolectric
  • double espresso test with gradle - empty test suite
double-espresso list of languages used
Other projects in Java