Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use Espresso for testing on Android?

I do not understand. How can I add and use Espresso in my project?

Espresso url: https://code.google.com/p/android-test-kit/

How to connect this library to my project? I would like to have an example in Eclipse.

like image 724
Viacheslav Avatar asked Oct 21 '22 19:10

Viacheslav


2 Answers

To use Espresso for Android you have to create test project which will test your main application under test. This link contains Espresso setup instruction for Eclipse and Android Studio. And also some basic steps you have to do (with test project but not with the main app) before running your tests: adding GoogleInstrumentationTestRunner into AndroidManifest.xml file and changing Run Configurations. After you finish - take a look on examples from here.

like image 121
denys Avatar answered Oct 29 '22 03:10

denys


I found Espresso jar file https://code.google.com/p/android-test-kit/source/browse/#git%2Fbin%2Fespresso-dependencies . I added jar file to my project and it's very easily =).

like image 29
Viacheslav Avatar answered Oct 29 '22 01:10

Viacheslav