Detox
Gray-box end-to-end testing for React Native. More reliable than black-box tools by synchronising with the app's JavaScript thread.
Overview
Detox, created by Wix in 2017, is an end-to-end testing framework specifically designed for React Native applications. Unlike black-box tools like Appium that interact with the UI from the outside, Detox is a gray-box framework that synchronises with the React Native JavaScript thread. This means Detox waits for the app to be idle before executing the next test step, eliminating the flakiness caused by race conditions.
Detox has become the standard E2E testing tool for React Native teams that outgrow Appium or need more reliable test execution.
What it's used for
Detox is ideal when:
- React Native app: Purpose-built for React Native with deep framework integration.
- Test flakiness is a problem: Gray-box synchronisation dramatically reduces flaky tests.
- CI reliability needed: Tests that pass locally also pass in CI without timing tweaks.
- Fast feedback loop: Hot-reload support during test development.
Pros & Cons
Pros
- Gray-box synchronisation eliminates timing flakiness
- Built specifically for React Native
- Fast test execution with hot-reload support
- Cross-platform: tests run on both iOS and Android
- Active community with regular updates
Cons
- React Native only — not for native Android/iOS or Flutter
- Requires some native build knowledge for setup
- Debugging failing tests can be complex
- Smaller ecosystem than Appium
- iOS setup requires macOS
Platforms & Integrations
Detox runs on macOS (for iOS tests) and Windows/Linux (for Android tests). It requires Node.js, React Native CLI, and native development tools.
Pricing
| Tier | Cost | Includes |
|---|---|---|
| Open Source | Free | Full framework, all features, community support |
NZ Context
Detox is popular among NZ React Native teams, particularly in startups using cross-platform mobile development. Companies like Serko (travel tech) have used Detox for mobile app testing. For NZ teams choosing between Appium and Detox for React Native, Detox is generally preferred for reliability.
Alternatives
- Appium — More flexible (works with any mobile stack) but less reliable for React Native.
- Maestro — Modern cross-platform testing with simpler setup than Appium.
- XCUITest / Espresso — Native frameworks for iOS/Android. Best for native-only teams.