simple app to load hacker-news
Instrumented test will rely on real data from internet, so please make sure the device/emulator have stable internet access when runing instrumented test.
make sure you have a emulator running or a device connecting to the pc
code coverage can be generated with command line or android studio
- go to the project folder
cd HackerNews
- clean and generate test report and code coverage report
...............for Mac/Linux.......................
./gradlew clean jacocoTestReport
...............for Windows.........................
gradlew clean jacocoTestReport
-
open the project with android studio
-
open "Terminal" at the buttom, run following command
...............for Mac/Linux.......................
./gradlew clean jacocoTestReport
...............for Windows.........................
gradlew clean jacocoTestReport
-
open the project with android studio
-
open the "Gradle projects" panel from the "Gradle" lable at the right side, browse to HackerNews-Tasks-other-jacocoTestReport-double click to run it
The reports are locating in below folders
Unit test report >>>>>>>>>>>>>>>>>>> HackerNews\app\build\reports\tests\testDebugUnitTest
Instrumented test report >>>>>>>>>>>>>>>>>>> HackerNews\app\build\reports\androidTests\connected
code coverage report(instrument test only--81% coverage) >>>>>>>>>>>>>>>>>>> HackerNews\app\build\reports\coverage\debug
code coverage report(overall--83% coverage) >>>>>>>>>>>>>>>>>>> HackerNews\app\build\reports\jacoco\jacocoTestReport\html