mobile-testing
Use when the user asks about mobile testing: unit tests, widget or component tests, Espresso, XCUITest, Maestro, Detox, snapshot/golden tests, mocking or…
от j4flmao★ 47 звёзд на GitHub
Установить mobile-testing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Mobile Testing
Purpose
Design comprehensive mobile test strategies following the test pyramid — unit, widget/component, integration, and E2E — with proper mocking, golden tests, and CI integration.
Agent Protocol
Trigger
User request includes: mobile test, mobile testing, unit test mobile, widget test, component test, ui test mobile, e2e mobile, golden test, snapshot test mobile.
Input Context
- Platform (iOS, Android, Flutter, React Native)
- Testing framework (XCTest, JUnit, flutter_test, Jest)
- CI provider (GitHub Actions, Bitrise, GitLab CI)
Output Artifact
A markdown document containing:
- Test strategy (pyramid)
- Framework setup
- Key test examples
- CI pipeline integration
Response Format
No preamble. No postamble. No explanations.
Max Response Length
4096 tokens
Decision Trees
Test Type Selection
What are you testing?
├── Business logic (UseCase, calculator, validator)
│ └── Unit test — pure logic, no UI, fast, deterministic
├── ViewModel state management (state transitions, events)
│ └── Unit test with mocked dependencies — no UI rendering
├── UI component rendering (displays correct data in states)
│ ├── Flutter → Widget test (pumpWidget, find, expect)
│ ├── SwiftUI → snapshot tests (swift-snapshot-testing) or ViewInspector (third-party)
│ ├── Jetpack Compose → Compose UI test (`createComposeRule`, semantics tree finders)
│ └── React Native → React Native Testing Library
├── Visual regression (design fidelity)
│ └── Golden/snapshot test — compare rendered UI to reference image
├── Feature flow (login → navigate → action)
│ ├── Integration test — multiple components, mocked API/DB
│ └── Avoid full E2E for speed
└── Critical user journey (checkout, signup, payment)
└── E2E test — real device/emulator, real API/staging
Mock Strategy
What needs mocking?
├── Network calls → Mock API responses (Mockito/mocktail/OHHTTPStubs)
├── Database/DAO → In-memory database or mock DAO
├── Platform channels (Flutter) → Mock channel handlers
├── System services (location, camera, biometrics)
│ ├── Mock per test (unit) OR fake service (integration)
│ └── Avoid mocking what you don't own (platform SDKs)
└── Time/date → Inject clock dependency, use fake timers
CI Test Strategy
What CI stage?
├── Every PR (fast, <10min) → Unit + widget/component tests
├── Nightly (slow, <60min) → Integration tests + golden tests
├── Pre-release (manual trigger) → Full E2E suite on device farm
└── Post-release → Smoke tests on production (canary)
Workflow
Step 1: Define Test Strategy
Apply the mobile test pyramid: many unit/widget tests, medium integration tests, few E2E critical journeys.
Step 2: Write Unit Tests
Cover business logic, use cases, repositories, and utilities with mocked dependencies and parameterized edge cases.
Step 3: Write Widget/Component Tests
Test UI components with mock data, verify rendering, interactions, and state transitions.
Step 4: Write Integration Tests
Test feature flows combining multiple components, real API mocking, and database interactions.
Step 5: Write E2E Tests
Cover critical user journeys (login, purchase, order flow) on real devices or emulators.
Step 6: Integrate in CI
Run unit + widget tests on every PR, integration nightly, E2E before release.
Rules
- Unit tests cover business logic — never test framework behavior
- Mock external dependencies (network, DB, platform channels) in unit tests
- One test file per source file — mirror the source structure
- Widget tests verify states: loading, error, empty, data
- Golden/snapshot tests for visual regression on critical screens
- E2E tests are for critical journeys only — max 5-10 per platform
- Tests must be deterministic — no time-dependent assertions without mocking time
- Code coverage threshold: 80% unit, 70% widget, 60% integration
- Never test private methods directly — test through public API
- Test boundary conditions: empty lists, null values, max values
Test Pyramid
╱╲
╱E2E╲ Few — critical journeys only (5-10)
╱─────╲
╱Integration╲ Medium — feature flows (20-50)
╱─────────────╲
╱ Unit / Widget ╲ Many — every class, every widget state (200+)
╱─────────────────╲
Unit Tests
Android — JUnit + MockK
class GetOrdersUseCaseTest {
private val repository = mockk<OrderRepository>()
private val useCase = GetOrdersUseCase(repository)
@Test
fun `returns orders from repository`() = runTest {
val orders = listOf(Order("1", "Test"))
coEvery { repository.getOrders() } returns Result.success(orders)
val result = useCase()
assertTrue(result.isSuccess)
assertEquals(orders, result.getOrNull())
}
@Test
fun `returns error when repository fails`() = runTest {
coEvery { repository.getOrders() } returns Result.failure(NetworkException("timeout"))
val result = useCase()
assertTrue(result.isFa
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/integration-testing.md
- references/manual-testing.md
- references/mobile-testing-strategies.md
- references/test-automation-frameworks.md
- references/ui-testing.md
- references/unit-testing.md
FAQ
Что делает скилл mobile-testing?
Use when the user asks about mobile testing: unit tests, widget or component tests, Espresso, XCUITest, Maestro, Detox, snapshot/golden tests, mocking or running device tests in CI. Produces a test pyramid and runnable test examples. Not for web end-to-end tests (use quality-e2e-testing).
Как установить скилл mobile-testing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл mobile-testing запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…