Mobile — Testing Frameworks
Unit, integration, UI, and E2E testing across iOS, Android, RN, Flutter, KMP.
Mobile testing splits into three layers: unit / integration (per-platform), UI tests (per-platform or cross-platform), and full E2E flows (cross-platform tools dominate in 2026). For visual / snapshot testing see Mobile — Snapshot Testing. For real-device testing see Mobile — Cloud Test Labs.
iOS / Swift
- ★ Swift Testing (
@Test) — Apple's macro-based framework; default in Xcode 16+. - XCTest — older framework; still required for
XCUITest-based UI tests. - XCUITest — accessibility-driven UI tests; runs on simulator and device.
- Quick + Nimble — BDD / matcher style; less common in the Swift Testing era.
- swift-snapshot-testing — see Mobile — Snapshot Testing.
Android / Kotlin
- JUnit 4 / 5 — unit tests; JUnit 5 increasingly default.
- Robolectric — JVM-side Android tests; fast feedback.
- Espresso — instrumented UI tests for the View system.
- Compose UI tests (
createComposeRule) — Compose's built-in testing. - MockK — Kotlin-first mocking. Apache 2.0.
- Mockito-Kotlin — Mockito with Kotlin niceties.
- Turbine — test Flow values cleanly.
- Truth / AssertK — fluent assertions.
Cross-platform UI / E2E
- ★ Maestro — YAML-driven flows; cross-platform; runs on iOS, Android, RN, Flutter, native, hybrid. Free / OSS core, paid Maestro Cloud. The default in 2026 for E2E.
- ★ Appium — long-running Selenium-shape WebDriver for mobile; works with everything; Apache 2.0.
- Detox (Wix) — RN E2E; still maintained, less hot than Maestro.
- Patrol — Flutter E2E with native interaction; the recommended choice for Flutter native flows.
- EarlGrey 2 (Google) — iOS UI tests; less common.
Game / canvas-heavy apps
- For Skia / OpenGL / Compose Canvas apps, snapshot tests via Paparazzi or pixel-diff tooling.
RN-specific
- ★ Jest — unit / component tests (RN ships with it).
- react-native-testing-library — component-level testing.
- Detox — RN E2E.
- Maestro — E2E flows.
Flutter-specific
- ★ flutter_test — built-in unit + widget tests.
- ★ integration_test — official E2E.
- patrol — native-interactive E2E.
- golden_toolkit / alchemist — golden file testing.
KMP / Compose Multiplatform
- kotlin.test — multiplatform.
- Compose UI tests (
runComposeUiTest) — multiplatform on iOS + Android. - kotest — for richer assertion / property-test layer.
Mocking / fakes
- MockK (Kotlin), Mockito (Java), swift-mockable, Cuckoo (Swift), Mockingbird (Swift), MSW (RN networking mocks).
Network mocking
- WireMock — JVM HTTP mock.
- MockServer — language-agnostic.
- Mockoon — local mock API GUI.
- See api-clients for desktop mocking.
Pick this if…
- iOS unit tests, new project: Swift Testing + swift-snapshot-testing.
- Android unit tests: JUnit 5 + MockK + Turbine + Robolectric for fast feedback.
- Cross-platform E2E flows: Maestro for almost any stack in 2026.
- Flutter native flows: patrol; otherwise integration_test.
- RN component tests: Jest + react-native-testing-library; flows in Maestro.
- Snapshot testing: see Mobile — Snapshot Testing.