From db7edca745aad9331a8df56648951a346123d172 Mon Sep 17 00:00:00 2001 From: Josh Justice Date: Sat, 8 Dec 2018 09:51:06 -0600 Subject: [PATCH 1/3] Add debug configuration for Detox --- package.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package.json b/package.json index 0ae410fb152487..d6b02436702621 100644 --- a/package.json +++ b/package.json @@ -250,6 +250,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" } } } From cbc5bde8a19453929e9ae174c97b85aeb14b0307 Mon Sep 17 00:00:00 2001 From: Josh Justice Date: Sat, 8 Dec 2018 09:56:04 -0600 Subject: [PATCH 2/3] Add notes about running Detox tests --- RNTester/README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/RNTester/README.md b/RNTester/README.md index b612a321532f7a..e7d8cda496c01b 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 tests locally or on CI, 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. From a91f0bb447743eb99d973bc99f23eb4beb359997 Mon Sep 17 00:00:00 2001 From: Rick Hanlon II Date: Sat, 8 Dec 2018 18:02:03 -0600 Subject: [PATCH 3/3] Remove reference to CI for simplicity Co-Authored-By: CodingItWrong --- RNTester/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RNTester/README.md b/RNTester/README.md index e7d8cda496c01b..0ad4267787ce2f 100644 --- a/RNTester/README.md +++ b/RNTester/README.md @@ -62,7 +62,7 @@ _Note: The native libs are still built using gradle. Full build with buck is com Install Detox from [here](https://github.com/wix/Detox/blob/master/docs/Introduction.GettingStarted.md). -To run the tests locally or on CI, run the following commands from the react-native folder: +To run the e2e tests locally, run the following commands from the react-native folder: yarn build-ios-e2e yarn test-ios-e2e