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/detox/android/detox/src/main/java/com/wix/detox/DetoxExceptionHandler.java b/detox/android/detox/src/main/java/com/wix/detox/DetoxExceptionHandler.java new file mode 100644 index 0000000000..990e71b24f --- /dev/null +++ b/detox/android/detox/src/main/java/com/wix/detox/DetoxExceptionHandler.java @@ -0,0 +1,8 @@ +package com.wix.detox; + +/** + * Created by rotemm on 07/02/2018. + */ + +public class DetoxExceptionHandler { +} diff --git a/detox/ios/Detox.xcodeproj/project.pbxproj b/detox/ios/Detox.xcodeproj/project.pbxproj index 4ed8658e89..991469cba2 100644 --- a/detox/ios/Detox.xcodeproj/project.pbxproj +++ b/detox/ios/Detox.xcodeproj/project.pbxproj @@ -203,68 +203,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 = ""; }; @@ -296,6 +234,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 = ""; }; @@ -384,192 +323,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 = ( diff --git a/detox/ios/Detox/DetoxManager.h b/detox/ios/Detox/DetoxManager.h index 4388eb651e..7de5890a8e 100644 --- a/detox/ios/Detox/DetoxManager.h +++ b/detox/ios/Detox/DetoxManager.h @@ -7,12 +7,13 @@ // #import +#import "WebSocket.h" +#import "TestRunner.h" +#import "ReactNativeSupport.h" -@interface DetoxManager : NSObject +@interface DetoxManager : NSObject -+ (instancetype)sharedManager; ++ (instancetype)sharedInstance; - (void)connectToServer:(NSString*)url withSessionId:(NSString*)sessionId; -- (void)notifyOnCrashWithDetails:(NSDictionary*)details; - @end diff --git a/detox/ios/Detox/DetoxManager.m b/detox/ios/Detox/DetoxManager.m index 128f5643b7..981264bf39 100644 --- a/detox/ios/Detox/DetoxManager.m +++ b/detox/ios/Detox/DetoxManager.m @@ -7,11 +7,6 @@ // #import "DetoxManager.h" - -#import "WebSocket.h" -#import "TestRunner.h" -#import "ReactNativeSupport.h" - #import #import "DetoxAppDelegateProxy.h" #import "EarlGreyExtensions.h" @@ -19,17 +14,16 @@ DTX_CREATE_LOG(DetoxManager) -@interface DetoxManager() +@interface DetoxManager() @property (nonatomic) BOOL isReady; -@property (nonatomic, strong) WebSocket *webSocket; -@property (nonatomic, strong) TestRunner *testRunner; +@property (nonatomic, retain) WebSocket *websocket; +@property (nonatomic, retain) TestRunner *testRunner; @end -@implementation DetoxManager - -+ (void)load +__attribute__((constructor)) +static void detoxConditionalInit() { //This forces accessibility support in the application. [[[NSUserDefaults alloc] initWithSuiteName:@"com.apple.Accessibility"] setBool:YES forKey:@"ApplicationAccessibilityEnabled"]; @@ -47,11 +41,14 @@ + (void)load // if these args were not provided as part of options, don't start Detox at all! return; } - - [[DetoxManager sharedManager] connectToServer:detoxServer withSessionId:detoxSessionId]; + + [[DetoxManager sharedInstance] connectToServer:detoxServer withSessionId:detoxSessionId]; } -+ (instancetype)sharedManager + +@implementation DetoxManager + ++ (instancetype)sharedInstance { static DetoxManager *sharedInstance = nil; static dispatch_once_t onceToken; @@ -66,8 +63,8 @@ - (instancetype)init self = [super init]; if (self == nil) return nil; - self.webSocket = [[WebSocket alloc] init]; - self.webSocket.delegate = self; + self.websocket = [[WebSocket alloc] init]; + self.websocket.delegate = self; self.testRunner = [[TestRunner alloc] init]; self.testRunner.delegate = self; @@ -81,7 +78,7 @@ - (instancetype)init - (void)connectToServer:(NSString*)url withSessionId:(NSString*)sessionId { - [self.webSocket connectToServer:url withSessionId:sessionId]; + [self.websocket connectToServer:url withSessionId:sessionId]; } - (void)websocketDidConnect @@ -89,7 +86,7 @@ - (void)websocketDidConnect if (![ReactNativeSupport isReactNativeApp]) { _isReady = YES; - [self.webSocket sendAction:@"ready" withParams:@{} withMessageId:@-1000]; + [self.websocket sendAction:@"ready" withParams:@{} withMessageId: @-1000]; } } @@ -99,55 +96,65 @@ - (void)websocketDidReceiveAction:(NSString *)type withParams:(NSDictionary *)pa if([type isEqualToString:@"invoke"]) { - [self.testRunner invoke:params withMessageId:messageId]; + [self.testRunner invoke:params withMessageId: messageId]; return; } else if([type isEqualToString:@"isReady"]) { if(_isReady) { - [self.webSocket sendAction:@"ready" withParams:@{} withMessageId:@-1000]; + [self.websocket sendAction:@"ready" withParams:@{} withMessageId: @-1000]; } return; } else if([type isEqualToString:@"cleanup"]) { [self.testRunner cleanup]; - [self.webSocket sendAction:@"cleanupDone" withParams:@{} withMessageId:messageId]; + [self.websocket sendAction:@"cleanupDone" withParams:@{} withMessageId: messageId]; return; } 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]; @@ -158,7 +165,7 @@ - (void)websocketDidReceiveAction:(NSString *)type withParams:(NSDictionary *)pa NSMutableDictionary* statsStatus = [[[EarlGreyStatistics sharedInstance] currentStatus] mutableCopy]; statsStatus[@"messageId"] = messageId; - [self.webSocket sendAction:@"currentStatusResult" withParams:statsStatus withMessageId:messageId]; + [self.websocket sendAction:@"currentStatusResult" withParams:statsStatus withMessageId: messageId]; } } @@ -167,7 +174,7 @@ - (void)_waitForRNLoadWithId:(id)messageId __weak __typeof(self) weakSelf = self; [ReactNativeSupport waitForReactNativeLoadWithCompletionHandler:^{ weakSelf.isReady = YES; - [weakSelf.webSocket sendAction:@"ready" withParams:@{} withMessageId:@-1000]; + [weakSelf.websocket sendAction:@"ready" withParams:@{} withMessageId: @-1000]; }]; } @@ -178,24 +185,19 @@ - (void)testRunnerOnInvokeResult:(id)res withMessageId:(NSNumber *)messageId { res = [NSString stringWithFormat:@"(%@)", NSStringFromClass([res class])]; } - [self.webSocket sendAction:@"invokeResult" withParams:@{@"result": res} withMessageId:messageId]; + [self.websocket sendAction:@"invokeResult" withParams:@{@"result": res} withMessageId: messageId]; } - (void)testRunnerOnTestFailed:(NSString *)details withMessageId:(NSNumber *) messageId { if (details == nil) details = @""; - [self.webSocket sendAction:@"testFailed" withParams:@{@"details": details} withMessageId:messageId]; + [self.websocket sendAction:@"testFailed" withParams:@{@"details": details} withMessageId: messageId]; } - (void)testRunnerOnError:(NSString *)error withMessageId:(NSNumber *) messageId { if (error == nil) error = @""; - [self.webSocket sendAction:@"error" withParams:@{@"error": error} withMessageId:messageId]; -} - -- (void)notifyOnCrashWithDetails:(NSDictionary*)details -{ - [self.webSocket sendAction:@"AppWillTerminateWithError" withParams:details withMessageId:@-10000]; + [self.websocket sendAction:@"error" withParams:@{@"error": error} withMessageId: messageId]; } @end 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.m b/detox/ios/Detox/TestRunner.m index 8dd21e1a48..5f6126c43b 100644 --- a/detox/ios/Detox/TestRunner.m +++ b/detox/ios/Detox/TestRunner.m @@ -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/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) { 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 */, 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" 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 | diff --git a/docs/Guide.DebuggingInXcode.md b/docs/Guide.DebuggingInXcode.md index 7c46e43149..6d120ead31 100644 --- a/docs/Guide.DebuggingInXcode.md +++ b/docs/Guide.DebuggingInXcode.md @@ -1,84 +1,66 @@ ---- -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 -
+* 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** -## Step 1: Add 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. -Open your Xcode project and drag `Detox.framework` from `node_modules/detox/Detox.framework` to your project. +### Add launch arguments -> 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. +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 - -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: - -```json -"detox": { - "session": { - "server": "ws://localhost:8099", - "sessionId": "test" - } -} + ``` -
+> NOTE: Add each line as a separate line in Xcode. -## Step 4: Add a special xcode configuration to Detox config +### Add 'None' Configuration to Detox Section -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). -
+### Run Detox Server Manually -## Step 5: Run Detox server manually - -Type the following inside your project root: +Run the following command in your project root directory: ```sh detox run-server ``` -
+### Run Your Application + +> NOTE: Before running, place breakpoints you wish to debug. + +Run your application from Xcode as you normally do. -## Step 6: Run Detox tests +### 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. 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. 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