Skip to content

wix/Detox

Repository files navigation

detox

Build Status

Graybox E2E tests and automation library for mobile

Why?

High velocity native mobile development requires us to adopt continuous integration workflows, which means our reliance on manual QA has to drop significantly. 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 blackbox testing to graybox testing and that's where detox comes into play.

Development still in progress!

Please note that this library is still pre version 1.0.0 and under active development. The NPM version is higher because the name "detox" was transferred to us from a previous inactive package.

Wanna see it in action??

Open the React Native demo project and follow the instructions

Not using React Native? you now have a pure native demo project too

Wanna try it with your own project?

See the Installing instructions

Wanna learn the API for writing tests?

See Detox's own E2E test suite to learn the test API by example

Dealing with flakiness

See the Flakiness handbook

Contributing to detox

If you're interested in working on detox core and contributing to detox itself, take a look here.

Some implementation details

  • We let you write your e2e tests in JS (they can even be cross-platform)
  • We use websockets to communicate (so it should be super fast and bi-directional)
  • Both the app and the tester are clients, so we need the server to proxy between them
  • We are relying on EarlGrey as our gray-box native library for iOS (espresso for Android later on)
  • The JS tester controls EarlGrey by remote using a strange JSON protocol
  • Instead of wrapping the zillion API calls EarlGrey supports, we implemented a reflection mechanism
  • So the JS tester in low level actually invokes the native methods.. freaky
  • We've abstracted this away in favor of a protractor-like api, see demo-react-native/e2e/example.spec.js
  • See everything EarlGrey supports here and in this cheatsheet
  • We use fbsimctl to control the simulator from the test, restart the app, etc

License

  • detox by itself and all original source code in this repo is MIT
  • detox relies on some important dependencies, their respective licenses are: