with Android Studio, Gradle, Espresso, Robolectric, AndroidAnnotations, RoboCoP, JaCoCo
Wishes, improvements and discussions about the stuff here are welcome
Switch to the branch https://github.com/nenick/android-gradle-template/tree/novoda for more informations
I'm prefer https://github.com/JCAndKSolutions/android-unit-test to support robolectric because it integrates much better through the extra created IDE Plugin.
https://github.com/nenick/AndroidAppDevelopment
clone, attach phone (or start emulator), run Scripts/run-tests.sh
from project root
import to android studio, start development, press play
install the plugin https://github.com/evant/android-studio-unit-test-plugin you can install the plugin through the plugin installer in Android Studio
This project template support AndroidStudio.
unit tests: ./gradlew testNormLDebug
- append
jacocoReport
for coverage report can't be combined with the integration tests
integration tests: ./gradlew testIntegrationDebug
- append `jacocoReport for coverage report can't be combined with the unit tests
acceptance tests: ./gradlew connectedAndroidIntegrationTest
- replace by
:App:connectedCheck
for coverage report
Currently RestActivity example fails when no server is reachable.
- start
Script/start-wiremock.sh
- kill
Script/start-wiremock.sh kill
- build/index.html (robolectric & unit tests) (should collect all reports, current is miss the some reports)
- App/build/test-coverage-report/index.html (unit test coverage)
- App/build/test-coverage-report/index.html (integration test coverage)
- App/build/reports/androidTests/connected/index.html (acceptance tests)
- App/build/reports/coverage/debug/index.html (acceptance tests coverage)
- Android Studio 1.0.2
- Gradle Build Tools 1.0.0
- Gradle 2.1.1
- Gradle + AndroidStudio as development Enironment
- Robolectric for unit tests
- Mockito
- Code coverage with JaCoCo
- Code coverage with Teamcity
- Robolectric for component tests
- Code coverage with JaCoCo
- Code coverage with Teamcity
- FEST Android assertions
- Espresso for acceptance tests
- AndroidAnnotations generate dependency injection
- RoboCoP generate database management
- Shortcut: jump between test and implementation with default short cut
- Travis CI runs all test variants
- Coveralls shows unit test code coverage coveralls-gradle-plugin
- run-tests.sh execute all test variants
- run-tests-fast.sh execute just the robolectric tests
- run-tests-travis.sh do all steps necessary for full automatic builds, like install custom dependencies