/Kotlin-Espresso-sample

Very simple Android App using Kotlin and Espresso

Primary LanguageKotlinMIT LicenseMIT

Kotlin-Espresso-Sample

CircleCI

It's an example project for Android Studio using Kotlin and Espresso to run UI tests. It also includes typical unit tests using JUnit4. All codes are written in Kotlin 🎉

What you can learn from this repo

  • How to implement UI tests using Espresso and unit tests (without UI) using JUnit4
  • Fundamental Kotlin language and basic usage
  • Thanks to RxJava, we can implement a calculator by less than 100 lines! 🚀

Requirements

  • Run with Android Studio 3.1.2 (or newer)

The test target app

Very simple calculator :)

Do tests

Note: You should have a connected device in advance before running 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
root path of test files src/androidTest/kotlin
Path
src/test/kotlin
Path
prefix of dependencies defined in build.gradle androidTestCompile testCompile

License

MIT