From 5faeb576f893dcd0f4460a0344cade6da8dcfa33 Mon Sep 17 00:00:00 2001 From: Orta Date: Fri, 2 Feb 2018 15:19:33 -0500 Subject: [PATCH 1/9] Update Introduction.GettingStarted.md (#555) --- docs/Introduction.GettingStarted.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Introduction.GettingStarted.md b/docs/Introduction.GettingStarted.md index 6bbfcf2e93..0bcb70967e 100644 --- a/docs/Introduction.GettingStarted.md +++ b/docs/Introduction.GettingStarted.md @@ -101,7 +101,7 @@ The basic configuration for Detox should be in your `package.json` file under th In the above configuration example, change `example` to your actual project name. Under the key `"binaryPath"`, `example.app` should be `.app`. Under the key `"build"`, `example.xcodeproj` should be `.xcodeproj` and `-scheme example` should be `-scheme `. -For iOS apps in a workspace (eg: Cocoapods) use `-workspace ios/example.xcworkspace` instead of `-project`. +For iOS apps in a workspace (eg: CocoaPods) use `-workspace ios/example.xcworkspace` instead of `-project`. Also make sure the simulator model specified under the key `"name"` (`iPhone 7` above) is actually available on your machine (it was installed by Xcode). Check this by typing `xcrun simctl list` in terminal to display all available simulators. From d3706c7204717ff710d602b43b6e0f295ca583ef Mon Sep 17 00:00:00 2001 From: Leo Natan Date: Sun, 4 Feb 2018 13:52:11 +0200 Subject: [PATCH 2/9] Update DebuggingInXcode doc --- docs/Guide.DebuggingInXcode.md | 81 ++++++++++++++-------------------- 1 file changed, 33 insertions(+), 48 deletions(-) diff --git a/docs/Guide.DebuggingInXcode.md b/docs/Guide.DebuggingInXcode.md index 7c46e43149..2a1ba20fc0 100644 --- a/docs/Guide.DebuggingInXcode.md +++ b/docs/Guide.DebuggingInXcode.md @@ -1,71 +1,50 @@ ---- -id: Guide.DebuggingInXcode -title: Debugging Apps in Xcode During a Test ---- +# Debugging in Xcode During Detox Tests -> Advanced users might need to natively debug their app inside Xcode during a Detox test. This is mostly useful for invesigating weird crahses or when contributing to Detox itself. +> This is mostly useful for investigating weird crashes or when contributing to Detox itself. **This workflow isn't standard. Don't use it unless you have a good reason.** -This workflow isn't standard. Don't use it unless you have a good reason. +### Add Detox Framework to Your Project -
- -## Step 1: Add Detox framework to your project +* Go to `node_modules/detox` and extract `Detox-ios-src.tbz` +* Drag `Detox-ios-src/Detox.xcodeproj` into your Xcode project +* Go to your project settings -> **General** and add **Detox.framework** to **Embedded Binaries** -Open your Xcode project and drag `Detox.framework` from `node_modules/detox/Detox.framework` to your project. +> NOTE: Apps should not be submitted to the App Store with the Detox framework linked. Follow this guide only to debug Detox issues in your project. Once finished, make sure to remove **Detox.framework** from your project. -> NOTE: Apps should not be submitted to the App Store with the Detox framework linked. Follow this guide only to debug Detox issues in your project. Once finished, make sure to remove `Detox.framework` from your project. +### Add launch arguments -
+Under **Product** menu select **Scheme** -> **Edit Scheme** and select **Run** -> **Arguments** tab and add the following launch arguments to **Arguments Passed On Launch**: -## Step 2: Add launch arguments - -Edit your project scheme and add the following arguments to **Arguments Passed On Launch**: - ``` -detoxServer ws://localhost:8099 -detoxSessionId -test + ``` -
-## Step 3: Add custom session to Detox config +> NOTE: Add each line as a separate line in Xcode. -Edit Detox config in `package.json` to [add a custom session](/docs/APIRef.Configuration.md#server-configuration) by adding the `session` key under the `detox` section: +### Add 'None' Configuration to Detox Section -```json -"detox": { - "session": { - "server": "ws://localhost:8099", - "sessionId": "test" - } -} -``` - -
- -## Step 4: Add a special xcode configuration to Detox config - -Edit Detox config in `package.json` by adding a new configuration with type `ios.none` to the `configurations` key under the `detox` section: +Edit the Detox section in `package.json` to add the following configuration: ```json -"detox": { - "configurations": { - "xcode": { - "type": "ios.none" +"ios.none": { + "binaryPath": "ios", + "type": "ios.none", + "name": "iPhone 8 Plus", + "session": { + "server": "ws://localhost:8099", + "sessionId": "" } - } } ``` -> NOTE: This configuration will not handle simulator and application lifecycle, they will have to be provided manually (via Xcode "Play" button or `react-native run-ios`). - -
+> NOTE: This configuration will not handle simulator and application lifecycle, they will have to be provided manually (via running your application from Xcode). -## Step 5: Run Detox server manually +### Run Detox Server Manually -Type the following inside your project root: +Run the following command in your project root directory: ```sh detox run-server @@ -73,12 +52,18 @@ detox run-server
-## Step 6: Run Detox tests +### Run Your Application + +> NOTE: Before running, place breakpoints you wish to debug. + +Run your application from Xcode as you normally do. + +### Run Detox Tests -Type the following inside your project root: +Run the following command in your project root directory: ```sh -detox test --configuration xcode +detox test --configuration ios.none ``` -> NOTE: Tests that expect the app to be restarted via `device.relaunchApp()` will fail. +> NOTE: Tests that call `device.relaunchApp()` may fail as this API is unavailable when using `ios.none` configuration types. Instead, use `it.only` to run specific tests and restart your app from Xcode. From f8a600ed966b8c2f9a10041790f33151609f1d86 Mon Sep 17 00:00:00 2001 From: Leo Natan Date: Sun, 4 Feb 2018 13:55:44 +0200 Subject: [PATCH 3/9] Remove extra space --- docs/Guide.DebuggingInXcode.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/Guide.DebuggingInXcode.md b/docs/Guide.DebuggingInXcode.md index 2a1ba20fc0..6d120ead31 100644 --- a/docs/Guide.DebuggingInXcode.md +++ b/docs/Guide.DebuggingInXcode.md @@ -21,7 +21,6 @@ ws://localhost:8099 ``` - > NOTE: Add each line as a separate line in Xcode. ### Add 'None' Configuration to Detox Section @@ -50,8 +49,6 @@ Run the following command in your project root directory: detox run-server ``` -
- ### Run Your Application > NOTE: Before running, place breakpoints you wish to debug. From 618f4d6f563bedf4829f33fae6892a3f5158d069 Mon Sep 17 00:00:00 2001 From: Leo Natan Date: Sun, 4 Feb 2018 14:07:18 +0200 Subject: [PATCH 4/9] Add JS as a folder reference, rather that what it was before --- detox/ios/Detox.xcodeproj/project.pbxproj | 246 +--------------------- 1 file changed, 2 insertions(+), 244 deletions(-) diff --git a/detox/ios/Detox.xcodeproj/project.pbxproj b/detox/ios/Detox.xcodeproj/project.pbxproj index d300625cf4..b226bb0d7f 100644 --- a/detox/ios/Detox.xcodeproj/project.pbxproj +++ b/detox/ios/Detox.xcodeproj/project.pbxproj @@ -202,68 +202,6 @@ 3928EFBB1E475E4C00C19B6E /* user_notification_push_trigger.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = user_notification_push_trigger.json; sourceTree = ""; }; 3928EFC11E47673800C19B6E /* LegacyApiAppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LegacyApiAppDelegate.swift; sourceTree = ""; }; 393E66E11FC5F3E90092EE89 /* COSTouchVisualizer.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = COSTouchVisualizer.xcodeproj; path = COSTouchVisualizer/Classes/COSTouchVisualizer.xcodeproj; sourceTree = ""; }; - 39408DF51FE6369A00C20BD5 /* configuration.test.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = configuration.test.js; path = ../src/configuration.test.js; sourceTree = ""; }; - 39408DF61FE6369A00C20BD5 /* configurations.mock.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = configurations.mock.js; path = ../src/configurations.mock.js; sourceTree = ""; }; - 39408DF81FE6369A00C20BD5 /* sh.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = sh.js; sourceTree = ""; }; - 39408DF91FE6369A00C20BD5 /* exec.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = exec.js; sourceTree = ""; }; - 39408DFA1FE6369A00C20BD5 /* environment.test.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = environment.test.js; sourceTree = ""; }; - 39408DFB1FE6369A00C20BD5 /* sh.test.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = sh.test.js; sourceTree = ""; }; - 39408DFC1FE6369A00C20BD5 /* exec.test.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = exec.test.js; sourceTree = ""; }; - 39408DFD1FE6369A00C20BD5 /* fsext.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = fsext.js; sourceTree = ""; }; - 39408DFE1FE6369A00C20BD5 /* retry.test.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = retry.test.js; sourceTree = ""; }; - 39408DFF1FE6369A00C20BD5 /* uuid.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = uuid.js; sourceTree = ""; }; - 39408E001FE6369A00C20BD5 /* retry.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = retry.js; sourceTree = ""; }; - 39408E011FE6369A00C20BD5 /* argparse.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = argparse.js; sourceTree = ""; }; - 39408E021FE6369A00C20BD5 /* argparse.test.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = argparse.test.js; sourceTree = ""; }; - 39408E031FE6369A00C20BD5 /* environment.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = environment.js; sourceTree = ""; }; - 39408E051FE6369A00C20BD5 /* Client.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = Client.js; sourceTree = ""; }; - 39408E061FE6369A00C20BD5 /* Client.test.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = Client.test.js; sourceTree = ""; }; - 39408E081FE6369A00C20BD5 /* actions.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = actions.js; sourceTree = ""; }; - 39408E091FE6369A00C20BD5 /* AsyncWebSocket.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = AsyncWebSocket.js; sourceTree = ""; }; - 39408E0A1FE6369A00C20BD5 /* AsyncWebSocket.test.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = AsyncWebSocket.test.js; sourceTree = ""; }; - 39408E0B1FE6369A00C20BD5 /* configuration.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = configuration.js; path = ../src/configuration.js; sourceTree = ""; }; - 39408E0C1FE6369A00C20BD5 /* index.test.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = index.test.js; path = ../src/index.test.js; sourceTree = ""; }; - 39408E0E1FE6369A00C20BD5 /* ArtifactsPathsProvider.test.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = ArtifactsPathsProvider.test.js; sourceTree = ""; }; - 39408E0F1FE6369A00C20BD5 /* ArtifactsPathsProvider.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = ArtifactsPathsProvider.js; sourceTree = ""; }; - 39408E101FE6369A00C20BD5 /* ArtifactsCopier.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = ArtifactsCopier.js; sourceTree = ""; }; - 39408E111FE6369A00C20BD5 /* index.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = index.js; path = ../src/index.js; sourceTree = ""; }; - 39408E121FE6369A00C20BD5 /* invoke.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = invoke.js; path = ../src/invoke.js; sourceTree = ""; }; - 39408E141FE6369A00C20BD5 /* expect.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = expect.js; sourceTree = ""; }; - 39408E151FE6369A00C20BD5 /* expect.test.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = expect.test.js; sourceTree = ""; }; - 39408E161FE6369A00C20BD5 /* matchers.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = matchers.js; sourceTree = ""; }; - 39408E181FE6369A00C20BD5 /* GREYConfiguration.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = GREYConfiguration.js; sourceTree = ""; }; - 39408E191FE6369A00C20BD5 /* GREYActions.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = GREYActions.js; sourceTree = ""; }; - 39408E1A1FE6369A00C20BD5 /* GREYMatchers+Detox.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = "GREYMatchers+Detox.js"; sourceTree = ""; }; - 39408E1B1FE6369A00C20BD5 /* GREYMatchers.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = GREYMatchers.js; sourceTree = ""; }; - 39408E1C1FE6369A00C20BD5 /* Detox.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = Detox.js; path = ../src/Detox.js; sourceTree = ""; }; - 39408E1E1FE6369A00C20BD5 /* CustomError.test.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = CustomError.test.js; sourceTree = ""; }; - 39408E1F1FE6369A00C20BD5 /* CustomError.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = CustomError.js; sourceTree = ""; }; - 39408E211FE6369A00C20BD5 /* expect.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = expect.js; sourceTree = ""; }; - 39408E221FE6369A00C20BD5 /* matcher.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = matcher.js; sourceTree = ""; }; - 39408E231FE6369A00C20BD5 /* expect.test.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = expect.test.js; sourceTree = ""; }; - 39408E251FE6369A00C20BD5 /* DetoxAction.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = DetoxAction.js; sourceTree = ""; }; - 39408E271FE6369A00C20BD5 /* Espresso.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = Espresso.js; sourceTree = ""; }; - 39408E281FE6369A00C20BD5 /* EarlGrey.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = EarlGrey.js; sourceTree = ""; }; - 39408E291FE6369A00C20BD5 /* Invoke.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = Invoke.js; sourceTree = ""; }; - 39408E2A1FE6369A00C20BD5 /* invoke.test.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = invoke.test.js; path = ../src/invoke.test.js; sourceTree = ""; }; - 39408E2C1FE6369A00C20BD5 /* AppleSimUtils.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = AppleSimUtils.js; sourceTree = ""; }; - 39408E2D1FE6369A00C20BD5 /* Device.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = Device.js; sourceTree = ""; }; - 39408E2E1FE6369A00C20BD5 /* Device.test.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = Device.test.js; sourceTree = ""; }; - 39408E2F1FE6369A00C20BD5 /* IosDriver.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = IosDriver.js; sourceTree = ""; }; - 39408E301FE6369A00C20BD5 /* EmulatorDriver.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = EmulatorDriver.js; sourceTree = ""; }; - 39408E311FE6369A00C20BD5 /* AppleSimUtils.test.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = AppleSimUtils.test.js; sourceTree = ""; }; - 39408E321FE6369A00C20BD5 /* SimulatorDriver.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = SimulatorDriver.js; sourceTree = ""; }; - 39408E351FE6369A00C20BD5 /* notification.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = notification.json; sourceTree = ""; }; - 39408E371FE6369A00C20BD5 /* AAPT.test.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = AAPT.test.js; sourceTree = ""; }; - 39408E381FE6369A00C20BD5 /* ADB.test.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = ADB.test.js; sourceTree = ""; }; - 39408E391FE6369A00C20BD5 /* AAPT.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = AAPT.js; sourceTree = ""; }; - 39408E3A1FE6369A00C20BD5 /* Emulator.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = Emulator.js; sourceTree = ""; }; - 39408E3B1FE6369A00C20BD5 /* ADB.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = ADB.js; sourceTree = ""; }; - 39408E3C1FE6369A00C20BD5 /* EmulatorTelnet.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = EmulatorTelnet.js; sourceTree = ""; }; - 39408E3D1FE6369A00C20BD5 /* AttachedAndroidDriver.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = AttachedAndroidDriver.js; sourceTree = ""; }; - 39408E3E1FE6369A00C20BD5 /* AndroidDriver.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = AndroidDriver.js; sourceTree = ""; }; - 39408E3F1FE6369A00C20BD5 /* DeviceDriverBase.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = DeviceDriverBase.js; sourceTree = ""; }; - 39408E401FE6369B00C20BD5 /* Detox.test.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = Detox.test.js; path = ../src/Detox.test.js; sourceTree = ""; }; 394767971DBF985400D72256 /* Detox.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Detox.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3947679A1DBF985400D72256 /* Detox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Detox.h; sourceTree = ""; }; 3947679B1DBF985400D72256 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -295,6 +233,7 @@ 394767DD1DBF992400D72256 /* SocketRocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SocketRocket.xcodeproj; path = SocketRocket/SocketRocket.xcodeproj; sourceTree = ""; }; 394D589A1E50B59400556DB9 /* NSBundle+TestsFix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSBundle+TestsFix.h"; sourceTree = ""; }; 394D589B1E50B59400556DB9 /* NSBundle+TestsFix.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBundle+TestsFix.m"; sourceTree = ""; }; + 3975C78220272ED500C59ED8 /* src */ = {isa = PBXFileReference; lastKnownFileType = folder; name = src; path = ../src; sourceTree = ""; }; 397EC9B31E7EDE0B00D5F2BB /* EarlGreyStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EarlGreyStatistics.h; sourceTree = ""; }; 397EC9B41E7EDE0B00D5F2BB /* EarlGreyStatistics.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EarlGreyStatistics.m; sourceTree = ""; }; 39A34C6F1E30F10D00BEBB59 /* DetoxAppDelegateProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetoxAppDelegateProxy.h; sourceTree = ""; }; @@ -382,192 +321,11 @@ 39408DEE1FE6368100C20BD5 /* JS */ = { isa = PBXGroup; children = ( - 39408E201FE6369A00C20BD5 /* android */, - 39408E0D1FE6369A00C20BD5 /* artifacts */, - 39408E041FE6369A00C20BD5 /* client */, - 39408E0B1FE6369A00C20BD5 /* configuration.js */, - 39408DF51FE6369A00C20BD5 /* configuration.test.js */, - 39408DF61FE6369A00C20BD5 /* configurations.mock.js */, - 39408E1C1FE6369A00C20BD5 /* Detox.js */, - 39408E401FE6369B00C20BD5 /* Detox.test.js */, - 39408E2B1FE6369A00C20BD5 /* devices */, - 39408E1D1FE6369A00C20BD5 /* errors */, - 39408E111FE6369A00C20BD5 /* index.js */, - 39408E0C1FE6369A00C20BD5 /* index.test.js */, - 39408E261FE6369A00C20BD5 /* invoke */, - 39408E121FE6369A00C20BD5 /* invoke.js */, - 39408E2A1FE6369A00C20BD5 /* invoke.test.js */, - 39408E131FE6369A00C20BD5 /* ios */, - 39408DF71FE6369A00C20BD5 /* utils */, + 3975C78220272ED500C59ED8 /* src */, ); name = JS; sourceTree = ""; }; - 39408DF71FE6369A00C20BD5 /* utils */ = { - isa = PBXGroup; - children = ( - 39408DF81FE6369A00C20BD5 /* sh.js */, - 39408DF91FE6369A00C20BD5 /* exec.js */, - 39408DFA1FE6369A00C20BD5 /* environment.test.js */, - 39408DFB1FE6369A00C20BD5 /* sh.test.js */, - 39408DFC1FE6369A00C20BD5 /* exec.test.js */, - 39408DFD1FE6369A00C20BD5 /* fsext.js */, - 39408DFE1FE6369A00C20BD5 /* retry.test.js */, - 39408DFF1FE6369A00C20BD5 /* uuid.js */, - 39408E001FE6369A00C20BD5 /* retry.js */, - 39408E011FE6369A00C20BD5 /* argparse.js */, - 39408E021FE6369A00C20BD5 /* argparse.test.js */, - 39408E031FE6369A00C20BD5 /* environment.js */, - ); - name = utils; - path = ../src/utils; - sourceTree = ""; - }; - 39408E041FE6369A00C20BD5 /* client */ = { - isa = PBXGroup; - children = ( - 39408E051FE6369A00C20BD5 /* Client.js */, - 39408E061FE6369A00C20BD5 /* Client.test.js */, - 39408E071FE6369A00C20BD5 /* actions */, - 39408E091FE6369A00C20BD5 /* AsyncWebSocket.js */, - 39408E0A1FE6369A00C20BD5 /* AsyncWebSocket.test.js */, - ); - name = client; - path = ../src/client; - sourceTree = ""; - }; - 39408E071FE6369A00C20BD5 /* actions */ = { - isa = PBXGroup; - children = ( - 39408E081FE6369A00C20BD5 /* actions.js */, - ); - path = actions; - sourceTree = ""; - }; - 39408E0D1FE6369A00C20BD5 /* artifacts */ = { - isa = PBXGroup; - children = ( - 39408E0E1FE6369A00C20BD5 /* ArtifactsPathsProvider.test.js */, - 39408E0F1FE6369A00C20BD5 /* ArtifactsPathsProvider.js */, - 39408E101FE6369A00C20BD5 /* ArtifactsCopier.js */, - ); - name = artifacts; - path = ../src/artifacts; - sourceTree = ""; - }; - 39408E131FE6369A00C20BD5 /* ios */ = { - isa = PBXGroup; - children = ( - 39408E141FE6369A00C20BD5 /* expect.js */, - 39408E151FE6369A00C20BD5 /* expect.test.js */, - 39408E161FE6369A00C20BD5 /* matchers.js */, - 39408E171FE6369A00C20BD5 /* earlgreyapi */, - ); - name = ios; - path = ../src/ios; - sourceTree = ""; - }; - 39408E171FE6369A00C20BD5 /* earlgreyapi */ = { - isa = PBXGroup; - children = ( - 39408E181FE6369A00C20BD5 /* GREYConfiguration.js */, - 39408E191FE6369A00C20BD5 /* GREYActions.js */, - 39408E1A1FE6369A00C20BD5 /* GREYMatchers+Detox.js */, - 39408E1B1FE6369A00C20BD5 /* GREYMatchers.js */, - ); - path = earlgreyapi; - sourceTree = ""; - }; - 39408E1D1FE6369A00C20BD5 /* errors */ = { - isa = PBXGroup; - children = ( - 39408E1E1FE6369A00C20BD5 /* CustomError.test.js */, - 39408E1F1FE6369A00C20BD5 /* CustomError.js */, - ); - name = errors; - path = ../src/errors; - sourceTree = ""; - }; - 39408E201FE6369A00C20BD5 /* android */ = { - isa = PBXGroup; - children = ( - 39408E211FE6369A00C20BD5 /* expect.js */, - 39408E221FE6369A00C20BD5 /* matcher.js */, - 39408E231FE6369A00C20BD5 /* expect.test.js */, - 39408E241FE6369A00C20BD5 /* espressoapi */, - ); - name = android; - path = ../src/android; - sourceTree = ""; - }; - 39408E241FE6369A00C20BD5 /* espressoapi */ = { - isa = PBXGroup; - children = ( - 39408E251FE6369A00C20BD5 /* DetoxAction.js */, - ); - path = espressoapi; - sourceTree = ""; - }; - 39408E261FE6369A00C20BD5 /* invoke */ = { - isa = PBXGroup; - children = ( - 39408E271FE6369A00C20BD5 /* Espresso.js */, - 39408E281FE6369A00C20BD5 /* EarlGrey.js */, - 39408E291FE6369A00C20BD5 /* Invoke.js */, - ); - name = invoke; - path = ../src/invoke; - sourceTree = ""; - }; - 39408E2B1FE6369A00C20BD5 /* devices */ = { - isa = PBXGroup; - children = ( - 39408E2C1FE6369A00C20BD5 /* AppleSimUtils.js */, - 39408E2D1FE6369A00C20BD5 /* Device.js */, - 39408E2E1FE6369A00C20BD5 /* Device.test.js */, - 39408E2F1FE6369A00C20BD5 /* IosDriver.js */, - 39408E301FE6369A00C20BD5 /* EmulatorDriver.js */, - 39408E311FE6369A00C20BD5 /* AppleSimUtils.test.js */, - 39408E321FE6369A00C20BD5 /* SimulatorDriver.js */, - 39408E331FE6369A00C20BD5 /* detox */, - 39408E361FE6369A00C20BD5 /* android */, - 39408E3D1FE6369A00C20BD5 /* AttachedAndroidDriver.js */, - 39408E3E1FE6369A00C20BD5 /* AndroidDriver.js */, - 39408E3F1FE6369A00C20BD5 /* DeviceDriverBase.js */, - ); - name = devices; - path = ../src/devices; - sourceTree = ""; - }; - 39408E331FE6369A00C20BD5 /* detox */ = { - isa = PBXGroup; - children = ( - 39408E341FE6369A00C20BD5 /* notifications */, - ); - path = detox; - sourceTree = ""; - }; - 39408E341FE6369A00C20BD5 /* notifications */ = { - isa = PBXGroup; - children = ( - 39408E351FE6369A00C20BD5 /* notification.json */, - ); - path = notifications; - sourceTree = ""; - }; - 39408E361FE6369A00C20BD5 /* android */ = { - isa = PBXGroup; - children = ( - 39408E371FE6369A00C20BD5 /* AAPT.test.js */, - 39408E381FE6369A00C20BD5 /* ADB.test.js */, - 39408E391FE6369A00C20BD5 /* AAPT.js */, - 39408E3A1FE6369A00C20BD5 /* Emulator.js */, - 39408E3B1FE6369A00C20BD5 /* ADB.js */, - 39408E3C1FE6369A00C20BD5 /* EmulatorTelnet.js */, - ); - path = android; - sourceTree = ""; - }; 3947678D1DBF985400D72256 = { isa = PBXGroup; children = ( From 2b500095880b5f9bcb2f74919f6c1ea3d6c6b29e Mon Sep 17 00:00:00 2001 From: Arnon Date: Mon, 5 Feb 2018 12:05:45 +0200 Subject: [PATCH 5/9] Update APIRef.DetoxCLI.md --- docs/APIRef.DetoxCLI.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/APIRef.DetoxCLI.md b/docs/APIRef.DetoxCLI.md index 113bbe260e..578daffc74 100644 --- a/docs/APIRef.DetoxCLI.md +++ b/docs/APIRef.DetoxCLI.md @@ -48,7 +48,7 @@ Initiating your test suite | -h, --help | output usage information | | -o, --runner-config \ | Test runner config file, defaults to 'e2e/mocha.opts' for mocha and 'e2e/config.json' for jest | | -l, --loglevel [value] | info, debug, verbose, silly, wss | -| -c, -configuration \ | Select a device configuration from your defined figurations,if not supplied, and there's only one configuration, detox will default to it | +| -c, -configuration \ | Select a device configuration from your defined configurations,if not supplied, and there's only one configuration, detox will default to it | | -r, --reuse | Reuse existing installed app (do not delete and re-tall) for a faster run. | | -u, --cleanup | Shutdown simulator when test is over, useful for CI ipts, to make sure detox exists cleanly with no residue | | -d, --debug-synchronization \ | When an action/expectation takes a significant amount time use this option to print device synchronization status. The status will be printed if the ion takes more than [value]ms to complete | From 713bae2fbb99116af048d3b75d98a1abf552af3a Mon Sep 17 00:00:00 2001 From: Leo Natan Date: Mon, 5 Feb 2018 15:29:30 +0200 Subject: [PATCH 6/9] Wrap all commands in Earl Grey sync so that some race condition bugs may be avoided --- detox/ios/Detox/DetoxManager.h | 2 +- detox/ios/Detox/DetoxManager.m | 60 +++++++++++-------- detox/ios/Detox/EarlGrey+Detox.h | 1 + detox/ios/Detox/EarlGrey+Detox.m | 9 +++ detox/ios/Detox/EarlGreyExtensions.h | 1 + detox/ios/Detox/TestRunner.h | 4 +- detox/ios/Detox/TestRunner.m | 8 +-- detox/ios/Detox/WebSocket.h | 4 +- detox/ios/Detox/WebSocket.m | 6 +- .../xcshareddata/xcschemes/example.xcscheme | 2 - 10 files changed, 58 insertions(+), 39 deletions(-) diff --git a/detox/ios/Detox/DetoxManager.h b/detox/ios/Detox/DetoxManager.h index ecb23608c0..7de5890a8e 100644 --- a/detox/ios/Detox/DetoxManager.h +++ b/detox/ios/Detox/DetoxManager.h @@ -14,6 +14,6 @@ @interface DetoxManager : NSObject + (instancetype)sharedInstance; -- (void) connectToServer:(NSString*)url withSessionId:(NSString*)sessionId; +- (void)connectToServer:(NSString*)url withSessionId:(NSString*)sessionId; @end diff --git a/detox/ios/Detox/DetoxManager.m b/detox/ios/Detox/DetoxManager.m index 4530e4b2c6..981264bf39 100644 --- a/detox/ios/Detox/DetoxManager.m +++ b/detox/ios/Detox/DetoxManager.m @@ -76,12 +76,12 @@ - (instancetype)init return self; } -- (void) connectToServer:(NSString*)url withSessionId:(NSString*)sessionId +- (void)connectToServer:(NSString*)url withSessionId:(NSString*)sessionId { [self.websocket connectToServer:url withSessionId:sessionId]; } -- (void) websocketDidConnect +- (void)websocketDidConnect { if (![ReactNativeSupport isReactNativeApp]) { @@ -90,7 +90,7 @@ - (void) websocketDidConnect } } -- (void) websocketDidReceiveAction:(NSString *)type withParams:(NSDictionary *)params withMessageId:(NSNumber *)messageId +- (void)websocketDidReceiveAction:(NSString *)type withParams:(NSDictionary *)params withMessageId:(NSNumber *)messageId { NSAssert(messageId != nil, @"Got action with a null messageId"); @@ -115,36 +115,46 @@ - (void) websocketDidReceiveAction:(NSString *)type withParams:(NSDictionary *)p } else if([type isEqualToString:@"userNotification"]) { - NSURL* userNotificationDataURL = [NSURL fileURLWithPath:params[@"detoxUserNotificationDataURL"]]; - DetoxUserNotificationDispatcher* dispatcher = [[DetoxUserNotificationDispatcher alloc] initWithUserNotificationDataURL:userNotificationDataURL]; - [dispatcher dispatchOnAppDelegate:DetoxAppDelegateProxy.currentAppDelegateProxy simulateDuringLaunch:NO]; - [self.websocket sendAction:@"userNotificationDone" withParams:@{} withMessageId: messageId]; + [EarlGrey detox_safeExecuteSync:^{ + NSURL* userNotificationDataURL = [NSURL fileURLWithPath:params[@"detoxUserNotificationDataURL"]]; + DetoxUserNotificationDispatcher* dispatcher = [[DetoxUserNotificationDispatcher alloc] initWithUserNotificationDataURL:userNotificationDataURL]; + [dispatcher dispatchOnAppDelegate:DetoxAppDelegateProxy.currentAppDelegateProxy simulateDuringLaunch:NO]; + [self.websocket sendAction:@"userNotificationDone" withParams:@{} withMessageId: messageId]; + }]; } else if([type isEqualToString:@"openURL"]) { - NSURL* URLToOpen = [NSURL URLWithString:params[@"url"]]; - - NSParameterAssert(URLToOpen != nil); - - NSString* sourceApp = params[@"sourceApp"]; - - NSMutableDictionary* options = [@{UIApplicationLaunchOptionsURLKey: URLToOpen} mutableCopy]; - if(sourceApp != nil) - { - options[UIApplicationLaunchOptionsSourceApplicationKey] = sourceApp; - } - - if([[UIApplication sharedApplication].delegate respondsToSelector:@selector(application:openURL:options:)]) - { - [[UIApplication sharedApplication].delegate application:[UIApplication sharedApplication] openURL:URLToOpen options:options]; - } + [EarlGrey detox_safeExecuteSync:^{ + NSURL* URLToOpen = [NSURL URLWithString:params[@"url"]]; + + NSParameterAssert(URLToOpen != nil); + + NSString* sourceApp = params[@"sourceApp"]; + + NSMutableDictionary* options = [@{UIApplicationLaunchOptionsURLKey: URLToOpen} mutableCopy]; + if(sourceApp != nil) + { + options[UIApplicationLaunchOptionsSourceApplicationKey] = sourceApp; + } + + if([[UIApplication sharedApplication].delegate respondsToSelector:@selector(application:openURL:options:)]) + { + [[UIApplication sharedApplication].delegate application:[UIApplication sharedApplication] openURL:URLToOpen options:options]; + } + + [self.websocket sendAction:@"openURLDone" withParams:@{} withMessageId: messageId]; + }]; + } + else if([type isEqualToString:@"shakeDevice"]) + { - [self.websocket sendAction:@"openURLDone" withParams:@{} withMessageId: messageId]; } else if([type isEqualToString:@"reactNativeReload"]) { _isReady = NO; - [ReactNativeSupport reloadApp]; + [EarlGrey detox_safeExecuteSync:^{ + [ReactNativeSupport reloadApp]; + }]; [self _waitForRNLoadWithId:messageId]; diff --git a/detox/ios/Detox/EarlGrey+Detox.h b/detox/ios/Detox/EarlGrey+Detox.h index 5fb862ea40..b179006a5d 100644 --- a/detox/ios/Detox/EarlGrey+Detox.h +++ b/detox/ios/Detox/EarlGrey+Detox.h @@ -11,6 +11,7 @@ @interface EarlGreyImpl (Detox) +- (void)detox_safeExecuteSync:(void(^)(void))block; - (GREYElementInteraction *)detox_selectElementWithMatcher:(id)elementMatcher; @end diff --git a/detox/ios/Detox/EarlGrey+Detox.m b/detox/ios/Detox/EarlGrey+Detox.m index ab071130dc..75b72495cd 100644 --- a/detox/ios/Detox/EarlGrey+Detox.m +++ b/detox/ios/Detox/EarlGrey+Detox.m @@ -11,6 +11,15 @@ @implementation EarlGreyImpl (Detox) +- (void)detox_safeExecuteSync:(void(^)(void))block +{ + grey_execute_async(^{ + [[GREYUIThreadExecutor sharedInstance] executeSync:^{ + block(); + } error:NULL]; + }); +} + - (GREYElementInteraction *)detox_selectElementWithMatcher:(id)elementMatcher { return [self selectElementWithMatcher:[GREYMatchers detoxMatcherAvoidingProblematicReactNativeElements:elementMatcher]]; diff --git a/detox/ios/Detox/EarlGreyExtensions.h b/detox/ios/Detox/EarlGreyExtensions.h index 79acae5626..7241463993 100644 --- a/detox/ios/Detox/EarlGreyExtensions.h +++ b/detox/ios/Detox/EarlGreyExtensions.h @@ -7,6 +7,7 @@ // #import +#import "EarlGrey+Detox.h" /** Expose provate Earl Grey methods diff --git a/detox/ios/Detox/TestRunner.h b/detox/ios/Detox/TestRunner.h index 9c0397668e..2c159bea42 100644 --- a/detox/ios/Detox/TestRunner.h +++ b/detox/ios/Detox/TestRunner.h @@ -21,7 +21,7 @@ @property (nonatomic, assign) id delegate; -- (void) invoke:(NSDictionary*)params withMessageId:(NSNumber*) messageId; -- (void) cleanup; +- (void)invoke:(NSDictionary*)params withMessageId:(NSNumber*) messageId; +- (void)cleanup; @end diff --git a/detox/ios/Detox/TestRunner.m b/detox/ios/Detox/TestRunner.m index 484cc242de..5f6126c43b 100644 --- a/detox/ios/Detox/TestRunner.m +++ b/detox/ios/Detox/TestRunner.m @@ -20,14 +20,14 @@ @interface TestRunner() @implementation TestRunner -- (void) initEarlGrey +- (void)initEarlGrey { [EarlGrey setFailureHandler:self.failureHandler]; [[GREYConfiguration sharedInstance] setValue:@(NO) forConfigKey:kGREYConfigKeyAnalyticsEnabled]; //[[GREYConfiguration sharedInstance] setValue:@".*localhost.*" forConfigKey:kGREYConfigKeyURLBlacklistRegex]; } -- (void) cleanupEarlGrey +- (void)cleanupEarlGrey { // this triggers grey_tearDown in GREYAutomationSetup [[NSNotificationCenter defaultCenter] postNotificationName:@"GREYXCTestCaseInstanceDidFinish" @@ -48,7 +48,7 @@ - (instancetype)init return self; } -- (void) cleanup +- (void)cleanup { [self cleanupEarlGrey]; } @@ -61,7 +61,7 @@ - (void)onTestFailed:(NSString *)details { } } -- (void) invoke:(NSDictionary*)params withMessageId: (NSNumber *)messageId +- (void)invoke:(NSDictionary*)params withMessageId: (NSNumber *)messageId { self.currentMessageId = messageId; grey_execute_async(^{ diff --git a/detox/ios/Detox/WebSocket.h b/detox/ios/Detox/WebSocket.h index 4a074161c6..779bd4cd03 100644 --- a/detox/ios/Detox/WebSocket.h +++ b/detox/ios/Detox/WebSocket.h @@ -21,7 +21,7 @@ @interface WebSocket : NSObject @property (nonatomic, assign) id delegate; -- (void) connectToServer:(NSString*)url withSessionId:(NSString*)sessionId; -- (void) sendAction:(NSString*)type withParams:(NSDictionary*)params withMessageId:(NSNumber*)messageId; +- (void)connectToServer:(NSString*)url withSessionId:(NSString*)sessionId; +- (void)sendAction:(NSString*)type withParams:(NSDictionary*)params withMessageId:(NSNumber*)messageId; @end diff --git a/detox/ios/Detox/WebSocket.m b/detox/ios/Detox/WebSocket.m index bd7a86b842..a9448ca119 100644 --- a/detox/ios/Detox/WebSocket.m +++ b/detox/ios/Detox/WebSocket.m @@ -20,7 +20,7 @@ @interface WebSocket() @implementation WebSocket -- (void) connectToServer:(NSString*)url withSessionId:(NSString*)sessionId +- (void)connectToServer:(NSString*)url withSessionId:(NSString*)sessionId { if (self.websocket) { @@ -33,7 +33,7 @@ - (void) connectToServer:(NSString*)url withSessionId:(NSString*)sessionId [self.websocket open]; } -- (void) sendAction:(NSString*)type withParams:(NSDictionary*)params withMessageId:(NSNumber*)messageId +- (void)sendAction:(NSString*)type withParams:(NSDictionary*)params withMessageId:(NSNumber*)messageId { NSDictionary *data = @{@"type": type, @"params": params, @"messageId": messageId}; NSError *error; @@ -48,7 +48,7 @@ - (void) sendAction:(NSString*)type withParams:(NSDictionary*)params withMessage [self.websocket sendString:json error:NULL]; } -- (void) receiveAction:(NSString*)json +- (void)receiveAction:(NSString*)json { NSError *error; NSData *jsonData = [json dataUsingEncoding:NSUTF8StringEncoding]; diff --git a/detox/test/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme b/detox/test/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme index 986e288c85..fb7f7976ff 100644 --- a/detox/test/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme +++ b/detox/test/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme @@ -40,7 +40,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" shouldUseLaunchSchemeArgsEnv = "YES"> @@ -61,7 +60,6 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" disableMainThreadChecker = "YES" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" From 6c9881e676a974232bae34f9c3a439aecd40fe71 Mon Sep 17 00:00:00 2001 From: Leo Natan Date: Mon, 5 Feb 2018 16:17:26 +0200 Subject: [PATCH 7/9] Add JavaScript sources links to src and e2e folders inside Xcode project --- detox/test/ios/example.xcodeproj/project.pbxproj | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/detox/test/ios/example.xcodeproj/project.pbxproj b/detox/test/ios/example.xcodeproj/project.pbxproj index 25ae614cbc..5db232185a 100644 --- a/detox/test/ios/example.xcodeproj/project.pbxproj +++ b/detox/test/ios/example.xcodeproj/project.pbxproj @@ -347,6 +347,8 @@ 399B4E061ED587120098D2AC /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39A077861E5450E700A53A07 /* RCTPushNotification.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTPushNotification.xcodeproj; path = "../node_modules/react-native/Libraries/PushNotificationIOS/RCTPushNotification.xcodeproj"; sourceTree = ""; }; 39B0445B1DAED76400431EC5 /* Detox.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Detox.xcodeproj; path = ../../ios/Detox.xcodeproj; sourceTree = ""; }; + 39FC9D23202899F90033C11A /* e2e */ = {isa = PBXFileReference; lastKnownFileType = folder; name = e2e; path = ../e2e; sourceTree = ""; }; + 39FC9D24202899F90033C11A /* src */ = {isa = PBXFileReference; lastKnownFileType = folder; name = src; path = ../src; sourceTree = ""; }; 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; CC17D3301D60A24300267B0C /* NativeModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NativeModule.h; path = example/NativeModule.h; sourceTree = ""; }; @@ -524,6 +526,15 @@ name = Products; sourceTree = ""; }; + 39FC9CFD202899D10033C11A /* JS */ = { + isa = PBXGroup; + children = ( + 39FC9D23202899F90033C11A /* e2e */, + 39FC9D24202899F90033C11A /* src */, + ); + name = JS; + sourceTree = ""; + }; 78C398B11ACF4ADC00677621 /* Products */ = { isa = PBXGroup; children = ( @@ -565,6 +576,7 @@ isa = PBXGroup; children = ( 13B07FAE1A68108700A75B9A /* example */, + 39FC9CFD202899D10033C11A /* JS */, CCFA7DE41D11D22600E15EDF /* Frameworks */, 832341AE1AAA6A7D00B99B32 /* Libraries */, 83CBBA001A601CBA00E9B192 /* Products */, From 49f97de34c318f122c81d9530a408939de828903 Mon Sep 17 00:00:00 2001 From: Leo Natan Date: Tue, 6 Feb 2018 12:21:27 +0200 Subject: [PATCH 8/9] Fix await in openURL Closes #561 --- detox/src/devices/IosDriver.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detox/src/devices/IosDriver.js b/detox/src/devices/IosDriver.js index d842fe9039..8c36f2f07e 100644 --- a/detox/src/devices/IosDriver.js +++ b/detox/src/devices/IosDriver.js @@ -31,7 +31,7 @@ class IosDriver extends DeviceDriverBase { } async openURL(deviceId, params) { - this.client.openURL(params); + await this.client.openURL(params); } async setURLBlacklist(urlList) { From f3b76943407eb10797cc82ce6ae979e1d6ab790b Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Mon, 29 Jan 2018 23:09:35 +0100 Subject: [PATCH 9/9] Only publish the website on master --- .travis.yml | 8 +------- scripts/publish-website.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 7 deletions(-) create mode 100755 scripts/publish-website.sh diff --git a/.travis.yml b/.travis.yml index 9b96899dbd..e98355e613 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,13 +56,7 @@ matrix: - NAME='Website - master' node_js: 8 script: - - git config --global user.email "$GIT_USER@users.noreply.github.com" - - git config --global user.name "Wix" - - echo "machine github.com login $GIT_USER password $GIT_TOKEN" > ~/.netrc - - cd website && npm install && GIT_USER=$GIT_USER CURRENT_BRANCH=master npm run publish-gh-pages - branches: - only: - - master + - scripts/publish-website.sh branches: only: diff --git a/scripts/publish-website.sh b/scripts/publish-website.sh new file mode 100755 index 0000000000..8cc983ffea --- /dev/null +++ b/scripts/publish-website.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +BRANCH=$(git rev-parse --abbrev-ref HEAD) +if [[ "$BRANCH" != "master" ]]; then + echo 'Not deploying the website'; + exit 0; +else + git config --global user.email "$GIT_USER@users.noreply.github.com"; + git config --global user.name "Wix"; + echo "machine github.com login $GIT_USER password $GIT_TOKEN" > ~/.netrc; + cd website; + npm install; + GIT_USER=$GIT_USER CURRENT_BRANCH=master npm run publish-gh-pages; +fi