Git Product home page Git Product logo

double-espresso's Introduction

DEPRECATED

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 "com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner"
}

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:

com.squareup.dagger:dagger:1.2.1
javax.inject:javax.inject:1
javax.annotation:javax.annotation-api:1.2
com.google.guava:guava:16.0
com.google.code.findbugs:jsr305:1.3.9
org.hamcrest:hamcrest-core:1.1
org.hamcrest:hamcrest-library:1.1
org.hamcrest:hamcrest-integration:1.1

and those of the 'support-v4' module:

com.android.support:support-v4:21.0.0

Notes

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's People

Contributors

algobardo avatar cowst avatar jakewharton avatar kisty avatar sschuberth avatar thomaswk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.