Skip to content

Latest commit

 

History

History
66 lines (41 loc) · 1.37 KB

README.md

File metadata and controls

66 lines (41 loc) · 1.37 KB

Detox End-To-End Testing

Setup

To get your Detox tests up and running, you'll need to install some global dependencies:

  1. Install the latest version of Homebrew
  2. Make sure you have Node installed (at least 8.6.0). If you don't:

If you use NVM:

nvm install node

Or if you'd prefer to install directly from Homebrew

brew update && brew install node
  1. Install `applesimutils, which will allow Detox to communicate with the iOS simulator:
brew tap wix/brew && brew install applesimutils
  1. Install the Detox CLI
  yarn global add detox-cli

Adding tests

We've gotten you started with ./e2e/firstTest.spec.js, which tests that the two main example screens render properly.

Note that in order to pick up elements by ID, we've added the testID prop to the component.

Running tests

  1. Start the packager
yarn start

(Expo-only note: for testing production code, start the packager with yarn start --no-dev --minify)

  1. Run the app

In a separate terminal window from the packager:

yarn build:e2e

(Expo-only note: this is unnecessary for Expo apps)

  1. Run the tests
yarn test:e2e

For more information, make sure to check out the official Detox Docs