testing-setup
O que ela faz
Esta skill verifica como um projeto Android testa o código hoje e planeja uma configuração de testes. Ela pode adicionar as bibliotecas e os ambientes de teste para testes de unidade, de interface, de capturas de tela e de ponta a ponta. Ela é para desenvolvedores Android que querem uma estratégia de testes que funcione.
Quando usar
- ✓Quando seu projeto Android tem poucos testes ou nenhum, e você quer uma configuração de testes.
- ✓Quando você quer adicionar testes de captura de tela para telas em Compose ou em Views.
- ✓Quando você precisa saber quais bibliotecas de teste e ferramentas de mock seu projeto já usa.
Link da skill
https://github.com/android/skills/blob/main/testing/testing-setup/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Veja a configuração de testes do meu projeto Android e adicione as bibliotecas para testes de unidade e de interface do Compose.”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
A skill lê seu catálogo de versões e os arquivos de build para descobrir o framework de injeção de dependência, os frameworks de teste, as ferramentas de mock e o tipo de interface. Depois ela adiciona as bibliotecas e os ambientes que faltam e que combinam com o projeto.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do 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
Perguntas frequentes
Ela escreve meus casos de teste?
A skill foca na configuração de testes e nos ambientes, então você ainda decide quais comportamentos testar.
Quais tipos de teste de captura de tela ela conhece?
Ela reconhece testes de captura de tela baseados em dispositivo e locais baseados em Robolectric ou LayoutLib.
Quais ferramentas de injeção de dependência ela reconhece?
Ela reconhece frameworks como Hilt, Koin, Anvil e Dagger puro.
Detalhes
Descrição original do 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
Popularidade
- Estrelas no GitHub
- 10 mil
- Posição no ranking
- #11937
- Licença
- Apache-2.0
- Atualizada em
- 29/10/2026
Comentários
- …
Mais skills deste repositório
agp-9-upgrade
10 milAjuda seu agente a atualizar um app Android para o Android Gradle Plugin 9 e resolver suas mudanças incompatíveis. Não serve para projetos multiplataforma.
camerax
10 milAjuda seu agente a criar recursos de câmera no Android com o CameraX, incluindo gravação de vídeo, controles de hardware, ML Kit e efeitos do Media3.
android-for-cars-parked-apps
10 milAjuda seu agente a adaptar um app Android de vídeo, jogo ou navegador para rodar como app estacionado no Android Auto e no Android Automotive.
appfunctions
10 milAjuda seu agente a encontrar fluxos de trabalho principais de um app Android e expô-los como AppFunctions que agentes de IA e comandos de voz podem executar.
Skills parecidas
test-driven-development
311 milEnsina seu agente a escrever primeiro um teste que falha, ver a falha e depois escrever o menor código que passa, antes de criar qualquer funcionalidade ou correção.
verification-before-completion
311 milEnsina seu agente a rodar verificações reais e ler a saída antes de afirmar que uma tarefa, correção ou build está concluído ou passando.
migrate-to-shoehorn
310 milSubstitui conversões de tipo arriscadas nos seus arquivos de teste pela biblioteca shoehorn, para que os testes usem dados parciais e ainda passem na checagem de tipos.