diff --git a/RNTester/README.md b/RNTester/README.md index b612a3215..0ad426778 100644 --- a/RNTester/README.md +++ b/RNTester/README.md @@ -58,6 +58,29 @@ Run the following commands from the react-native folder: _Note: The native libs are still built using gradle. Full build with buck is coming soon(tm)._ +## Running Detox Tests on iOS + +Install Detox from [here](https://github.com/wix/Detox/blob/master/docs/Introduction.GettingStarted.md). + +To run the e2e tests locally, run the following commands from the react-native folder: + + yarn build-ios-e2e + yarn test-ios-e2e + +These are the equivalent of running: + + detox build -c ios.sim.release + detox test -c ios.sim.release --cleanup + +These build the app in Release mode, so the production code is bundled and included in the built app. + +When developing E2E tests, you may want to run in development mode, so that changes to the production code show up immediately. To do this, run: + + detox build -c ios.sim.debug + detox test -c ios.sim.debug + +You will also need to have Metro Bundler running in another terminal. Note that if you've previously run the E2E tests in release mode, you may need to delete the `RNTester/build` folder before rerunning `detox build`. + ## Built from source Building the app on both iOS and Android means building the React Native framework from source. This way you're running the latest native and JS code the way you see it in your clone of the github repo. diff --git a/package.json b/package.json index d2a5c978f..9b14199ce 100644 --- a/package.json +++ b/package.json @@ -248,6 +248,12 @@ "build": "xcodebuild -project RNTester/RNTester.xcodeproj -scheme RNTester -configuration Release -sdk iphonesimulator -derivedDataPath RNTester/build -UseModernBuildSystem=NO -quiet", "type": "ios.simulator", "name": "iPhone 8" + }, + "ios.sim.debug": { + "binaryPath": "RNTester/build/Build/Products/Debug-iphonesimulator/RNTester.app/", + "build": "xcodebuild -project RNTester/RNTester.xcodeproj -scheme RNTester -configuration Debug -sdk iphonesimulator -derivedDataPath RNTester/build -UseModernBuildSystem=NO -quiet", + "type": "ios.simulator", + "name": "iPhone 8" } } }