ovidb / Detox

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

Home Page:https://wix.github.io/Detox/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SWUbanner

Detox

Detox

Gray box end-to-end testing and automation library 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', () => {
  it('should login successfully', async () => {
    await device.reloadReactNative();

    await element(by.id('email')).typeText('john@example.com');
    await element(by.id('password')).typeText('123456');
    await element(by.text('Login')).tap();

    await expect(element(by.text('Welcome'))).toBeVisible();
    await expect(element(by.id('email'))).toNotExist();
  });
});

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 cross-platform tests in JavaScript. Currently supports iOS and Android.
  • Runs on Devices (not yet supported on iOS): Gain confidence to ship by testing your app on a device/simulator just like a real user.
  • 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 without grief.
  • Test Runner Independent: Use Jest, Mocha, AVA, or any other JavaScript test runner you like (spoiler: we have our favorite).
  • Debuggable: Modern async-await API allows breakpoints in asynchronous tests to work as expected.

Supported Versions

Environment

  • OS: macOS 10.15 (Catalina) or higher
  • Xcode: 11.0 or higher
    • iOS Simulator Runtime: iOS 13.0 or higher

React Native

Detox is built from the ground up to support React Native projects as well as pure native ones.

The following React Native versions have been tested:

iOS Android
0.66.x - 0.69.5 0.66.x - 0.69.5 -
Visibility edge-case: see this RN issue *

Future versions are most likely supported, but have not been tested yet. Please open issues if you find specific issues with newer React Native versions.

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)

About

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

https://wix.github.io/Detox/

License:MIT License


Languages

Language:JavaScript 66.6%Language:Objective-C 10.7%Language:Kotlin 9.4%Language:Java 7.4%Language:Swift 3.9%Language:Shell 0.8%Language:TypeScript 0.7%Language:Objective-C++ 0.3%Language:CSS 0.1%Language:Starlark 0.1%Language:Ruby 0.1%Language:C 0.0%