writing-espresso-tests

writing-espresso-tests is a skill for Claude Code, Codex from skydoves/android-testing-skills. It costs 205 tokens per session (5,390 once invoked), scanned A, original, Apache-2.0.

Guidance for writing Espresso tests for Android screens built with Views, the traditional XML-based Android interface system. Tests find views, perform actions, and check the results, including lists, intents, dialogs, and waiting for background work.

In plain words
What is it for?
Use it to test Activities, Fragments, Dialogs, RecyclerViews, AdapterViews, launched apps or actions, and long-running UI operations.
Why use it?
It helps diagnose missing or ambiguous views, clicks that do not reach dialogs, and asynchronous work that makes tests run too early.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to test Activities, Fragments, Dialogs, RecyclerViews, AdapterViews, launched apps or actions, and long-running UI operations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/skydoves/android-testing-skills/writing-espresso-tests
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add skydoves/android-testing-skills --skill writing-espresso-tests
Clone the repo
git clone --depth 1 https://github.com/skydoves/android-testing-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for writing-espresso-tests

README.md
[![agentmods](https://agentmods.dev/badge/skills/skydoves/android-testing-skills/writing-espresso-tests.svg)](https://agentmods.dev/skills/skydoves/android-testing-skills/writing-espresso-tests)
Your own site
<a href="https://agentmods.dev/skills/skydoves/android-testing-skills/writing-espresso-tests"><img src="https://agentmods.dev/badge/skills/skydoves/android-testing-skills/writing-espresso-tests.svg" alt="Measured on agentmods" height="20"></a>
Per session 205 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,390 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00205 $0.05390
Opus 5 $0.00102 $0.02695
Sonnet 5 $0.00041 $0.01078
Haiku 4.5 $0.00020 $0.00539

Measured 8d ago against content hash 06f901ae570b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

writing-espresso-tests scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

instrumentation/espresso/writing-espresso-tests/SKILL.md · 356 lines

How it starts

The opening of the file, as written. The whole thing — 356 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

  • The UI is Jetpack Compose — use compose/ skills (../../../compose/finders/finding-nodes-by-tag-text-content/SKILL.md, etc.). Mixed Compose+View hosts: ../../../compose/interop/testing-with-espresso-interop/SKILL.md.
  • The test crosses app boundaries (Settings, dialer, system UI) — InjectEventSecurityException from Espresso. Use ../../uiautomator/cross-app-tests-with-uiautomator/SKILL.md.
  • The runner stack is not yet set up — start with ../../runner/running-instrumented-tests-with-androidjunit4/SKILL.md.
  • The Activity has not been launched — pair with ../../scenarios/launching-activities-with-activityscenario/SKILL.md.

Read the full file on GitHub · 356 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 356 lines · 205 tokens per session scan A 06f901ae570b

Subscribe to this mod's changes

writing-espresso-tests is a skill published in the GitHub repository skydoves/android-testing-skills (318 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 205 tokens to every session and 5,390 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

android-ui-journey-testing

XML-specified Android UI journey testing, interactive step execution, assertion verification, and JSON outcome reporting.

sickn33/agentic-awesome-skills · 27 tokens

android_ui_verification

Automated end-to-end UI testing and verification on an Android Emulator using ADB.

sickn33/agentic-awesome-skills · 22 tokens

solopi-ai

A command-line framework for testing Android apps and devices with SoloPi, including on-device or cloud AI decision models. It manages devices, test cases, recorded interactions, replays, performance history, and evidence.

alipay/SoloPi · 127 tokens

dogfood

Systematically explore and test a mobile app on iOS/Android with agent-device to find bugs, UX issues, and other problems. Use when asked to dogfood, QA, exploratory test, find issues, bug hunt, or test this app on mobile.

callstack/agent-device · 55 tokens

eas-simulator

EAS service (paid). Run and control a user's app on a remote iOS/Android simulator hosted on EAS cloud. Read before running any eas simulator: commands - it has the current syntax for this experimental API. Use whenever the user needs a simulator they can't run locally - 'run my app on a cloud simulator', 'use eas…

expo/skills · 249 tokens

flutter-add-integration-test

Configures Flutter Driver for app interaction and converts MCP actions into permanent integration tests. Use when adding integration testing to a project, exploring UI components via MCP, or automating user flows with the integrationtest package.

flutter/agent-plugins · 48 tokens