Detox README

The project's README from github.com/wix/Detox. As one markdown file: README.md.

SWUbanner

Detox

Detox

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

Demo

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.

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:

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

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)

Detox (wix/Detox)

Searching Database…

12K ·GitHub
这是什么?Detox 是一个面向 React Native 移动应用的灰盒端到端测试与自动化框架。它在真实设备或模拟器上运行测试,像真正的用户一样与应用交互。
这是独立的测试应用,还是需要我添加到项目中的东西?它是一个 JavaScript 测试框架/库,你把它添加到 React Native 项目中,并与测试运行器搭配使用(Jest 已开箱即用集成)。
我该如何在我的应用中运行 Detox?按照官方的 Getting Started Guide(入门指南)操作,它会带你把 Detox 添加到 React Native 项目中,并在 10 分钟内运行第一个测试。
它只能用于 React Native 应用吗?是的,Detox 从一开始就专为 React Native 打造,官方测试覆盖 RN v0.77.x 至 v0.84.x,并完整兼容新架构(New Architecture)。
我可以在真实的 iOS 设备上运行测试,还是只能用模拟器?在真实设备上运行适用于 Android,但官方说明在 iOS 上尚不支持真实设备/模拟器的这种配置;另外,Android 上还有一个已知的可见性边界情况 bug。
这个工具是为谁设计的?它面向需要可靠自动化端到端测试、并将其纳入持续集成工作流的 React Native 团队,而不是依赖人工 QA。
Detox 支持哪些移动平台?Detox 同时测试 Android 和 iOS 应用,测试代码本身使用 JavaScript 编写。
Detox 和黑盒测试工具有什么不同?Detox 采用灰盒方式,直接监控应用的异步操作,而不是靠超时和休眠去猜测。README 认为,这是从根源上消除不稳定性的唯一方法,而不稳定性正是大多数移动端端到端测试的核心问题。
我能在 CI 平台上运行 Detox 测试吗?可以,Detox 明确设计为可以在 Travis CI、Circle CI 或 Jenkins 等 CI 服务上运行,无需额外折腾。
我必须使用 Jest 作为测试运行器吗?不必,Detox 的 API 可与任何测试运行器配合使用,但它自带了预先配置好的 Jest 集成,方便使用。
如果我的应用使用较旧的 React Native 版本,Detox 还能用吗?Detox 没有在较旧的 React Native 版本上进行官方测试,但维护者会尽量保持兼容性;如果出现问题,欢迎提交 issue 或在 Discord 上联系他们。
Creator
wix
Size
75.5 MB
Stars
12K
Age
10y
Commits · 90 Days