Skip to content

End-to-end testing in React Native with Detox for Windows environment

Notifications You must be signed in to change notification settings

jmr85/react-native-detox

Repository files navigation

It is a fork of the Detox Demo Project

React Native Detox

Requirements

  • Windows 8 or 10.
  • Have Node installed.
  • Make sure you have react-native dependencies installed:
    • react-native-cli is installed (npm install -g react-native-cli)

Step 1: Configure emulator name and Npm install

  • replace the name of the emulator where it says the "name": inside package.json.
"android.emu.debug": {
   "binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
   "build": "cd android && gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..",
   "type": "android.emulator",
   "name": "Nexus_9_API_28"
},
"android.emu.release": {
   "binaryPath": "android/app/build/outputs/apk/release/app-release.apk",
   "build": "cd android && gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..",
   "type": "android.emulator",
   "name": "Nexus_9_API_28"
}
  • Make sure you're in folder /react-native-detox.
  • Run npm install.

To test Release build of your app

Step 2: Build

  • Build the demo project for ios
detox build --configuration ios.sim.release
  • Build the demo project for android
detox build --configuration android.emu.release

Step 3: Test

  • Run tests on the demo project for ios
detox test --configuration ios.sim.release
  • Run tests on the demo project for android
detox test --configuration android.emu.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 for ios
detox build --configuration ios.sim.debug
  • Build the demo project for android
detox build --configuration android.emu.debug

Step 3: Test

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

Build and Test more simple in CMD

  • Build and Test the demo project for ios
detox build --configuration ios.sim.release && detox test --configuration ios.sim.release
  • Build and Test the demo project for android
detox build --configuration android.emu.release && detox test --configuration android.emu.release

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

About

End-to-end testing in React Native with Detox for Windows environment

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published