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
What is this?Detox is a gray box end-to-end testing and automation framework for React Native mobile apps. It runs your tests against a real device or simulator, interacting with the app the way an actual user would.
Is this a standalone testing app or something I add to my project?It is a JavaScript testing framework/library that you add to your React Native project and pair with a test runner (Jest comes integrated out of the box).
How do I get Detox running on my app?Follow the official Getting Started Guide, which walks you through adding Detox to a React Native project and running your first test in under 10 minutes.
Does it only work with React Native apps?Yes, Detox was built from the ground up specifically for React Native and is officially tested against RN v0.77.x through v0.84.x, including full compatibility with the New Architecture.
Can I run tests on a real iOS device, or only a simulator?Running on a real device works for Android, but running on an actual device/simulator setup is noted as not yet supported on iOS; there's also a known visibility edge-case bug on Android.
Who is this built for?It's aimed at React Native teams who need reliable automated E2E tests as part of a continuous integration workflow, instead of relying on manual QA.
Which mobile platforms does Detox target?Detox tests apps on both Android and iOS, writing the test code itself in JavaScript.
What makes Detox different from black-box testing tools?Detox uses a gray box approach, monitoring your app's asynchronous operations directly instead of guessing with timeouts and sleeps. The README argues this is the only way to kill flakiness at the source, which is the core problem with most E2E mobile tests.
Can I run Detox tests on CI platforms?Yes, Detox is explicitly built to run on CI services like Travis CI, Circle CI, or Jenkins without extra hassle.
Do I need to use Jest as my test runner?No, Detox exposes its APIs to work with any test runner, but it ships with Jest integration already set up for convenience.
Will Detox work if my app uses an older React Native version?Detox isn't officially tested against older React Native releases, but the maintainers try to keep it compatible and ask you to open an issue or reach out on Discord if something breaks.
Creator
wix
Size
75.5 MB
Stars
12K
Age
10y
Commits · 90 Days