Add UI Tests

While this chapter does indeed focus on the UI and user interaction with the app, things are thankfully going to look pretty similar to last chapter. This includes the test format (setup, run, assert) and the dependencies. The androidTestImplmentation dependencies look like this:

 androidTestImplementation ​"junit:junit:$junit_version"
 androidTestImplementation ​"androidx.test:core-ktx:$test_core_version"
 androidTestImplementation ​"androidx.test.ext:junit-ktx:$test_ext_version"
 androidTestImplementation
 "androidx.test.espresso:espresso-core:$espresso_version"
 androidTestImplementation
 "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version"

The only new dependency here is for Espresso, Jetpack’s UI testing ...

Get Kotlin and Android Development featuring Jetpack now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.