GitPedia

Kotlin Espresso sample

MVP Android project that uses Espresso instrumentation tests. All code are written in Kotlin.

From pot8os·Updated February 4, 2025·View on GitHub·

This is MVP project for Android app that is written in [Kotlin](https://github.com/JetBrains/kotlin) and uses [Espresso](https://developer.android.com/intl/ja/tools/testing-support-library/index.html#Espresso) to run both unit and instrumented tests. The project is written primarily in Kotlin, distributed under the MIT License license, first published in 2015. Key topics include: android, android-architecture-component, androidx, espresso, instrumentation-tests.

Kotlin-Espresso-Sample

This is MVP project for Android app that is written in Kotlin and uses Espresso to run both unit and instrumented tests.

What you can learn from this project

  • How to share test cases between Instrumented tests and unit tests
  • Fundamental and practical methods that how to write Android code using Android Architecture Components that brings ViewModel.

Requirements

  • Run with Android Studio 4 (or newer)

Target app

No need to explain about the app since you are familiar with this well.. :)

<img src="img/screen.png" width="384">

Run tests

Requires a connected device to run Instrumented tests. It doesn't matter whether it's a simulator and a real one.

Using Android Studio

Instrumented TestsUnit Tests
Gradle task name:app:connectedAndroidTest<br/><br/>Run Task:app:testDebugUnitTest<br/><br/>Run Unit Test
Location of test codesrc/androidTest/kotlin<br/>Pathsrc/test/kotlin<br/>Path

License

MIT

Contributors

Showing top 2 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from pot8os/Kotlin-Espresso-sample via the GitHub API.Last fetched: 6/28/2026