Detox
Gray box end-to-end testing and automation framework for mobile apps
An end-to-end testing framework for React Native apps on iOS and Android that writes tests in JavaScript and eliminates flaky test results by monitoring the app's internal state before each simulated user action.
Detox is an end-to-end testing framework for mobile apps, built specifically for React Native projects that run on both Android and iOS. It lets developers write automated tests in JavaScript that interact with a real device or simulator the same way a person would, tapping buttons, typing text, and checking what appears on screen.
The main problem Detox tries to solve is flakiness in automated tests. Flaky tests are ones that sometimes pass and sometimes fail for no obvious reason, making it hard to trust them. Detox addresses this by using a technique the team calls gray box testing: instead of treating the app as a black box and only poking at it from the outside, Detox can also monitor what is happening inside the app, particularly its asynchronous operations, which are background tasks that run after a user action. When the app is still busy internally, Detox waits before taking the next step, which removes the main cause of unpredictable test results.
Because it is designed for continuous integration workflows, Detox works well in automated build pipelines like Travis CI, CircleCI, or Jenkins. Teams that ship mobile apps frequently and rely on automated checks rather than manual QA are the primary audience.
Tests are written in JavaScript using an async/await style, meaning each step is written in sequence and the test pauses naturally until each action finishes. The framework works with Jest out of the box, though it is designed to be compatible with other test runners as well.
The project is maintained by Wix and is released under the MIT license, meaning it is free to use and modify. The README is concise: it covers what Detox does, shows a short code sample of a login test, lists which React Native versions are officially supported, and points to a documentation site for full setup instructions.
Where it fits
- Automate a login flow test on your React Native app that taps the email field, types credentials, taps Login, and asserts the home screen appears.
- Run end-to-end tests on every pull request in a CI pipeline like GitHub Actions so regressions are caught before merging.
- Replace manual QA tapping sessions on a device emulator with a scripted test suite that covers critical user journeys.