testing-with-espresso-interop

Synchronize Jetpack Compose and Espresso UI tests within Android Activities.

Updated Jul 20, 2026
One-click install
npx skills add https://github.com/trancee/MeshLink-template --skill testing-with-espresso-interop-trancee
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-with-espresso-interop
Source: https://github.com/trancee/MeshLink-template/tree/main/.agents/skills/android-testing-skills/compose/interop/testing-with-espresso-interop
Command: npx skills add https://github.com/trancee/MeshLink-template --skill testing-with-espresso-interop-trancee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill resolves synchronization deadlocks and threading errors that occur when testing hybrid Android applications that mix Jetpack Compose and legacy Android View hierarchies.

Core Features & Use Cases

  • Cross-Framework Synchronization: Automatically bridges Compose idling resources with Espresso using the internal EspressoLink mechanism.
  • Hybrid UI Testing: Enables simultaneous interaction with Compose nodes and legacy Android Views, including Dialogs and IME (soft keyboard) states.
  • Use Case: Use this skill when you need to verify that a soft keyboard appears correctly for a text field inside a Compose-based Dialog, or when testing a legacy Activity that hosts a ComposeView.

Quick Start

Use the testing-with-espresso-interop skill to configure an AndroidComposeTestRule and safely execute Espresso onView interactions alongside Compose finders.

Frequently Asked Questions about testing-with-espresso-interop

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Espresso UI tests on a Jetpack Compose screen without getting threading errors?

To run Espresso onView interactions on Jetpack Compose, use an AndroidComposeTestRule configured with an internal EspressoLink mechanism. This synchronizes the test thread by waiting for Compose idle states before executing Espresso interactions.

Why does my Espresso test deadlock when interacting with a ComposeView inside a legacy Activity?

Espresso test deadlocks in hybrid View-Compose hierarchies occur due to missing cross-framework synchronization. Bridging Compose idling resources with Espresso via an internal linking mechanism resolves the deadlock and ensures proper thread synchronization.

Can I test soft keyboard IME interactions and Dialog windows in a hybrid Compose and Android View setup?

Yes, you can test soft keyboard IME interactions and Dialog windows in hybrid View-Compose hierarchies by bridging Compose and Espresso frameworks. This synchronization enables simultaneous interaction with legacy Android Views and Compose nodes within a single Activity environment.

What is the best way to verify a soft keyboard appears for a text field inside a Compose-based Dialog?

The best way to verify a soft keyboard for a text field in a Compose Dialog is using a Compose-Espresso interop bridge. It synchronizes the frameworks via an internal EspressoLink mechanism to safely execute onView interactions and verify IME states without threading errors.

Do I need an idling resource to mix Compose finders and Espresso onView interactions in the same test?

Yes, you need an idling resource to mix Compose finders and Espresso onView interactions. An internal EspressoLink mechanism bridges the two frameworks, ensuring Espresso interactions occur on the test thread only after Compose reaches idle states.

When should I not use a cross-framework synchronization bridge for Android UI testing?

You should not use a cross-framework synchronization bridge if your application uses a purely Compose-based UI without any legacy Android Views. The bridge is specifically designed for hybrid View-Compose hierarchies and complex Dialog or IME scenarios within a single Activity environment.