finds.dev← search

// the find

mitchtabian/EspressoUITest-Examples

★ 254 · Kotlin · updated Apr 2022

Examples of UI Testing with Espresso, Mockk, androidx.test

A companion repo to a free Mitch Tabian video course, teaching Espresso UI testing on Android through a series of git branches, each isolating one scenario (fragments, intents, dialogs, toasts, RecyclerViews, navigation) against the same toy movie-list app. It's aimed at Android devs who are new to UI testing and want a worked example instead of just docs.

Good scenario coverage for a beginner resource — intents (camera/gallery) with custom matchers, dialog input capture, and toast detection are all cases the official Espresso docs explain poorly. Using one consistent sample app across every branch means you're diffing testing technique rather than re-learning a new codebase each time. The FragmentFactory + Mockk branch specifically calls out the 'open class for testing' problem that trips up a lot of Kotlin devs moving from Java-era Espresso tutorials.

Organizing examples as separate git branches instead of folders is awkward to browse or grep on GitHub — you have to know the branch names from the README and check each one out individually, there's no single branch where you can diff the examples against each other. No CI config, so nothing verifies these tests still pass on current AGP/Gradle versions. Dead since April 2022: Espresso itself is stable, but Mockk, AGP, and compileSdk have moved on enough that a fresh checkout has a real chance of needing dependency fixes before gradlew even builds. The 'app' used for testing is minimal fake data (FakeMovieData.kt) with no network or database layer, so none of the examples touch the harder real-world cases — idling resources with actual async work, Compose interop, or Hilt-based DI, which is what most teams actually need Espresso help with now.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →