Detox

wixMIT活跃维护

面向移动 App 的灰盒端到端测试与自动化框架,支持 React Native、iOS 和 Android,让 UI 测试跑得稳、少 flaky。

Gray box end-to-end testing and automation framework for mobile apps

20.51.3发布于 2026-05-30 11:25 UTC12,054star +3 / 7 天1,903fork同步于 2026-11-10 11:28 UTC

怎么上手

由 README 提炼,执行前请确认
npm install --save-dev detox
硬件要求按 README 说明

README 未说明具体硬件或显存要求,仅说明测试运行在真实设备或模拟器上,其中设备运行暂不支持 iOS。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

面向 React Native 的灰盒端到端测试框架,用自动同步机制降低 E2E 测试的不稳定性

面向移动 App 的灰盒端到端测试与自动化框架,支持 React Native、iOS 和 Android,让 UI 测试跑得稳、少 flaky。

核心能力

  • 用灰盒方式在真机或模拟器上驱动 App 交互
  • 监控应用内异步操作自动同步,减少测试不稳定
  • 提供 async-await API,异步测试可正常断点调试
  • 跨平台支持 React Native 的 Android 与 iOS
  • 自带 Jest 集成,也可搭配任意测试运行器

容易踩的坑

README 未给出完整安装命令,需按官方 Getting Started 指南完成项目初始化配置;官方完整兼容的 React Native 版本为 v0.77.x 至 v0.84.x,更老版本不受官方支持;在真机上运行测试目前不支持 iOS。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本20.51.3
  1. 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

    Android

    • Wrapped Android WebView hierarchy injection in error handling so missing browser APIs, such as XmlSerializer in 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

    New Contributors

    Full Changelog: https://github.com/wix/Detox/compare/20.51.1...20.51.3

  2. 20.51.12026-05-03 · 2026-05-03 11:28 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/wix/Detox/compare/20.50.2...20.51.1

  3. 20.50.22026-04-21 · 2026-04-21 08:45 UTC
    查看更新说明
  4. 20.50.12026-03-23 · 2026-03-23 22:47 UTC
    查看更新说明
  5. 20.50.02026-03-23 · 2026-03-23 13:48 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/wix/Detox/compare/20.48.1...20.50.0

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    SWUbanner

    NPM Version NPM Downloads Build status Coverage Status Detox is released under the MIT license PR's welcome! Discord Twitter Follow

    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();
      });
    });
    

    Get started with Detox now!

    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

    Non-English Resources (Community)