Does any one have an example of maven setup of the new Android UI test framework called espresso ?
4 Answers
Quality Tools for Android now proposes both a maven and gradle setup example for android-test-kit/espresso.
To launch the espresso tests you can use either :
- mvn -P espresso
- gradle :android-sample-espresso-tests:connectedCheck

- 37,840
- 15
- 114
- 173
You'll need the Java 7 compiler (even though the code compiles with -source & -target set to 1.5). (JDK6 and JDK1.5 may have problems).
Then you'll need to setup maven-android-sdk-deployer. Instructions are here:
https://github.com/mosabua/maven-android-sdk-deployer
After that it should just be a mvn install.
Eventually the artifacts will be available as an SDK extra. This is a developer preview right now :)
-
Where did you hear that JDK 7 is needed ? And up to now the espresso artifacts are not available. I can't say whether they will ever be available via the SDK manager or via maven central (and then installable via sdk deployer). – Snicolas Oct 20 '13 at 18:55
Here is a 5 minutes set up of gradle setup of Espresso (in Android Studio), together with github example https://medium.com/p/c476d3b5ba45

- 448
- 3
- 9
Also take a look at Jake Wharton's Gradle-port of Espresso. That may be a better intermediary step until the original library is updated with Gradle support.
https://github.com/JakeWharton/double-espresso
Add the dependency to your build.gradle
to get it working:
androidTestCompile 'com.jakewharton.espresso:espresso:1.1-r3'
Check http://mvnrepository.com/artifact/com.jakewharton.espresso/espresso for the latest version.

- 3
- 2