Click by bounds / coordinates

Espresso has the GeneralClickAction, this is the underlying implementation of ViewActions click(), doubleClick(), and longClick(). The GeneralClickAction‘s constructor takes a CoordinatesProvider as second argument. So the basic idea is to create a static ViewAction getter which provides a custom CoordinatesProvider. Something like this: public static ViewAction clickXY(final int x, final int y){ return new GeneralClickAction( … Read more

Confused about testCompile and androidTestCompile in Android Gradle

Simply testCompile is the configuration for unit tests (those located in src/test) and androidTestCompile is used for the test api (that located in src/androidTest). Since you are intending to write unit tests, you should use testCompile. Update: The main distinction between the two is the test sourceset runs in a regular Java JVM, whereas the … Read more

How can I deploy and execute an application on a device connected to a remote system?

From the adb tag wiki: Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device. It is a client-server program that includes three components: A client, which runs on your development machine. You can invoke a client from a shell by issuing an … Read more