testing-setup
Qué hace
Esta skill comprueba cómo prueba hoy un proyecto de Android su código y planifica una configuración de pruebas. Puede añadir las bibliotecas y los arneses de pruebas unitarias, de interfaz, de capturas de pantalla y de extremo a extremo. Es para desarrolladores de Android que quieren una estrategia de pruebas que funcione.
Cuándo usarla
- ✓Cuando tu proyecto de Android tiene pocas pruebas o ninguna y quieres una configuración para probarlo.
- ✓Cuando quieres añadir pruebas de capturas de pantalla para pantallas de Compose o de Views.
- ✓Cuando necesitas saber qué bibliotecas de pruebas y herramientas de simulación usa ya tu proyecto.
Link de la skill
https://github.com/android/skills/blob/main/testing/testing-setup/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Revisa la configuración de pruebas de mi proyecto de Android y añade las bibliotecas para pruebas unitarias y de interfaz de Compose.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
La skill lee tu catálogo de versiones y los archivos de compilación para encontrar el marco de inyección de dependencias, los marcos de prueba, las herramientas de simulación y el tipo de interfaz. Después añade las bibliotecas y los arneses que faltan y que encajan con el proyecto.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
Step 1: Analyze the current testing setup
To understand the testing setup of an existing project, look for these dependencies in the libs.versions.toml file, or build files:
- Dependency Injection framework used. For example, Hilt, Koin, Anvil, or vanilla Dagger.
- Unit (local) testing framework this project uses. For example, JUnit4 or JUnit5.
- Mocking framework (if any) used for unit tests, and for instrumented and UI tests. For example, Mockito or Mockk.
- Robolectric. Identify which of these three uses apply:
- Used in unit tests to have fakes for platform entities
- To run behavior UI tests without a device or emulator. For example, used to run Espresso or Compose tests.
- To do screenshot testing with Roborazzi
- Is the app 100% Compose, Views or hybrid?
- Behavior UI tests:
- Compose Tests (
androidx.compose.ui:ui-test-*) - Espresso Tests for Views. Check for wrappers such as Kaspresso. Dependencies:
androidx.test.espresso:espresso-core,androidx.test:runner,androidx.test:rules.
- Compose Tests (
- Screenshot tests. Identify which of these types the project uses:
- Instrumented (device-based). For example, using Dropshots.
- Based on Robolectric, so they run locally. For example, using Roborazzi.
- Based on LayoutLib, so they run locally. For example, Paparazzi, or the Compose Preview Screenshot Testing tool.
- End to end tests (also known as Release Candidate tests) always run on device and use high-level frameworks such as UIAutomator, Appium, or Robotium.
- Generate a Markdown report with the analysis
Step 2: Set up Dependency Injection frameworks for testing
If there is no Dependency Injection framework, install one: if it's a multiplatform application, ask the user whether they want to install Koin, or kotlin-inject. If it's not multiplatform, install Hilt.
Install the testing dependencies (for example com.google.dagger:hilt-compiler
that should be applied with a kspAndroidTest configuration).
[!IMPORTANT] Important: Always consult the documentation of the applicable framework to learn about testing (for example: Hilt testing guide, Koin Instrumented tests).
For instrumented tests, create and configure (by adding
testInstrumentationRunner to the build gradle files) a new test runner and
apply the testing rules required by the framework (for example in Hilt, annotate
your test classes with @HiltAndroidTest and apply the HiltAndroidRule).
Other frameworks use other mechanisms, consult their documentation.
Step 3: Install frameworks
Unless otherwise specified, respect the current stack of testing frameworks.
If there are no testing frameworks, and the user didn't specify any preference, install the following:
JUnit4 for local and instrumented tests
JaCoCo for test coverage
For UI tests: if the project has views, Espresso. If it's fully Compose, use the Compose Testing APIs.
Robolectric to run UI Tests
Compose Preview Screenshot Testing tool for screenshot tests. Check the project's AGP version first, then pick the matching setup and follow it strictly:
- AGP 9.5.0-alpha03 or higher (recommended): configure an AGP test suite using
testOptions { screenshotTests.create(...) }, as described in Screenshot testing with test suites. - Lower AGP versions: use the legacy standalone plugin setup with
com.android.compose.screenshot, and tell the user it's deprecated. Don't upgrade AGP as part of setting up screenshot tests. Mention that test suites are available on 9.5.0-alpha03 or higher, and leave the upgrade as a separate decision.
Don't combine both setups in the same module. If the project already uses the standalone plugin and its AGP version supports test suites, offer to migrate it using the tasks and paths mapping table in Screenshot testing with test suites.
- AGP 9.5.0-alpha03 or higher (recommended): configure an AGP test suite using
Dropshots for device screenshot tests
If a mocking framework is necessary, install Mockk (
io.mockk:mockk). Do not install it unless it is clearly necessary.
If instrumented screenshot tests are requested, install Dropshots.
If end-to-end testing is requested, install
Preguntas frecuentes
¿Escribe mis casos de prueba?
La skill se centra en la configuración de pruebas y los arneses, así que tú sigues decidiendo qué comportamientos probar.
¿Qué tipos de pruebas de capturas de pantalla reconoce?
Reconoce las pruebas de capturas basadas en dispositivos y las locales basadas en Robolectric o LayoutLib.
¿Qué herramientas de inyección de dependencias reconoce?
Reconoce marcos como Hilt, Koin, Anvil y Dagger puro.
Detalles
Descripción original del autor
Analyze and create a testing strategy for Android apps - install testing libraries, set up test infrastructure, create harnesses for unit tests, UI tests, screenshot tests, and end-to-end tests.
repo: android/skills
Popularidad
- Estrellas en GitHub
- 10 mil
- Posición en el ranking
- #11937
- Licencia
- Apache-2.0
- Actualizada
- 29/10/2026
Comentarios
- …
Más skills de este repositorio
agp-9-upgrade
10 milAyuda a tu agente a actualizar una app de Android a Android Gradle Plugin 9 y a resolver sus cambios incompatibles. No sirve para proyectos multiplataforma.
camerax
10 milAyuda a tu agente a crear funciones de cámara en Android con CameraX, incluida la grabación de vídeo, los controles del hardware y los efectos de ML Kit y Media3.
android-for-cars-parked-apps
10 milAyuda a tu agente a adaptar una app de Android de vídeo, juegos o navegador para que funcione como app aparcada en Android Auto y Android Automotive.
appfunctions
10 milAyuda a tu agente a encontrar los flujos de trabajo clave de una app de Android y a exponerlos como AppFunctions que los agentes de IA y los comandos de voz pueden ejecutar.
Skills parecidas
test-driven-development
311 milEnseña a tu agente a escribir primero una prueba que falle, verla fallar y después escribir el código más pequeño que la hace pasar, antes de construir cualquier función o corrección.
verification-before-completion
311 milEnseña a tu agente a ejecutar comprobaciones reales y leer su resultado antes de afirmar que una tarea, una corrección o una compilación está completa o en buen estado.
migrate-to-shoehorn
310 milSustituye los casts de tipo arriesgados de tus archivos de prueba por la librería shoehorn, para que las pruebas usen datos parciales y sigan pasando las comprobaciones de tipos.