More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Espresso: Android UI Tests That Stay Green

    1

    Write Espresso UI tests that stay green — task-shaped tests, stable matchers, idling resources instead of sleeps, and CI that runs them.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Espresso: Android UI Tests That Stay Green

    Espresso: Android UI Tests That Stay Green

    Example session with this skill installed

    Our login test fails about one run in five. It types credentials, sleeps two seconds, then checks the dashboard. Make it stable.

    • Read your context and instructions
    • Compiled the espresso

    Login test stabilized. Structure: split into three methods — valid credentials open the dashboard, wrong password shows an inline error, empty email disables submit. Matchers: email field moved from hierarchy position to resource ID. Synchronization: the two-second sleep deleted; an idling resource registered for the login network call, so the test waits for the actual work. Doubles: network layer replaced with a fake returning a fixed response. Verification: ten consecutive green runs locally and on a device; class now runs in CI on every change. The flake is gone because the guess is gone. The suite now runs the login class in CI on every change touching the app, and the ten consecutive green runs are recorded in the test record alongside the matcher changes and the idling resource registration. The fake network layer returns both the success case and the failure cases, so the error paths are covered too — a fake that only returns the happy path would hide the error handling. No Thread.sleep remains anywhere in the suite, and the test record names the async boundary for every test so the next developer can see what the tests wait for. The working log holds the matcher changes, the idling resource registration, and the ten consecutive green runs, so the next flake has a baseline to compare against. Rubric score: 8/8.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Espresso runs inside your app's process, which makes it fast and deterministic — it knows when the UI thread is idle, so tests do not need arbitrary waits. Most flaky Espresso suites are flaky because the tests fight the framework instead of using it. This skill is the discipline for writing suites that stay green: structure tests around user tasks, locate views with stable matchers, synchronize async work with idling resources instead of sleeps, put test doubles at the boundary, run locally and on a device farm, and wire it into CI. A worked example builds a login test from a flaky sleep-based version to a stable idling-resource version, with the flake diagnosed and fixed. The rules are short and strict: one test, one behavior; no sleeps; matchers that survive a layout change.

    Espresso tests UI flows, not isolated logic — unit tests belong in a different layer.

    • Android-only; iOS needs a different framework.
    • Tests must not depend on real network calls; doubles belong at the boundary.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 3 days ago

    Permissions

    No special permissions declared or detected

    Listed3 days ago

    What's inside

    Frequently Asked Questions

    Almost always synchronization: the test guesses with a sleep instead of waiting for the actual work. Register an idling resource for the async boundary, delete the sleep, and the flake usually disappears.

    Only as a last resort. Resource IDs are stable; text changes with copy edits and localization. If a view has no stable ID, add one — the test is telling you the UI lacks an anchor.

    Yes — on an emulator or a device farm, on every change that touches the app. CI is what keeps the suite honest; a suite that only runs locally rots silently.

    New in Mobile Development