writing-espresso-tests

Installation
SKILL.md

Writing Espresso Tests — The Idle-Then-Act Model for Android Views

Espresso is the canonical instrumentation-time UI test framework for Android Views (not Compose — for Compose, use the compose/ skill set; for cross-Compose-View interop see ../../../compose/interop/testing-with-espresso-interop/SKILL.md). Each onView(...).perform(...).check(...) call internally pumps the main looper to idle, finds exactly one matching view, runs the action, and pumps to idle again before checking. This skill encodes the full matcher/action/assertion catalog, the RootMatchers.DEFAULT trap, and the per-version gotchas.

When to use this skill

  • The user is testing an Activity, Fragment, or Dialog whose UI is built with Android Views (XML layouts, AppCompat, Material View components).
  • A test fails with NoMatchingViewException, AmbiguousViewMatcherException, or PerformException.
  • A click on an AlertDialog button silently does nothing — RootMatchers.DEFAULT excludes dialogs.
  • The user wants to stub Intent.startActivityForResult for camera, contacts, or share flows.
  • The user wants to register an IdlingResource for a long-running task that Espresso can't see.
  • The user is debugging a RecyclerView interaction.
  • The user mentions BottomNavigationViewActions and is surprised it isn't on the classpath in Espresso 3.7.0 contrib.

When NOT to use this skill

Installs
36
GitHub Stars
319
First Seen
May 16, 2026
writing-espresso-tests — skydoves/android-testing-skills