/Kotlin-Espresso-sample

MVP Android project that uses Espresso instrumentation tests and Robolectric in Kotlin

Primary LanguageKotlinMIT LicenseMIT

Kotlin-Espresso-Sample

CircleCI

This is MVP project for Android that uses Kotlin and Espresso together to run instrument tests. Moreover, it has a test code that implements Robolectric 4 that supports running Instrumentation Tests as unit tests! 🎉

What you can learn from this project

  • How to write UI tests using Espresso and unit tests using Robolectric 🎉
  • Fundamental and practical way how to write Kotlin
  • Thanks to RxJava, it gets a calculator by less than 100 lines 🚀

Requirements

  • Run with Android Studio 3.5.0 (or newer)

Target app

No need to explain about usage since you know it well :)

Run tests

You have to have a connected device in advance in order to run UI tests. It doesn't matter if it's a simulator and a real one.

Using Android Studio

UI Tests (using Espresso) Unit Tests (using JUnit4)
Gradle task name connectedAndroidTest

Run Task
testDebugUnitTest

Run Unit Test
Location of test code src/androidTest/kotlin
Path
src/test/kotlin
Path
Prefix of dependencies defined in build.gradle androidTestCompile testCompile

License

MIT