Skip to content

patniko/detox-appcenter

Repository files navigation

Detox on AppCenter React Native Demo Project

Background

This sample project demonstrates running Detox tests prior to a regular MS AppCenter build

  • on React Native 0.56.0
  • with Detox 9.1.2 built by Xcode 10.1 Build status
  • and Mocha 5.2.0 test runner, currently

This project has also run Detox tests successfully from AppCenter with:-

  • Detox 9.1.2 built by Xcode 9.4.1 Build status
  • or Detox 9.0.4 built by Xcode 10.1 Build status
  • or Detox 9.0.4 built by Xcode 9.4.1 Build status

Requirements

Make sure you have installed:

  • Xcode (tested with Xcode 9.4.1 and Xcode 10.1)
  • xcpretty (gem install xcpretty - https://github.com/supermarin/xcpretty)
  • Node.js (brew install node@8 or nvm install. Node version 8.X or newer is required)
  • react-native dependencies:
    • watchman is installed (brew install watchman)

See software installation commands in appcenter-post-clone.sh for any other dependencies that may need to be installed to build and run this project anywhere other than in MS AppCenter.

Step 1: Install Dependencies

  • Run npm install.

To test Release build of your app

Step 2: Build

  • Build the demo project
npx detox build --configuration ios.sim.release

Step 3: Test

  • Run tests on the demo project
npx detox test --configuration ios.sim.release

This action will open a new simulator and run the tests on it.

To test Debug build of your app

Step 2: Build

  • Build the demo project
npx detox build --configuration ios.sim.debug

Step 3: Test

  • start react-native packager
npm run start
  • Run tests on the demo project
npx detox test --configuration ios.sim.debug

This action will open a new simulator and run the tests on it.