What's this?
This is an ui test code sample of Espresso. The app is really a basic/template sample that is of Android Studio generated by selecting "Basic Acticity".
Where is the Test code?
UI Test(Instrumented Test)
The code is under app/src/androidTest/java/com/example/uitestsample
Unit Test
The code is under app/src/test/java/com/example/uitestsample
How to run the Test?
Run Test on GUI
To run the test, Android Studio must be installed, and also more than one virtual devices must be run in your computer. Then open UI Test code on Android Studio, then click the 'Play Button' locaeted next to line number.
In short:
- Clone this repository
- Install Android Studio
- Setup Virtual Device and Run it
- Open the UI Test code
- Click 'Play Button'
Run Test on CLI
At No.3 in the list above, CLI can be the alternatice way to run the Test.
Instrumented Test
$ ./gradlew connectedAndroidTest
Unit Test
$ ./gradlew test
However, this way does not always easy for all of developers. So, to get more information about to run on CLI in detail please refer to this page depending on your interest. https://developer.android.com/studio/test/command-line
Run both Instrumented Test and Unit test, and get report
./gradlew jacocoDebugTestReport
Report will be stored in ./app/build/reports/
directory.
Lisence
Apache License Version 2.0