
Automated UI tests for mobile apps have a reputation problem: they fail randomly. A test taps a button before the screen has finished loading, or checks a value while a network request is still running, and the team learns to rerun failures until they pass. Detox was built at Wix to remove that cause of flakiness in React Native apps. Instead of guessing how long to wait, it watches what the app is doing and acts only when the app is idle.
This article explains what Detox is, how its gray box synchronisation works, where it fits in a React Native test strategy, where its limits are, and how it compares with Appium, Maestro and the platforms' own test frameworks.
What is Detox?
Detox is an open-source framework for E2E (whole-flow) testing of React Native apps on iOS and Android. Tests are written in JavaScript, run against the real app on a simulator, an emulator or an Android device, and interact with it the way a user would: tapping, typing, scrolling and checking what is on screen. It is developed by Wix and released under the MIT licence.
Wix engineers built Detox to deal with flaky tests in their own React Native apps, following the in-process approach of Google's Espresso on Android and EarlGrey on iOS. The first release under Wix's name was published to npm on 19 June 2016, as version 2.0.0 because the package name had belonged to an unrelated project before. Detox has been developed continuously since, and recent versions support React Native's New Architecture.
The term "gray box" is what sets it apart. A black box tool such as Appium drives the app purely from the outside. Detox also drives the app like a user, but it has a component inside the app that can see its internal state, which is what makes reliable waiting possible.
How Detox works
Configuration and builds. A Detox configuration file describes how to build the app and which device to run it on, for example a debug build on an iPhone simulator and a release build on an Android emulator. Detox builds the app, installs it, launches it and connects to it before each test file runs.
Automatic synchronisation. This is the core idea. Before every action and assertion, Detox checks whether the app is busy: network requests in flight, animations running, timers pending, work queued on the JavaScript thread. It continues only when the app is idle. Tests therefore do not need sleep calls or hand-tuned timeouts, and the main source of random failures disappears.
Tests in JavaScript. Detox is runner agnostic, with Jest integration out of the box, so most teams write tests with Jest. A test finds an element with a matcher such as by.id('login-button'), performs an action such as tap() or typeText(), and checks the result with an expectation such as toBeVisible(). Elements are usually found through the testID property that developers add to React Native components.
Device control. The device API reloads the app, relaunches it with a clean state, sends it to the background, opens deep links, sets permissions or a location, and can tell Detox to ignore specific network endpoints that would otherwise keep the app permanently "busy".
Key features
- Gray box synchronisation that waits for the app to be idle, which removes most flakiness.
- Fast runs, because the test runner talks to the app directly and does not poll for elements.
- JavaScript tests that fit naturally into a React Native codebase and its Jest setup.
- iOS simulators, Android emulators and Android devices, locally or in CI.
- Artifacts on failure: screenshots, videos, logs and timelines for debugging.
- Parallel execution across several simulators or emulators to shorten CI time.
Where Detox is used
- React Native apps that need a regression suite for their critical flows: sign-up, login, onboarding, checkout, payments.
- Release gates in CI, where a pull request cannot be merged until the main flows pass, in pipelines such as GitHub Actions or Bitbucket Pipelines.
- Teams where developers own the tests, because the tests live in the same repository and language as the app.
- Consumer apps with frequent releases, where a broken flow in production is expensive.
When to choose Detox, and when not to
Choose Detox when:
- The app is built with React Native, and developers will write and maintain the tests.
- Flaky tests have been a problem, and you want stability without adding waits by hand.
- Fast feedback in CI matters, for example running the main flows on every pull request.
Look elsewhere when:
- The app is not a React Native app. Detox is built for React Native; for native apps use Espresso or XCUITest, for Flutter apps use Flutter's own integration tests.
- You need tests on physical iPhones or a cloud device farm with many models. Detox does not support real iOS devices; Appium does.
- QA engineers want to write tests in Java or Python, or one suite must cover apps built with different technologies. Appium fits that better.
- You only need to test components in isolation. React Native Testing Library is faster for that layer.
Detox has its own costs. Setup involves native build configuration for both platforms, iOS tests need a macOS machine, and synchronisation can stall when an app has endless animations or constant polling, which then has to be excluded explicitly.
Detox and its alternatives
| Tool | Approach | Language | Best fit |
|---|---|---|---|
| Detox | Gray box, automatic synchronisation | JavaScript | React Native apps tested by developers |
| Appium | Black box, WebDriver | Java, Python, JS, C#, Ruby | Cross-platform QA suites, real device farms |
| Maestro | Black box, YAML flows | YAML | Quick, readable flow tests |
| Espresso / XCUITest | In-process, platform native | Kotlin, Java / Swift | Native Android or iOS apps |
| React Native Testing Library | Component tests, no device | JavaScript | Testing components in isolation |
The most common comparison is Detox vs Appium. Detox is faster and more stable for React Native apps because it synchronises with the app; Appium is slower but supports every kind of app, physical iOS devices and many programming languages. Many React Native teams use both: Detox for developer-owned checks on every pull request, Appium for a broader device-coverage suite before releases.
How we use Detox at Internative
We use Detox to validate the critical user journeys in mobile applications. Its stability and close integration with React Native give us confidence before each release and help us stop regressions before they reach production.
If you are building a React Native app and want its key flows tested automatically on every change, our mobile application development team can help you set up Detox and the pipeline that runs it.
Frequently asked questions
What is Detox testing?
Detox testing means running automated E2E tests on a React Native app with the Detox framework. A test launches the real app on a simulator or emulator, performs user actions such as taps and typing, and checks the result, while Detox waits automatically until the app is idle between steps.
Is Detox only for React Native?
Detox was built for React Native and its documentation and tooling target React Native apps on iOS and Android. It is not the right tool for fully native apps or Flutter apps; Espresso, XCUITest, Flutter's integration tests or Appium fit those better.
What is the difference between Detox and Appium?
Detox is a gray box tool that runs alongside a React Native app and knows when it is idle, so tests are fast and stable. Appium is a black box tool based on WebDriver that works with any mobile app and many languages, at the cost of speed and more manual waiting.
Does Detox run on real devices?
On Android, Detox runs on emulators and physical devices. On iOS it runs on simulators; real iPhones are not supported. Teams that need real iOS device coverage usually add Appium on a device farm.
Is Detox free?
Yes. Detox is open source under the MIT licence and free to use in commercial projects. The costs are the CI machines that run the tests, including macOS machines for iOS.
Keep reading
The articles that follow this one.



