README 未给出完整安装命令,需按官方 Getting Started 指南完成项目初始化配置;官方完整兼容的 React Native 版本为 v0.77.x 至 v0.84.x,更老版本不受官方支持;在真机上运行测试目前不支持 iOS。
Detox
wixMIT活跃维护面向移动 App 的灰盒端到端测试与自动化框架,支持 React Native、iOS 和 Android,让 UI 测试跑得稳、少 flaky。
Gray box end-to-end testing and automation framework for mobile apps
npm install --save-dev detoxREADME 未说明具体硬件或显存要求,仅说明测试运行在真实设备或模拟器上,其中设备运行暂不支持 iOS。
面向 React Native 的灰盒端到端测试框架,用自动同步机制降低 E2E 测试的不稳定性
面向移动 App 的灰盒端到端测试与自动化框架,支持 React Native、iOS 和 Android,让 UI 测试跑得稳、少 flaky。
核心能力
- 用灰盒方式在真机或模拟器上驱动 App 交互
- 监控应用内异步操作自动同步,减少测试不稳定
- 提供 async-await API,异步测试可正常断点调试
- 跨平台支持 React Native 的 Android 与 iOS
- 自带 Jest 集成,也可搭配任意测试运行器
容易踩的坑
- 20.51.3最新正式版2026-05-30 · 2026-05-30 11:25 UTC
This release focuses on stability fixes across iOS, Android, synchronization reporting, and simulator tooling.
iOS
- Fixed
element(...).atIndex(n).getAttributes()so it now respects the requested index instead of returning attributes for all matching elements. Thanks @vazidmansuri005 in https://github.com/wix/Detox/pull/4912 - Fixed biometric simulation on iOS 26+ by using the newer
applesimutils --bootedbiometric flags while preserving the previous behavior for older iOS versions. Thanks @SoaringEarth in https://github.com/wix/Detox/pull/4932 - Updated the iOS attribute error formatting around indexed lookups. Thanks @markdevocht in https://github.com/wix/Detox/pull/4947 and https://github.com/wix/Detox/pull/4948
- Bumped DetoxSync to include an upstream fix for a native iOS
NSURLSessiontracking race that could cause SIGSEGV crashes during network task teardown. The upstream fix makes URLSession untracking thread-safe and idempotent. Upstream: https://github.com/wix-incubator/DetoxSync/pull/100 Bump: https://github.com/wix/Detox/pull/4952
Android
- Wrapped Android WebView hierarchy injection in error handling so missing browser APIs, such as
XmlSerializerin hardened JavaScript environments, do not leak unexpected errors into tests. Thanks @FrederikBolding in https://github.com/wix/Detox/pull/4943 - Quoted ADB device serials in shell-built commands, fixing Wi-Fi and mDNS serials that contain shell-sensitive characters such as parentheses. Thanks @omribz156 in https://github.com/wix/Detox/pull/4950
Synchronization
- Updated sync status parsing and formatting to accept
nullone-time event objects from iOS payloads. Thanks @omribz156 in https://github.com/wix/Detox/pull/4949
New Contributors
- @SoaringEarth made their first contribution in https://github.com/wix/Detox/pull/4932
- @FrederikBolding made their first contribution in https://github.com/wix/Detox/pull/4943
- @omribz156 made their first contribution in https://github.com/wix/Detox/pull/4949
Full Changelog: https://github.com/wix/Detox/compare/20.51.1...20.51.3
- Fixed
- 20.51.12026-05-03 · 2026-05-03 11:28 UTC
查看更新说明
What's Changed
- fix of screenshots of the navigation bar on iOS 26 by @markdevocht in https://github.com/wix/Detox/pull/4938
- CI publish script update for correct version handling by @markdevocht in https://github.com/wix/Detox/pull/4939
Full Changelog: https://github.com/wix/Detox/compare/20.50.2...20.51.1
- 20.50.22026-04-21 · 2026-04-21 08:45 UTC
查看更新说明
What's Changed
- RN0.84 by @markdevocht in https://github.com/wix/Detox/pull/4926
Full Changelog: https://github.com/wix/Detox/compare/20.50.1...20.50.2
- 20.50.12026-03-23 · 2026-03-23 22:47 UTC
查看更新说明
What's Changed
- fix by @markdevocht in https://github.com/wix/Detox/pull/4925
Full Changelog: https://github.com/wix/Detox/compare/20.50.0...20.50.1
- 20.50.02026-03-23 · 2026-03-23 13:48 UTC
查看更新说明
What's Changed
- iOS 26.1 implementation of liquidGlass overlay by @markdevocht in https://github.com/wix/Detox/pull/4921
- version bump by @markdevocht in https://github.com/wix/Detox/pull/4922
Full Changelog: https://github.com/wix/Detox/compare/20.48.1...20.50.0
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
What Does a Detox Test Look Like?
This is a test for a login screen, it runs on a device/simulator like an actual user:
describe('Login flow', () => {
beforeEach(async () => {
await device.reloadReactNative();
});
it('should login successfully', async () => {
await element(by.id('email')).typeText('[email protected]');
await element(by.id('password')).typeText('123456');
const loginButton = element(by.text('Login'));
await loginButton.tap();
await expect(loginButton).not.toExist();
await expect(element(by.label('Welcome'))).toBeVisible();
});
});
About
High velocity native mobile development requires us to adopt continuous integration workflows, which means our reliance on manual QA has to drop significantly. Detox tests your mobile app while it’s running in a real device/simulator, interacting with it just like a real user.
The most difficult part of automated testing on mobile is the tip of the testing pyramid - E2E. The core problem with E2E tests is flakiness - tests are usually not deterministic. We believe the only way to tackle flakiness head on is by moving from black box testing to gray box testing. That’s where Detox comes into play.
- Cross Platform: Write end-to-end tests in JavaScript for React Native apps (Android & iOS).
- Debuggable: Modern async-await API allows breakpoints in asynchronous tests to work as expected.
- Automatically Synchronized: Stops flakiness at the core by monitoring asynchronous operations in your app.
- Made For CI: Execute your E2E tests on CI platforms like Travis CI, Circle CI or Jenkins without grief.
- Runs on Devices: Gain confidence to ship by testing your app on a device/simulator just like a real user (not yet supported on iOS).
- Test Runner Agnostic: Detox provides a set of APIs to use with any test runner without it. It comes with Jest integration out of the box.
Supported React Native Versions
Detox was built from the ground up to support React Native projects.
While Detox should work out of the box with any React Native version of the latest minor releases, the official versions compatibility is provided according to the following:
- RN
v0.77.x-v0.84.x: Fully compatible with React Native's "New Architecture". Newer RN versions might work with Detox, but they've not been thoroughly tested by the Detox team yet.
Although we do not officially support older React Native versions, we do our best to keep Detox compatible with them.
In case of a problem with an unsupported version of React Native, please submit an issue or write us in our Discord server and we will do our best to help out.
Known Issues with React Native
- Visibility edge-case on Android: see this RN issue.
Get Started with Detox
Read the Getting Started Guide to get Detox running on your app in less than 10 minutes.
Documents Site
Explore further about using Detox from our new website.
Core Principles
We believe that the only way to address the core difficulties with mobile end-to-end testing is by rethinking some of the principles of the entire approach. See what Detox does differently.
Contributing to Detox
Detox has been open-source from the first commit. If you’re interested in helping out with our roadmap, please see issues tagged with the label. If you have encountered a bug or would like to suggest a new feature, please open an issue.
Dive into Detox core by reading the Detox Contribution Guide.
License
- Detox is licensed under the MIT License