From 16051eb270e5cad34b884614263ee2084b4b4774 Mon Sep 17 00:00:00 2001 From: Asaf Korem Date: Tue, 23 Apr 2024 19:14:07 +0300 Subject: [PATCH 01/13] refactor(ios): remove unused files (DetoxHelper). --- .../DetoxHelper.xcodeproj/project.pbxproj | 530 ------------------ .../DetoxHelper/DetoxHelper/AppDelegate.h | 17 - .../DetoxHelper/DetoxHelper/AppDelegate.m | 51 -- .../AppIcon.appiconset/Contents.json | 68 --- .../Base.lproj/LaunchScreen.storyboard | 27 - .../DetoxHelper/Base.lproj/Main.storyboard | 50 -- .../DetoxHelper/DetoxHelper.entitlements | 8 - .../DetoxHelper/DetoxHelper/Info.plist | 45 -- .../DetoxHelper/DetoxHelper/ViewController.h | 15 - .../DetoxHelper/DetoxHelper/ViewController.m | 29 - .../DetoxHelper/DetoxHelper/main.m | 16 - .../Extension/ActionRequestHandler.h | 13 - .../Extension/ActionRequestHandler.m | 91 --- .../Extension/Extension.entitlements | 8 - .../Extension/ExtensionOperation.h | 15 - .../Extension/ExtensionOperation.m | 52 -- .../DetoxHelper/Extension/Info.plist | 36 -- .../Extension/JP/JPSimulatorHacks.h | 39 -- .../Extension/JP/JPSimulatorHacks.m | 134 ----- .../Extension/JP/JPSimulatorHacksDB.h | 37 -- .../Extension/JP/JPSimulatorHacksDB.m | 163 ------ .../SetNotificationPermissionOperation.h | 14 - .../SetNotificationPermissionOperation.m | 113 ---- .../Extension/SetPermissionOperation.h | 17 - .../Extension/SetPermissionOperation.m | 13 - .../Extension/SetPhotosPermissionOperation.h | 13 - .../Extension/SetPhotosPermissionOperation.m | 21 - 27 files changed, 1635 deletions(-) delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/DetoxHelper.xcodeproj/project.pbxproj delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/AppDelegate.h delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/AppDelegate.m delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/Base.lproj/LaunchScreen.storyboard delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/Base.lproj/Main.storyboard delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/DetoxHelper.entitlements delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/Info.plist delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/ViewController.h delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/ViewController.m delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/main.m delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/Extension/ActionRequestHandler.h delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/Extension/ActionRequestHandler.m delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/Extension/Extension.entitlements delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/Extension/ExtensionOperation.h delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/Extension/ExtensionOperation.m delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/Extension/Info.plist delete mode 100755 detox/ios/DetoxHelper/DetoxHelper/Extension/JP/JPSimulatorHacks.h delete mode 100755 detox/ios/DetoxHelper/DetoxHelper/Extension/JP/JPSimulatorHacks.m delete mode 100755 detox/ios/DetoxHelper/DetoxHelper/Extension/JP/JPSimulatorHacksDB.h delete mode 100755 detox/ios/DetoxHelper/DetoxHelper/Extension/JP/JPSimulatorHacksDB.m delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/Extension/SetNotificationPermissionOperation.h delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/Extension/SetNotificationPermissionOperation.m delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/Extension/SetPermissionOperation.h delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/Extension/SetPermissionOperation.m delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/Extension/SetPhotosPermissionOperation.h delete mode 100644 detox/ios/DetoxHelper/DetoxHelper/Extension/SetPhotosPermissionOperation.m diff --git a/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper.xcodeproj/project.pbxproj b/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper.xcodeproj/project.pbxproj deleted file mode 100644 index ba4a68453c..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper.xcodeproj/project.pbxproj +++ /dev/null @@ -1,530 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 391596C21E8BCFEB00FDD6F5 /* ExtensionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 391596C11E8BCFEB00FDD6F5 /* ExtensionOperation.m */; }; - 391596C51E8BD03A00FDD6F5 /* SetPermissionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 391596C41E8BD03A00FDD6F5 /* SetPermissionOperation.m */; }; - 391596C71E8BD79500FDD6F5 /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 391596C61E8BD79500FDD6F5 /* libsqlite3.tbd */; }; - 391596CD1E8BD7E500FDD6F5 /* JPSimulatorHacks.m in Sources */ = {isa = PBXBuildFile; fileRef = 391596CA1E8BD7E500FDD6F5 /* JPSimulatorHacks.m */; }; - 391596CE1E8BD7E500FDD6F5 /* JPSimulatorHacksDB.m in Sources */ = {isa = PBXBuildFile; fileRef = 391596CC1E8BD7E500FDD6F5 /* JPSimulatorHacksDB.m */; }; - 391596D11E8BDD8A00FDD6F5 /* SetPhotosPermissionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 391596D01E8BDD8A00FDD6F5 /* SetPhotosPermissionOperation.m */; }; - 394CDCEC1E8B9A6600A0FC4E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 394CDCEB1E8B9A6600A0FC4E /* main.m */; }; - 394CDCEF1E8B9A6600A0FC4E /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 394CDCEE1E8B9A6600A0FC4E /* AppDelegate.m */; }; - 394CDCF21E8B9A6600A0FC4E /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 394CDCF11E8B9A6600A0FC4E /* ViewController.m */; }; - 394CDCF51E8B9A6600A0FC4E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 394CDCF31E8B9A6600A0FC4E /* Main.storyboard */; }; - 394CDCF71E8B9A6600A0FC4E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 394CDCF61E8B9A6600A0FC4E /* Assets.xcassets */; }; - 394CDCFA1E8B9A6600A0FC4E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 394CDCF81E8B9A6600A0FC4E /* LaunchScreen.storyboard */; }; - 394CDD1D1E8BA22500A0FC4E /* ActionRequestHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 394CDD1C1E8BA22500A0FC4E /* ActionRequestHandler.m */; }; - 394CDD231E8BA22500A0FC4E /* Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 394CDD191E8BA22500A0FC4E /* Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; - 394CDD471E8BC18F00A0FC4E /* SetNotificationPermissionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 394CDD461E8BC18F00A0FC4E /* SetNotificationPermissionOperation.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 394CDD211E8BA22500A0FC4E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 394CDCDF1E8B9A6600A0FC4E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 394CDD181E8BA22500A0FC4E; - remoteInfo = Extension; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 394CDD141E8B9BEA00A0FC4E /* Embed App Extensions */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 13; - files = ( - 394CDD231E8BA22500A0FC4E /* Extension.appex in Embed App Extensions */, - ); - name = "Embed App Extensions"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 391596C01E8BCFEB00FDD6F5 /* ExtensionOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtensionOperation.h; sourceTree = ""; }; - 391596C11E8BCFEB00FDD6F5 /* ExtensionOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExtensionOperation.m; sourceTree = ""; }; - 391596C31E8BD03A00FDD6F5 /* SetPermissionOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SetPermissionOperation.h; sourceTree = ""; }; - 391596C41E8BD03A00FDD6F5 /* SetPermissionOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SetPermissionOperation.m; sourceTree = ""; }; - 391596C61E8BD79500FDD6F5 /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; }; - 391596C91E8BD7E500FDD6F5 /* JPSimulatorHacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JPSimulatorHacks.h; sourceTree = ""; }; - 391596CA1E8BD7E500FDD6F5 /* JPSimulatorHacks.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JPSimulatorHacks.m; sourceTree = ""; }; - 391596CB1E8BD7E500FDD6F5 /* JPSimulatorHacksDB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JPSimulatorHacksDB.h; sourceTree = ""; }; - 391596CC1E8BD7E500FDD6F5 /* JPSimulatorHacksDB.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JPSimulatorHacksDB.m; sourceTree = ""; }; - 391596CF1E8BDD8A00FDD6F5 /* SetPhotosPermissionOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SetPhotosPermissionOperation.h; sourceTree = ""; }; - 391596D01E8BDD8A00FDD6F5 /* SetPhotosPermissionOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SetPhotosPermissionOperation.m; sourceTree = ""; }; - 394CDCE71E8B9A6600A0FC4E /* DetoxHelper.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DetoxHelper.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 394CDCEB1E8B9A6600A0FC4E /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 394CDCED1E8B9A6600A0FC4E /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 394CDCEE1E8B9A6600A0FC4E /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 394CDCF01E8B9A6600A0FC4E /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - 394CDCF11E8B9A6600A0FC4E /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; - 394CDCF41E8B9A6600A0FC4E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 394CDCF61E8B9A6600A0FC4E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 394CDCF91E8B9A6600A0FC4E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 394CDCFB1E8B9A6600A0FC4E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 394CDD191E8BA22500A0FC4E /* Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = Extension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; - 394CDD1B1E8BA22500A0FC4E /* ActionRequestHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ActionRequestHandler.h; sourceTree = ""; }; - 394CDD1C1E8BA22500A0FC4E /* ActionRequestHandler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ActionRequestHandler.m; sourceTree = ""; }; - 394CDD201E8BA22500A0FC4E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 394CDD2A1E8BA34100A0FC4E /* Extension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Extension.entitlements; sourceTree = ""; }; - 394CDD421E8BB20D00A0FC4E /* DetoxHelper.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DetoxHelper.entitlements; sourceTree = ""; }; - 394CDD451E8BC18F00A0FC4E /* SetNotificationPermissionOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SetNotificationPermissionOperation.h; sourceTree = ""; }; - 394CDD461E8BC18F00A0FC4E /* SetNotificationPermissionOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SetNotificationPermissionOperation.m; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 394CDCE41E8B9A6600A0FC4E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 394CDD161E8BA22500A0FC4E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 391596C71E8BD79500FDD6F5 /* libsqlite3.tbd in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 391596C81E8BD7D200FDD6F5 /* JP */ = { - isa = PBXGroup; - children = ( - 391596C91E8BD7E500FDD6F5 /* JPSimulatorHacks.h */, - 391596CA1E8BD7E500FDD6F5 /* JPSimulatorHacks.m */, - 391596CB1E8BD7E500FDD6F5 /* JPSimulatorHacksDB.h */, - 391596CC1E8BD7E500FDD6F5 /* JPSimulatorHacksDB.m */, - ); - path = JP; - sourceTree = ""; - }; - 394CDCDE1E8B9A6600A0FC4E = { - isa = PBXGroup; - children = ( - 394CDCE91E8B9A6600A0FC4E /* DetoxHelper */, - 394CDD1A1E8BA22500A0FC4E /* Extension */, - 394CDCE81E8B9A6600A0FC4E /* Products */, - 394CDD271E8BA34100A0FC4E /* Frameworks */, - ); - sourceTree = ""; - }; - 394CDCE81E8B9A6600A0FC4E /* Products */ = { - isa = PBXGroup; - children = ( - 394CDCE71E8B9A6600A0FC4E /* DetoxHelper.app */, - 394CDD191E8BA22500A0FC4E /* Extension.appex */, - ); - name = Products; - sourceTree = ""; - }; - 394CDCE91E8B9A6600A0FC4E /* DetoxHelper */ = { - isa = PBXGroup; - children = ( - 394CDD421E8BB20D00A0FC4E /* DetoxHelper.entitlements */, - 394CDCED1E8B9A6600A0FC4E /* AppDelegate.h */, - 394CDCEE1E8B9A6600A0FC4E /* AppDelegate.m */, - 394CDCF01E8B9A6600A0FC4E /* ViewController.h */, - 394CDCF11E8B9A6600A0FC4E /* ViewController.m */, - 394CDCF31E8B9A6600A0FC4E /* Main.storyboard */, - 394CDCF61E8B9A6600A0FC4E /* Assets.xcassets */, - 394CDCF81E8B9A6600A0FC4E /* LaunchScreen.storyboard */, - 394CDCFB1E8B9A6600A0FC4E /* Info.plist */, - 394CDCEA1E8B9A6600A0FC4E /* Supporting Files */, - ); - path = DetoxHelper; - sourceTree = ""; - }; - 394CDCEA1E8B9A6600A0FC4E /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 394CDCEB1E8B9A6600A0FC4E /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 394CDD1A1E8BA22500A0FC4E /* Extension */ = { - isa = PBXGroup; - children = ( - 391596C81E8BD7D200FDD6F5 /* JP */, - 394CDD2A1E8BA34100A0FC4E /* Extension.entitlements */, - 391596C01E8BCFEB00FDD6F5 /* ExtensionOperation.h */, - 391596C11E8BCFEB00FDD6F5 /* ExtensionOperation.m */, - 391596C31E8BD03A00FDD6F5 /* SetPermissionOperation.h */, - 391596C41E8BD03A00FDD6F5 /* SetPermissionOperation.m */, - 394CDD451E8BC18F00A0FC4E /* SetNotificationPermissionOperation.h */, - 394CDD461E8BC18F00A0FC4E /* SetNotificationPermissionOperation.m */, - 391596CF1E8BDD8A00FDD6F5 /* SetPhotosPermissionOperation.h */, - 391596D01E8BDD8A00FDD6F5 /* SetPhotosPermissionOperation.m */, - 394CDD1B1E8BA22500A0FC4E /* ActionRequestHandler.h */, - 394CDD1C1E8BA22500A0FC4E /* ActionRequestHandler.m */, - 394CDD201E8BA22500A0FC4E /* Info.plist */, - ); - path = Extension; - sourceTree = ""; - }; - 394CDD271E8BA34100A0FC4E /* Frameworks */ = { - isa = PBXGroup; - children = ( - 391596C61E8BD79500FDD6F5 /* libsqlite3.tbd */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 394CDCE61E8B9A6600A0FC4E /* DetoxHelper */ = { - isa = PBXNativeTarget; - buildConfigurationList = 394CDCFE1E8B9A6600A0FC4E /* Build configuration list for PBXNativeTarget "DetoxHelper" */; - buildPhases = ( - 394CDCE31E8B9A6600A0FC4E /* Sources */, - 394CDCE41E8B9A6600A0FC4E /* Frameworks */, - 394CDCE51E8B9A6600A0FC4E /* Resources */, - 394CDD141E8B9BEA00A0FC4E /* Embed App Extensions */, - ); - buildRules = ( - ); - dependencies = ( - 394CDD221E8BA22500A0FC4E /* PBXTargetDependency */, - ); - name = DetoxHelper; - productName = DetoxHelper; - productReference = 394CDCE71E8B9A6600A0FC4E /* DetoxHelper.app */; - productType = "com.apple.product-type.application"; - }; - 394CDD181E8BA22500A0FC4E /* Extension */ = { - isa = PBXNativeTarget; - buildConfigurationList = 394CDD241E8BA22500A0FC4E /* Build configuration list for PBXNativeTarget "Extension" */; - buildPhases = ( - 394CDD151E8BA22500A0FC4E /* Sources */, - 394CDD161E8BA22500A0FC4E /* Frameworks */, - 394CDD171E8BA22500A0FC4E /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Extension; - productName = Extension; - productReference = 394CDD191E8BA22500A0FC4E /* Extension.appex */; - productType = "com.apple.product-type.app-extension"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 394CDCDF1E8B9A6600A0FC4E /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0830; - ORGANIZATIONNAME = Wix; - TargetAttributes = { - 394CDCE61E8B9A6600A0FC4E = { - CreatedOnToolsVersion = 8.3; - ProvisioningStyle = Manual; - SystemCapabilities = { - com.apple.InterAppAudio = { - enabled = 0; - }; - }; - }; - 394CDD181E8BA22500A0FC4E = { - CreatedOnToolsVersion = 8.3; - ProvisioningStyle = Manual; - SystemCapabilities = { - com.apple.WAC = { - enabled = 0; - }; - }; - }; - }; - }; - buildConfigurationList = 394CDCE21E8B9A6600A0FC4E /* Build configuration list for PBXProject "DetoxHelper" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 394CDCDE1E8B9A6600A0FC4E; - productRefGroup = 394CDCE81E8B9A6600A0FC4E /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 394CDCE61E8B9A6600A0FC4E /* DetoxHelper */, - 394CDD181E8BA22500A0FC4E /* Extension */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 394CDCE51E8B9A6600A0FC4E /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 394CDCFA1E8B9A6600A0FC4E /* LaunchScreen.storyboard in Resources */, - 394CDCF71E8B9A6600A0FC4E /* Assets.xcassets in Resources */, - 394CDCF51E8B9A6600A0FC4E /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 394CDD171E8BA22500A0FC4E /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 394CDCE31E8B9A6600A0FC4E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 394CDCF21E8B9A6600A0FC4E /* ViewController.m in Sources */, - 394CDCEF1E8B9A6600A0FC4E /* AppDelegate.m in Sources */, - 394CDCEC1E8B9A6600A0FC4E /* main.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 394CDD151E8BA22500A0FC4E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 391596C21E8BCFEB00FDD6F5 /* ExtensionOperation.m in Sources */, - 391596C51E8BD03A00FDD6F5 /* SetPermissionOperation.m in Sources */, - 394CDD471E8BC18F00A0FC4E /* SetNotificationPermissionOperation.m in Sources */, - 391596CE1E8BD7E500FDD6F5 /* JPSimulatorHacksDB.m in Sources */, - 391596D11E8BDD8A00FDD6F5 /* SetPhotosPermissionOperation.m in Sources */, - 394CDD1D1E8BA22500A0FC4E /* ActionRequestHandler.m in Sources */, - 391596CD1E8BD7E500FDD6F5 /* JPSimulatorHacks.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 394CDD221E8BA22500A0FC4E /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 394CDD181E8BA22500A0FC4E /* Extension */; - targetProxy = 394CDD211E8BA22500A0FC4E /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 394CDCF31E8B9A6600A0FC4E /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 394CDCF41E8B9A6600A0FC4E /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 394CDCF81E8B9A6600A0FC4E /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 394CDCF91E8B9A6600A0FC4E /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 394CDCFC1E8B9A6600A0FC4E /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 394CDCFD1E8B9A6600A0FC4E /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 394CDCFF1E8B9A6600A0FC4E /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_ENTITLEMENTS = DetoxHelper/DetoxHelper.entitlements; - DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = DetoxHelper/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.wix.DetoxHelper; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - }; - name = Debug; - }; - 394CDD001E8B9A6600A0FC4E /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_ENTITLEMENTS = DetoxHelper/DetoxHelper.entitlements; - DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = DetoxHelper/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.wix.DetoxHelper; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - }; - name = Release; - }; - 394CDD251E8BA22500A0FC4E /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_ENTITLEMENTS = Extension/Extension.entitlements; - DEVELOPMENT_TEAM = ""; - GCC_WARN_UNDECLARED_SELECTOR = NO; - INFOPLIST_FILE = Extension/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.wix.DetoxHelper.Extension; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 394CDD261E8BA22500A0FC4E /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_ENTITLEMENTS = Extension/Extension.entitlements; - DEVELOPMENT_TEAM = ""; - GCC_WARN_UNDECLARED_SELECTOR = NO; - INFOPLIST_FILE = Extension/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.wix.DetoxHelper.Extension; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - SKIP_INSTALL = YES; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 394CDCE21E8B9A6600A0FC4E /* Build configuration list for PBXProject "DetoxHelper" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 394CDCFC1E8B9A6600A0FC4E /* Debug */, - 394CDCFD1E8B9A6600A0FC4E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 394CDCFE1E8B9A6600A0FC4E /* Build configuration list for PBXNativeTarget "DetoxHelper" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 394CDCFF1E8B9A6600A0FC4E /* Debug */, - 394CDD001E8B9A6600A0FC4E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 394CDD241E8BA22500A0FC4E /* Build configuration list for PBXNativeTarget "Extension" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 394CDD251E8BA22500A0FC4E /* Debug */, - 394CDD261E8BA22500A0FC4E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 394CDCDF1E8B9A6600A0FC4E /* Project object */; -} diff --git a/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/AppDelegate.h b/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/AppDelegate.h deleted file mode 100644 index 609522453a..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/AppDelegate.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// AppDelegate.h -// DetoxHelper -// -// Created by Leo Natan (Wix) on 29/03/2017. -// Copyright © 2017 Wix. All rights reserved. -// - -#import - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - - -@end - diff --git a/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/AppDelegate.m b/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/AppDelegate.m deleted file mode 100644 index 45291ce3cf..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/AppDelegate.m +++ /dev/null @@ -1,51 +0,0 @@ -// -// AppDelegate.m -// DetoxHelper -// -// Created by Leo Natan (Wix) on 29/03/2017. -// Copyright © 2017 Wix. All rights reserved. -// - -#import "AppDelegate.h" - -@interface AppDelegate () - -@end - -@implementation AppDelegate - - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Override point for customization after application launch. - return YES; -} - - -- (void)applicationWillResignActive:(UIApplication *)application { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. -} - - -- (void)applicationDidEnterBackground:(UIApplication *)application { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. -} - - -- (void)applicationWillEnterForeground:(UIApplication *)application { - // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. -} - - -- (void)applicationDidBecomeActive:(UIApplication *)application { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. -} - - -- (void)applicationWillTerminate:(UIApplication *)application { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. -} - - -@end diff --git a/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/Assets.xcassets/AppIcon.appiconset/Contents.json b/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 36d2c80d88..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/Base.lproj/LaunchScreen.storyboard b/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index fdf3f97d1b..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/Base.lproj/Main.storyboard b/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/Base.lproj/Main.storyboard deleted file mode 100644 index 77685e6057..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/Base.lproj/Main.storyboard +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/DetoxHelper.entitlements b/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/DetoxHelper.entitlements deleted file mode 100644 index 6c344eb5db..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/DetoxHelper.entitlements +++ /dev/null @@ -1,8 +0,0 @@ - - - - - com.apple.bulletinboard.settings - - - diff --git a/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/Info.plist b/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/Info.plist deleted file mode 100644 index d052473868..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/Info.plist +++ /dev/null @@ -1,45 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/ViewController.h b/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/ViewController.h deleted file mode 100644 index a2725af181..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/ViewController.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// ViewController.h -// DetoxHelper -// -// Created by Leo Natan (Wix) on 29/03/2017. -// Copyright © 2017 Wix. All rights reserved. -// - -#import - -@interface ViewController : UIViewController - - -@end - diff --git a/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/ViewController.m b/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/ViewController.m deleted file mode 100644 index c402de177b..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/ViewController.m +++ /dev/null @@ -1,29 +0,0 @@ -// -// ViewController.m -// DetoxHelper -// -// Created by Leo Natan (Wix) on 29/03/2017. -// Copyright © 2017 Wix. All rights reserved. -// - -#import "ViewController.h" - -@interface ViewController () - -@end - -@implementation ViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. -} - - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - - -@end diff --git a/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/main.m b/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/main.m deleted file mode 100644 index 03ebf9a848..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/DetoxHelper/main.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// main.m -// DetoxHelper -// -// Created by Leo Natan (Wix) on 29/03/2017. -// Copyright © 2017 Wix. All rights reserved. -// - -#import -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/detox/ios/DetoxHelper/DetoxHelper/Extension/ActionRequestHandler.h b/detox/ios/DetoxHelper/DetoxHelper/Extension/ActionRequestHandler.h deleted file mode 100644 index 59085bb066..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/Extension/ActionRequestHandler.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// ActionRequestHandler.h -// Extension -// -// Created by Leo Natan (Wix) on 29/03/2017. -// Copyright © 2017 Wix. All rights reserved. -// - -#import - -@interface ActionRequestHandler : NSObject - -@end diff --git a/detox/ios/DetoxHelper/DetoxHelper/Extension/ActionRequestHandler.m b/detox/ios/DetoxHelper/DetoxHelper/Extension/ActionRequestHandler.m deleted file mode 100644 index f4c0f86b81..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/Extension/ActionRequestHandler.m +++ /dev/null @@ -1,91 +0,0 @@ -// -// ActionRequestHandler.m -// Extension -// -// Created by Leo Natan (Wix) on 29/03/2017. -// Copyright © 2017 Wix. All rights reserved. -// - -#import "ActionRequestHandler.h" -#import -#import "SetPermissionOperation.h" -#import "SetNotificationPermissionOperation.h" -#import "SetPhotosPermissionOperation.h" - -@interface ActionRequestHandler () -{ - NSOperationQueue* _operationQueue; -} - -@end - -@implementation ActionRequestHandler - -- (NSArray*)_operationsForPermissionsAction:(NSDictionary*)permissionsAction bundleIdentifier:(NSString*)bundleIdentifier displayName:(NSString*)displayName -{ - NSDictionary* classNameMapping = @{@"notifications": [SetNotificationPermissionOperation class], - @"photos": [SetPhotosPermissionOperation class]}; - - NSMutableArray* rv = [NSMutableArray new]; - - [permissionsAction.allKeys enumerateObjectsUsingBlock:^(NSString* _Nonnull key, NSUInteger idx, BOOL * _Nonnull stop) { - SetPermissionOperation* operation = nil; - - Class cls = classNameMapping[key]; - if(cls == nil) - { - return; - } - - operation = [cls new]; - operation.bundleIdentifier = bundleIdentifier; - operation.displayName = displayName; - operation.permissionStatus = permissionsAction[key]; - - if(operation) - { - [rv addObject:operation]; - } - }]; - - return rv; -} - -- (void)_handleExtensionRequest:(NSDictionary*)request completionHandler:(void(^)())handler -{ - _operationQueue = [NSOperationQueue new]; - _operationQueue.name = @"DetoxHelper Extension Queue"; - - NSBlockOperation* cleanup = [NSBlockOperation blockOperationWithBlock:handler]; - - NSString* bundleIdentifier = request[@"bundleIdentifier"]; - NSParameterAssert(bundleIdentifier != nil); - - [request.allKeys enumerateObjectsUsingBlock:^(NSString* _Nonnull key, NSUInteger idx, BOOL * _Nonnull stop) { - if([key isEqualToString:@"setPermissions"]) - { - NSArray* operations = [self _operationsForPermissionsAction:request[key] bundleIdentifier:bundleIdentifier displayName:bundleIdentifier]; - [operations enumerateObjectsUsingBlock:^(NSOperation * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - [cleanup addDependency:obj]; - }]; - - [_operationQueue addOperations:operations waitUntilFinished:NO]; - } - }]; - - [_operationQueue addOperation:cleanup]; -} - -- (void)beginRequestWithExtensionContext:(NSExtensionContext *)context -{ - NSParameterAssert(context.inputItems.count == 1); - NSParameterAssert([context.inputItems.firstObject attachments].count == 1); - - [[context.inputItems.firstObject attachments].firstObject loadItemForTypeIdentifier:(id)kUTTypeItem options:nil completionHandler:^(id _Nullable item, NSError * _Null_unspecified error) { - [self _handleExtensionRequest:item completionHandler:^() { - [context completeRequestReturningItems:nil completionHandler:nil]; - }]; - }]; -} - -@end diff --git a/detox/ios/DetoxHelper/DetoxHelper/Extension/Extension.entitlements b/detox/ios/DetoxHelper/DetoxHelper/Extension/Extension.entitlements deleted file mode 100644 index 6c344eb5db..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/Extension/Extension.entitlements +++ /dev/null @@ -1,8 +0,0 @@ - - - - - com.apple.bulletinboard.settings - - - diff --git a/detox/ios/DetoxHelper/DetoxHelper/Extension/ExtensionOperation.h b/detox/ios/DetoxHelper/DetoxHelper/Extension/ExtensionOperation.h deleted file mode 100644 index 19e052fffb..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/Extension/ExtensionOperation.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// ExtensionOperation.h -// DetoxHelper -// -// Created by Leo Natan (Wix) on 29/03/2017. -// Copyright © 2017 Wix. All rights reserved. -// - -#import - -@interface ExtensionOperation : NSOperation - -- (void)executeAsyncWithCompletionHandler:(void(^)(void))handler; - -@end diff --git a/detox/ios/DetoxHelper/DetoxHelper/Extension/ExtensionOperation.m b/detox/ios/DetoxHelper/DetoxHelper/Extension/ExtensionOperation.m deleted file mode 100644 index 14b8d12ddc..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/Extension/ExtensionOperation.m +++ /dev/null @@ -1,52 +0,0 @@ -// -// ExtensionOperation.m -// DetoxHelper -// -// Created by Leo Natan (Wix) on 29/03/2017. -// Copyright © 2017 Wix. All rights reserved. -// - -#import "ExtensionOperation.h" - -@implementation ExtensionOperation -{ - BOOL _isExecuting, _isFinished; -} - -- (void)executeAsyncWithCompletionHandler:(void (^)(void))handler -{ - handler(); -} - -- (void)start -{ - NSLog(@"%@ - starting", NSStringFromClass(self.class)); - - [self willChangeValueForKey:@"isExecuting"]; - _isExecuting = YES; - [self didChangeValueForKey:@"isExecuting"]; - - [self executeAsyncWithCompletionHandler:^{ - NSLog(@"%@ - ending", NSStringFromClass(self.class)); - [self willChangeValueForKey:@"isExecuting"]; - _isExecuting = NO; - [self didChangeValueForKey:@"isExecuting"]; - - [self willChangeValueForKey:@"isFinished"]; - _isFinished = YES; - [self didChangeValueForKey:@"isFinished"]; - }]; -} - -- (BOOL)isExecuting -{ - return _isExecuting; -} - -- (BOOL)isFinished -{ - return _isFinished; -} - - -@end diff --git a/detox/ios/DetoxHelper/DetoxHelper/Extension/Info.plist b/detox/ios/DetoxHelper/DetoxHelper/Extension/Info.plist deleted file mode 100644 index 3323b01376..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/Extension/Info.plist +++ /dev/null @@ -1,36 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - Extension - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - XPC! - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - NSExtension - - NSExtensionAttributes - - NSExtensionActivationRule - FALSEPREDICATE - - NSExtensionPointIdentifier - com.apple.services - NSExtensionPrincipalClass - ActionRequestHandler - - - diff --git a/detox/ios/DetoxHelper/DetoxHelper/Extension/JP/JPSimulatorHacks.h b/detox/ios/DetoxHelper/DetoxHelper/Extension/JP/JPSimulatorHacks.h deleted file mode 100755 index 579f969e5e..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/Extension/JP/JPSimulatorHacks.h +++ /dev/null @@ -1,39 +0,0 @@ -// -// JPSimulatorHacks.h -// JPSimulatorHacks -// -// Created by Johannes Plunien on 04/06/14. -// Copyright (C) 2014 Johannes Plunien -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#import - -@class ALAsset; - -@interface JPSimulatorHacks : NSObject - -+ (void)setPhotosEnabled:(BOOL)enabled forBundleIdentifier:(NSString*)bundleIdentifier; -+ (void)setCalendarEnabled:(BOOL)enabled forBundleIdentifier:(NSString*)bundleIdentifier; -+ (void)setHomeKitEnabled:(BOOL)enabled forBundleIdentifier:(NSString*)bundleIdentifier; -+ (void)setContactsEnabled:(BOOL)enabled forBundleIdentifier:(NSString*)bundleIdentifier; -+ (void)setLocationEnabled:(BOOL)enabled forBundleIdentifier:(NSString*)bundleIdentifier; - -@end diff --git a/detox/ios/DetoxHelper/DetoxHelper/Extension/JP/JPSimulatorHacks.m b/detox/ios/DetoxHelper/DetoxHelper/Extension/JP/JPSimulatorHacks.m deleted file mode 100755 index c3941c7471..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/Extension/JP/JPSimulatorHacks.m +++ /dev/null @@ -1,134 +0,0 @@ -// -// JPSimulatorHacks.m -// JPSimulatorHacks -// -// Created by Johannes Plunien on 04/06/14. -// Copyright (C) 2014 Johannes Plunien -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#import -#import "JPSimulatorHacks.h" -#import "JPSimulatorHacksDB.h" - -@implementation JPSimulatorHacks - -static NSString * const JPSimulatorHacksServiceAddressBook = @"kTCCServiceAddressBook"; -static NSString * const JPSimulatorHacksServicePhotos = @"kTCCServicePhotos"; -static NSString * const JPSimulatorHacksServiceCalendar = @"kTCCServiceCalendar"; -static NSString * const JPSimulatorHacksServiceHomeKit = @"kTCCServiceWillow"; -static NSString * const JPSimulatorHacksServiceContacts = @"kTCCServiceContacts"; - -static NSTimeInterval JPSimulatorHacksTimeout = 15.0f; - -#pragma mark - Public - -+ (void)setPhotosEnabled:(BOOL)enabled forBundleIdentifier:(NSString *)bundleIdentifier -{ - [self changeAccessToService:JPSimulatorHacksServicePhotos bundleIdentifier:bundleIdentifier allowed:enabled]; -} - -+ (void)setCalendarEnabled:(BOOL)enabled forBundleIdentifier:(NSString *)bundleIdentifier -{ - [self changeAccessToService:JPSimulatorHacksServiceCalendar bundleIdentifier:bundleIdentifier allowed:enabled]; -} - -+ (void)setHomeKitEnabled:(BOOL)enabled forBundleIdentifier:(NSString *)bundleIdentifier -{ - [self changeAccessToService:JPSimulatorHacksServiceHomeKit bundleIdentifier:bundleIdentifier allowed:enabled]; -} - -+ (void)setContactsEnabled:(BOOL)enabled forBundleIdentifier:(NSString *)bundleIdentifier -{ - [self changeAccessToService:JPSimulatorHacksServiceContacts bundleIdentifier:bundleIdentifier allowed:enabled]; -} - -+ (void)setLocationEnabled:(BOOL)enabled forBundleIdentifier:(NSString *)bundleIdentifier -{ -// [self changeAccessToService:JPSimulatorHacksServicePhotos bundleIdentifier:bundleIdentifier allowed:enabled]; -} - -#pragma mark - Private - -+ (NSString *)cddbPath -{ - return [[self libraryURL] URLByAppendingPathComponent:@"TCC/TCC.db"].URLByStandardizingPath.path; -} - -+ (NSURL *)libraryURL -{ - static NSURL *result; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - NSURL *url = [[NSBundle mainBundle].bundleURL URLByAppendingPathComponent:@".."]; - do { - url = [[url URLByAppendingPathComponent:@".."] URLByStandardizingPath]; - NSURL *libraryURL = [url URLByAppendingPathComponent:@"Library"]; - BOOL isDirectory; - if ([[NSFileManager defaultManager] fileExistsAtPath:libraryURL.path isDirectory:&isDirectory] && isDirectory) { - url = libraryURL; - break; - } - } while (![url.path isEqualToString:@"/"]); - result = url; - }); - return result; -} - -#pragma mark - Helper - -+ (BOOL)changeAccessToService:(NSString *)service - bundleIdentifier:(NSString *)bundleIdentifier - allowed:(BOOL)allowed -{ -#if !(TARGET_IPHONE_SIMULATOR) - return NO; -#endif - - BOOL success = NO; - NSDate *start = [NSDate date]; - - while (!success) { - NSTimeInterval elapsed = [[NSDate date] timeIntervalSinceDate:start]; - if (elapsed > JPSimulatorHacksTimeout) break; - - if (![[NSFileManager defaultManager] fileExistsAtPath:[self cddbPath]]) continue; - - JPSimulatorHacksDB *db = [JPSimulatorHacksDB databaseWithPath:[self cddbPath]]; - if (![db open]) continue; - - NSString *query = @"REPLACE INTO access (service, client, client_type, allowed, prompt_count) VALUES (?, ?, ?, ?, ?)"; - NSArray *parameters = @[service, bundleIdentifier, @"0", [@(allowed) stringValue], @"1"]; - if ([db executeUpdate:query withArgumentsInArray:parameters]) { - success = YES; - } - else { - [db close]; - NSLog(@"JPSimulatorHacks ERROR: %@", [db lastErrorMessage]); - } - - [db close]; - [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.05]]; - } - - return success; -} - -@end diff --git a/detox/ios/DetoxHelper/DetoxHelper/Extension/JP/JPSimulatorHacksDB.h b/detox/ios/DetoxHelper/DetoxHelper/Extension/JP/JPSimulatorHacksDB.h deleted file mode 100755 index 0f18cbb2f3..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/Extension/JP/JPSimulatorHacksDB.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// JPSimulatorHacksDB.h -// JPSimulatorHacks -// -// Created by Johannes Plunien on 25/01/15. -// Copyright (C) 2015 Johannes Plunien -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#import - -@interface JPSimulatorHacksDB : NSObject - -+ (instancetype)databaseWithPath:(NSString *)path; -- (BOOL)close; -- (BOOL)executeUpdate:(NSString*)sql withArgumentsInArray:(NSArray *)arguments; -- (NSString *)lastErrorMessage; -- (BOOL)open; - -@end diff --git a/detox/ios/DetoxHelper/DetoxHelper/Extension/JP/JPSimulatorHacksDB.m b/detox/ios/DetoxHelper/DetoxHelper/Extension/JP/JPSimulatorHacksDB.m deleted file mode 100755 index d76a4fbc4d..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/Extension/JP/JPSimulatorHacksDB.m +++ /dev/null @@ -1,163 +0,0 @@ -// -// JPSimulatorHacksDB.m -// JPSimulatorHacks -// -// Created by Johannes Plunien on 25/01/15. -// Copyright (C) 2015 Johannes Plunien -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#import "JPSimulatorHacksDB.h" -#if defined(JPSH_SQLITE_STANDALONE) -#import -#else -#import -#endif - -@interface JPSimulatorHacksDB () { - NSString *_databasePath; - sqlite3 *_db; -} - -@end - -@implementation JPSimulatorHacksDB - -+ (instancetype)databaseWithPath:(NSString *)path -{ - return [[self alloc] initWithPath:path]; -} - -- (instancetype)initWithPath:(NSString*)path -{ - assert(sqlite3_threadsafe()); - - self = [super init]; - if (self) { - _databasePath = path.copy; - } - - return self; -} - -- (BOOL)close -{ - if (!_db) { - return YES; - } - - int rc; - BOOL retry; - BOOL triedFinalizingOpenStatements = NO; - - do { - retry = NO; - rc = sqlite3_close(_db); - if (SQLITE_BUSY == rc || SQLITE_LOCKED == rc) { - if (!triedFinalizingOpenStatements) { - triedFinalizingOpenStatements = YES; - sqlite3_stmt *pStmt; - while ((pStmt = sqlite3_next_stmt(_db, nil)) !=0) { - NSLog(@"Closing leaked statement"); - sqlite3_finalize(pStmt); - retry = YES; - } - } - } - else if (SQLITE_OK != rc) { - NSLog(@"error closing!: %d", rc); - } - } while (retry); - - _db = nil; - return YES; -} - -- (BOOL)executeUpdate:(NSString*)sql withArgumentsInArray:(NSArray *)arrayArgs -{ - if (!_db) { - return NO; - } - - int rc = 0x00; - sqlite3_stmt *pStmt = 0x00; - - rc = sqlite3_prepare_v2(_db, [sql UTF8String], -1, &pStmt, 0); - if (SQLITE_OK != rc) { - sqlite3_finalize(pStmt); - return NO; - } - - id obj; - int idx = 0; - int queryCount = sqlite3_bind_parameter_count(pStmt); - while (idx < queryCount) { - if (arrayArgs && idx < (int)[arrayArgs count]) { - obj = [arrayArgs objectAtIndex:(NSUInteger)idx]; - } - else { - break; - } - idx++; - sqlite3_bind_text(pStmt, idx, [[obj description] UTF8String], -1, SQLITE_STATIC); - } - - if (idx != queryCount) { - NSLog(@"sqlite3_bind_text error: the bind count (%d) is not correct for the # of variables in the query (%d) (%@) (executeUpdate)", idx, queryCount, sql); - sqlite3_finalize(pStmt); - return NO; - } - - rc = sqlite3_step(pStmt); - if (SQLITE_DONE != rc) { - NSLog(@"sqlite3_step error: (%d: %s)", rc, sqlite3_errmsg(_db)); - NSLog(@"DB Query: %@", sql); - } - - rc = sqlite3_finalize(pStmt); - if (SQLITE_OK != rc) { - NSLog(@"sqlite3_finalize error: (%d: %s)", rc, sqlite3_errmsg(_db)); - NSLog(@"DB Query: %@", sql); - } - - return (rc == SQLITE_DONE || rc == SQLITE_OK); -} - -- (NSString *)lastErrorMessage -{ - return [NSString stringWithUTF8String:sqlite3_errmsg(_db)]; -} - -- (BOOL)open -{ - if (_db) { - return YES; - } - - int err = sqlite3_open(_databasePath.fileSystemRepresentation, &_db); - if (err != SQLITE_OK) { - NSLog(@"error opening!: %d", err); - return NO; - } - - return YES; -} - -@end diff --git a/detox/ios/DetoxHelper/DetoxHelper/Extension/SetNotificationPermissionOperation.h b/detox/ios/DetoxHelper/DetoxHelper/Extension/SetNotificationPermissionOperation.h deleted file mode 100644 index c42f1eefb5..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/Extension/SetNotificationPermissionOperation.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// SetNotificationPermissionOperation.h -// DetoxHelper -// -// Created by Leo Natan (Wix) on 29/03/2017. -// Copyright © 2017 Wix. All rights reserved. -// - -#import -#import "SetPermissionOperation.h" - -@interface SetNotificationPermissionOperation : SetPermissionOperation - -@end diff --git a/detox/ios/DetoxHelper/DetoxHelper/Extension/SetNotificationPermissionOperation.m b/detox/ios/DetoxHelper/DetoxHelper/Extension/SetNotificationPermissionOperation.m deleted file mode 100644 index cd3b4c0788..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/Extension/SetNotificationPermissionOperation.m +++ /dev/null @@ -1,113 +0,0 @@ -// -// SetNotificationPermissionOperation.m -// DetoxHelper -// -// Created by Leo Natan (Wix) on 29/03/2017. -// Copyright © 2017 Wix. All rights reserved. -// - -#import "SetNotificationPermissionOperation.h" - -@implementation SetNotificationPermissionOperation - -+ (NSURL *)_libraryURL -{ - static NSURL *result; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - NSURL *url = [[NSBundle mainBundle].bundleURL URLByAppendingPathComponent:@".."]; - do { - url = [[url URLByAppendingPathComponent:@".."] URLByStandardizingPath]; - NSURL *libraryURL = [url URLByAppendingPathComponent:@"Library"]; - BOOL isDirectory; - if ([[NSFileManager defaultManager] fileExistsAtPath:libraryURL.path isDirectory:&isDirectory] && isDirectory) { - url = libraryURL; - break; - } - } while (![url.path isEqualToString:@"/"]); - result = url; - }); - return result; -} - -- (void)_setNotificationsEnabled:(BOOL)enabled forBundleIdentifier:(NSString*)bundleIdentifier displayName:(NSString*)displayName completionHandler:(void(^)(NSError* error))handler -{ - NSBundle* foundationBundle = [NSBundle bundleForClass:[NSExtensionContext class]]; - - NSBundle* bundle = nil; - Class cls = NSClassFromString(@"BBSectionInfo"); - if(cls == nil) - { - bundle = [NSBundle bundleWithURL:[[foundationBundle.bundleURL URLByAppendingPathComponent:@"../../PrivateFrameworks/BulletinBoard.framework"] URLByStandardizingPath]]; - [bundle load]; - } - else - { - bundle = [NSBundle bundleForClass:cls]; - } - cls = [bundle classNamed:@"BBSectionInfo"]; - - id obj = [cls new]; - [obj setValue:@NO forKey:@"suppressFromSettings"]; - [obj setValue:@0 forKey:@"suppressedSettings"]; - [obj setValue:@NO forKey:@"displaysCriticalBulletins"]; - [obj setValue:@0 forKey:@"sectionCategory"]; - [obj setValue:@0 forKey:@"subsectionPriority"]; - [obj setValue:@0 forKey:@"sectionType"]; - [obj setValue:@NO forKey:@"hideWeeApp"]; - - [obj setValue:bundleIdentifier forKey:@"sectionID"]; - - cls = [bundle classNamed:@"BBSectionInfoSettings"]; - id settings = [cls new]; - [settings setValue:@63 forKey:@"pushSettings"]; - [settings setValue:@YES forKey:@"showsInNotificationCenter"]; - [settings setValue:@(enabled) forKey:@"allowsNotifications"]; - [settings setValue:@YES forKey:@"showsOnExternalDevices"]; - [settings setValue:@0 forKey:@"contentPreviewSetting"]; - [settings setValue:@1 forKey:@"alertType"]; - [settings setValue:@YES forKey:@"showsInLockScreen"]; - [settings setValue:@NO forKey:@"carPlaySetting"]; - - [obj setValue:settings forKey:@"sectionInfoSettings"]; - - [obj setValue:bundleIdentifier forKey:@"sectionID"]; - [obj setValue:displayName forKey:@"appName"]; - [obj setValue:displayName forKey:@"displayName"]; - -// NSData* sectionInfoData = [NSKeyedArchiver archivedDataWithRootObject:obj]; -// NSMutableDictionary* bulletingSectionInfo = [NSMutableDictionary dictionaryWithContentsOfFile:@"/Users/lnatan/Library/Developer/CoreSimulator/Devices/9446E8CE-9559-4D13-AB75-E7EED7EDA36A/data/Library/BulletinBoard/SectionInfo.plist"]; -// bulletingSectionInfo[@"com.LeoNatan.LNPopupControllerExample-"] = sectionInfoData; -// [bulletingSectionInfo writeToFile:@"/Users/lnatan/Library/Developer/CoreSimulator/Devices/9446E8CE-9559-4D13-AB75-E7EED7EDA36A/data/Library/BulletinBoard/SectionInfo.plist" atomically:YES]; - - id gw = [NSClassFromString(@"BBSettingsGateway") new]; - - NSString* zz = bundleIdentifier; - - NSInvocation* inv = [NSInvocation invocationWithMethodSignature:[gw methodSignatureForSelector:@selector(setSectionInfo:forSectionID:withCompletion:)]]; - [inv setTarget:gw]; - [inv setSelector:@selector(setSectionInfo:forSectionID:withCompletion:)]; - [inv setArgument:&obj atIndex:2]; - [inv setArgument:&zz atIndex:3]; - - [inv retainArguments]; - - id comp = [handler copy]; - - [inv setArgument:&comp atIndex:4]; - [inv invoke]; -} - -- (void)executeAsyncWithCompletionHandler:(void (^)(void))handler -{ - [self _setNotificationsEnabled:[self.permissionStatus boolValue] forBundleIdentifier:self.bundleIdentifier displayName:self.displayName completionHandler:^(NSError *error) { - if(error) - { - NSLog(@"Error: %@", error); - } - - handler(); - }]; -} - -@end diff --git a/detox/ios/DetoxHelper/DetoxHelper/Extension/SetPermissionOperation.h b/detox/ios/DetoxHelper/DetoxHelper/Extension/SetPermissionOperation.h deleted file mode 100644 index 7be31a1769..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/Extension/SetPermissionOperation.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// SetPermissionOperation.h -// DetoxHelper -// -// Created by Leo Natan (Wix) on 29/03/2017. -// Copyright © 2017 Wix. All rights reserved. -// - -#import "ExtensionOperation.h" - -@interface SetPermissionOperation : ExtensionOperation - -@property (nonatomic, copy) NSString* bundleIdentifier; -@property (nonatomic, copy) NSString* displayName; -@property (nonatomic) NSNumber* permissionStatus; - -@end diff --git a/detox/ios/DetoxHelper/DetoxHelper/Extension/SetPermissionOperation.m b/detox/ios/DetoxHelper/DetoxHelper/Extension/SetPermissionOperation.m deleted file mode 100644 index 4113bda292..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/Extension/SetPermissionOperation.m +++ /dev/null @@ -1,13 +0,0 @@ -// -// SetPermissionOperation.m -// DetoxHelper -// -// Created by Leo Natan (Wix) on 29/03/2017. -// Copyright © 2017 Wix. All rights reserved. -// - -#import "SetPermissionOperation.h" - -@implementation SetPermissionOperation - -@end diff --git a/detox/ios/DetoxHelper/DetoxHelper/Extension/SetPhotosPermissionOperation.h b/detox/ios/DetoxHelper/DetoxHelper/Extension/SetPhotosPermissionOperation.h deleted file mode 100644 index 0981ca64c4..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/Extension/SetPhotosPermissionOperation.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// SetPhotosPermissionOperation.h -// DetoxHelper -// -// Created by Leo Natan (Wix) on 29/03/2017. -// Copyright © 2017 Wix. All rights reserved. -// - -#import "SetPermissionOperation.h" - -@interface SetPhotosPermissionOperation : SetPermissionOperation - -@end diff --git a/detox/ios/DetoxHelper/DetoxHelper/Extension/SetPhotosPermissionOperation.m b/detox/ios/DetoxHelper/DetoxHelper/Extension/SetPhotosPermissionOperation.m deleted file mode 100644 index ade3849376..0000000000 --- a/detox/ios/DetoxHelper/DetoxHelper/Extension/SetPhotosPermissionOperation.m +++ /dev/null @@ -1,21 +0,0 @@ -// -// SetPhotosPermissionOperation.m -// DetoxHelper -// -// Created by Leo Natan (Wix) on 29/03/2017. -// Copyright © 2017 Wix. All rights reserved. -// - -#import "SetPhotosPermissionOperation.h" -#import "JPSimulatorHacks.h" - -@implementation SetPhotosPermissionOperation - -- (void)executeAsyncWithCompletionHandler:(void (^)(void))handler -{ - [JPSimulatorHacks setPhotosEnabled:[self.permissionStatus boolValue] forBundleIdentifier:self.bundleIdentifier]; - - handler(); -} - -@end From fbd0303605c051921401bd5bee6be1d0dfd0ce2f Mon Sep 17 00:00:00 2001 From: Asaf Korem Date: Tue, 23 Apr 2024 19:14:54 +0300 Subject: [PATCH 02/13] refactor(ios): remove unused files. --- .../ios/DetoxTester.xcworkspace/contents.xcworkspacedata | 7 ------- .../xcshareddata/IDEWorkspaceChecks.plist | 8 -------- 2 files changed, 15 deletions(-) delete mode 100644 detox/ios/DetoxTester.xcworkspace/contents.xcworkspacedata delete mode 100644 detox/ios/DetoxTester.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/detox/ios/DetoxTester.xcworkspace/contents.xcworkspacedata b/detox/ios/DetoxTester.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index f0148307f3..0000000000 --- a/detox/ios/DetoxTester.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/detox/ios/DetoxTester.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/detox/ios/DetoxTester.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d..0000000000 --- a/detox/ios/DetoxTester.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - From 6c19833a4f16a5d671eed875de3e79643b0ee833 Mon Sep 17 00:00:00 2001 From: Asaf Korem Date: Tue, 23 Apr 2024 19:15:05 +0300 Subject: [PATCH 03/13] refactor(ios): remove unused files (DetoxUserNotificationTests). --- detox/ios/Detox.xcodeproj/project.pbxproj | 60 -------- .../Bridging-Header.h | 9 -- .../DetoxUserNotificationTests.swift | 136 ------------------ .../ios/DetoxUserNotificationTests/Info.plist | 22 --- .../NSBundle+TestsFix.h | 13 -- .../NSBundle+TestsFix.m | 41 ------ .../TestableAppDelegate.swift | 62 -------- .../UIApplication+MockedSharedApplication.h | 17 --- .../UIApplication+MockedSharedApplication.m | 40 ------ .../UNApiAppDelegate.swift | 45 ------ .../user_notification_calendar_trigger.json | 33 ----- .../user_notification_location_trigger.json | 28 ---- .../user_notification_push_trigger.json | 16 --- ...ser_notification_timeInterval_trigger.json | 19 --- 14 files changed, 541 deletions(-) delete mode 100644 detox/ios/DetoxUserNotificationTests/Bridging-Header.h delete mode 100644 detox/ios/DetoxUserNotificationTests/DetoxUserNotificationTests.swift delete mode 100644 detox/ios/DetoxUserNotificationTests/Info.plist delete mode 100644 detox/ios/DetoxUserNotificationTests/NSBundle+TestsFix.h delete mode 100644 detox/ios/DetoxUserNotificationTests/NSBundle+TestsFix.m delete mode 100644 detox/ios/DetoxUserNotificationTests/TestableAppDelegate.swift delete mode 100644 detox/ios/DetoxUserNotificationTests/UIApplication+MockedSharedApplication.h delete mode 100644 detox/ios/DetoxUserNotificationTests/UIApplication+MockedSharedApplication.m delete mode 100644 detox/ios/DetoxUserNotificationTests/UNApiAppDelegate.swift delete mode 100644 detox/ios/DetoxUserNotificationTests/user_notification_calendar_trigger.json delete mode 100644 detox/ios/DetoxUserNotificationTests/user_notification_location_trigger.json delete mode 100644 detox/ios/DetoxUserNotificationTests/user_notification_push_trigger.json delete mode 100644 detox/ios/DetoxUserNotificationTests/user_notification_timeInterval_trigger.json diff --git a/detox/ios/Detox.xcodeproj/project.pbxproj b/detox/ios/Detox.xcodeproj/project.pbxproj index eee5371f0e..10d70c7f1c 100644 --- a/detox/ios/Detox.xcodeproj/project.pbxproj +++ b/detox/ios/Detox.xcodeproj/project.pbxproj @@ -14,14 +14,7 @@ 392324D72477D87D00A3D119 /* DetoxManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 392324D62477D87D00A3D119 /* DetoxManager.swift */; }; 392324DF24781CBD00A3D119 /* WebSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 392324DE24781CBD00A3D119 /* WebSocket.swift */; }; 392324E324782AE500A3D119 /* DetoxInit.m in Sources */ = {isa = PBXBuildFile; fileRef = 392324E124782AE500A3D119 /* DetoxInit.m */; }; - 3928EFA81E47404900C19B6E /* DetoxUserNotificationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3928EFA71E47404900C19B6E /* DetoxUserNotificationTests.swift */; }; 3928EFAA1E47404900C19B6E /* Detox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 394767971DBF985400D72256 /* Detox.framework */; }; - 3928EFB51E47571500C19B6E /* TestableAppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3928EFB41E47571500C19B6E /* TestableAppDelegate.swift */; }; - 3928EFB71E475C1F00C19B6E /* UNApiAppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3928EFB61E475C1F00C19B6E /* UNApiAppDelegate.swift */; }; - 3928EFBC1E475E4C00C19B6E /* user_notification_timeInterval_trigger.json in Resources */ = {isa = PBXBuildFile; fileRef = 3928EFB81E475E4C00C19B6E /* user_notification_timeInterval_trigger.json */; }; - 3928EFBD1E475E4C00C19B6E /* user_notification_location_trigger.json in Resources */ = {isa = PBXBuildFile; fileRef = 3928EFB91E475E4C00C19B6E /* user_notification_location_trigger.json */; }; - 3928EFBE1E475E4C00C19B6E /* user_notification_calendar_trigger.json in Resources */ = {isa = PBXBuildFile; fileRef = 3928EFBA1E475E4C00C19B6E /* user_notification_calendar_trigger.json */; }; - 3928EFBF1E475E4C00C19B6E /* user_notification_push_trigger.json in Resources */ = {isa = PBXBuildFile; fileRef = 3928EFBB1E475E4C00C19B6E /* user_notification_push_trigger.json */; }; 39319D7A1FCA0DA70045BC17 /* COSTouchVisualizer.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 393E66E61FC5F3E90092EE89 /* COSTouchVisualizer.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 393E66ED1FC5F3F40092EE89 /* COSTouchVisualizer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 393E66E61FC5F3E90092EE89 /* COSTouchVisualizer.framework */; }; 3946CD3E2566EB9E000A3606 /* NSObject+DetoxActions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3946CD3C2566EB9E000A3606 /* NSObject+DetoxActions.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -31,7 +24,6 @@ 3946CD492566EBCB000A3606 /* NSObject+DetoxUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 3946CD472566EBCB000A3606 /* NSObject+DetoxUtils.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3946CD4A2566EBCB000A3606 /* NSObject+DetoxUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 3946CD482566EBCB000A3606 /* NSObject+DetoxUtils.m */; }; 3947679C1DBF985400D72256 /* Detox.h in Headers */ = {isa = PBXBuildFile; fileRef = 3947679A1DBF985400D72256 /* Detox.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 394D589C1E50B59400556DB9 /* NSBundle+TestsFix.m in Sources */ = {isa = PBXBuildFile; fileRef = 394D589B1E50B59400556DB9 /* NSBundle+TestsFix.m */; }; 395B06E4256D5A5600941716 /* UIView+DetoxSpeedup.h in Headers */ = {isa = PBXBuildFile; fileRef = 395B06E2256D5A5600941716 /* UIView+DetoxSpeedup.h */; }; 395B06E5256D5A5600941716 /* UIView+DetoxSpeedup.m in Sources */ = {isa = PBXBuildFile; fileRef = 395B06E3256D5A5600941716 /* UIView+DetoxSpeedup.m */; }; 396D454425238B780096E7FA /* DetoxPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = 396D454225238B780096E7FA /* DetoxPolicy.m */; }; @@ -93,7 +85,6 @@ 39CF46212A2E1F50004A0CA3 /* String+matchesJSRegex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39CF46202A2E1F50004A0CA3 /* String+matchesJSRegex.swift */; }; 39D7BF9D24EAE520003E0694 /* LNViewHierarchyDumper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 39D7BF9524EAE510003E0694 /* LNViewHierarchyDumper.framework */; }; 39D7BF9E24EAE520003E0694 /* LNViewHierarchyDumper.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 39D7BF9524EAE510003E0694 /* LNViewHierarchyDumper.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 39DA0E2822D72AEF001E63A0 /* UIApplication+MockedSharedApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = 39DA0E2722D72AEF001E63A0 /* UIApplication+MockedSharedApplication.m */; }; 39DC984724BB8E8900FFB224 /* DTXLogging.h in Headers */ = {isa = PBXBuildFile; fileRef = 39DC984424BB8E8900FFB224 /* DTXLogging.h */; }; 39DC984824BB8E8900FFB224 /* DTXLogging.m in Sources */ = {isa = PBXBuildFile; fileRef = 39DC984524BB8E8900FFB224 /* DTXLogging.m */; }; 39DC984924BB8E8900FFB224 /* DTXLogging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39DC984624BB8E8900FFB224 /* DTXLogging.swift */; }; @@ -230,14 +221,6 @@ 392324DE24781CBD00A3D119 /* WebSocket.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebSocket.swift; sourceTree = ""; }; 392324E124782AE500A3D119 /* DetoxInit.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DetoxInit.m; sourceTree = ""; }; 3928EFA51E47404900C19B6E /* DetoxUserNotificationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DetoxUserNotificationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 3928EFA71E47404900C19B6E /* DetoxUserNotificationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetoxUserNotificationTests.swift; sourceTree = ""; }; - 3928EFA91E47404900C19B6E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 3928EFB41E47571500C19B6E /* TestableAppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestableAppDelegate.swift; sourceTree = ""; }; - 3928EFB61E475C1F00C19B6E /* UNApiAppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UNApiAppDelegate.swift; sourceTree = ""; }; - 3928EFB81E475E4C00C19B6E /* user_notification_timeInterval_trigger.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = user_notification_timeInterval_trigger.json; sourceTree = ""; }; - 3928EFB91E475E4C00C19B6E /* user_notification_location_trigger.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = user_notification_location_trigger.json; sourceTree = ""; }; - 3928EFBA1E475E4C00C19B6E /* user_notification_calendar_trigger.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = user_notification_calendar_trigger.json; sourceTree = ""; }; - 3928EFBB1E475E4C00C19B6E /* user_notification_push_trigger.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = user_notification_push_trigger.json; sourceTree = ""; }; 393E66E11FC5F3E90092EE89 /* COSTouchVisualizer.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = COSTouchVisualizer.xcodeproj; path = COSTouchVisualizer/Classes/COSTouchVisualizer.xcodeproj; sourceTree = ""; }; 3946CD3C2566EB9E000A3606 /* NSObject+DetoxActions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+DetoxActions.h"; sourceTree = ""; }; 3946CD3D2566EB9E000A3606 /* NSObject+DetoxActions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+DetoxActions.m"; sourceTree = ""; }; @@ -248,8 +231,6 @@ 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 = ""; }; - 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 = ""; }; 395B06E2256D5A5600941716 /* UIView+DetoxSpeedup.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIView+DetoxSpeedup.h"; sourceTree = ""; }; 395B06E3256D5A5600941716 /* UIView+DetoxSpeedup.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIView+DetoxSpeedup.m"; sourceTree = ""; }; 396D454225238B780096E7FA /* DetoxPolicy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetoxPolicy.m; sourceTree = ""; }; @@ -313,9 +294,6 @@ 39CEFCDA1E34E91B00A09124 /* DetoxUserNotificationDispatcher.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetoxUserNotificationDispatcher.swift; sourceTree = ""; }; 39CF46202A2E1F50004A0CA3 /* String+matchesJSRegex.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+matchesJSRegex.swift"; sourceTree = ""; }; 39D7BF9024EAE510003E0694 /* LNViewHierarchyDumper.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = LNViewHierarchyDumper.xcodeproj; path = LNViewHierarchyDumper/LNViewHierarchyDumper/LNViewHierarchyDumper.xcodeproj; sourceTree = SOURCE_ROOT; }; - 39DA0E2622D72AEF001E63A0 /* UIApplication+MockedSharedApplication.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIApplication+MockedSharedApplication.h"; sourceTree = ""; }; - 39DA0E2722D72AEF001E63A0 /* UIApplication+MockedSharedApplication.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIApplication+MockedSharedApplication.m"; sourceTree = ""; }; - 39DA0E3522D72C91001E63A0 /* Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = ""; }; 39DC984424BB8E8900FFB224 /* DTXLogging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DTXLogging.h; path = DTXLoggingInfra/DTXLogging.h; sourceTree = SOURCE_ROOT; }; 39DC984524BB8E8900FFB224 /* DTXLogging.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DTXLogging.m; path = DTXLoggingInfra/DTXLogging.m; sourceTree = SOURCE_ROOT; }; 39DC984624BB8E8900FFB224 /* DTXLogging.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DTXLogging.swift; path = DTXLoggingInfra/DTXLogging.swift; sourceTree = SOURCE_ROOT; }; @@ -403,34 +381,6 @@ path = Assertions; sourceTree = ""; }; - 3928EFA61E47404900C19B6E /* DetoxUserNotificationTests */ = { - isa = PBXGroup; - children = ( - 3928EFC01E475E5500C19B6E /* UserNotificationTestInputs */, - 3928EFB41E47571500C19B6E /* TestableAppDelegate.swift */, - 3928EFB61E475C1F00C19B6E /* UNApiAppDelegate.swift */, - 3928EFA71E47404900C19B6E /* DetoxUserNotificationTests.swift */, - 3928EFA91E47404900C19B6E /* Info.plist */, - 39DA0E3522D72C91001E63A0 /* Bridging-Header.h */, - 394D589A1E50B59400556DB9 /* NSBundle+TestsFix.h */, - 394D589B1E50B59400556DB9 /* NSBundle+TestsFix.m */, - 39DA0E2622D72AEF001E63A0 /* UIApplication+MockedSharedApplication.h */, - 39DA0E2722D72AEF001E63A0 /* UIApplication+MockedSharedApplication.m */, - ); - path = DetoxUserNotificationTests; - sourceTree = ""; - }; - 3928EFC01E475E5500C19B6E /* UserNotificationTestInputs */ = { - isa = PBXGroup; - children = ( - 3928EFB81E475E4C00C19B6E /* user_notification_timeInterval_trigger.json */, - 3928EFB91E475E4C00C19B6E /* user_notification_location_trigger.json */, - 3928EFBA1E475E4C00C19B6E /* user_notification_calendar_trigger.json */, - 3928EFBB1E475E4C00C19B6E /* user_notification_push_trigger.json */, - ); - name = UserNotificationTestInputs; - sourceTree = ""; - }; 393E66E21FC5F3E90092EE89 /* Products */ = { isa = PBXGroup; children = ( @@ -452,7 +402,6 @@ children = ( 394767991DBF985400D72256 /* Detox */, 39408DEE1FE6368100C20BD5 /* JS */, - 3928EFA61E47404900C19B6E /* DetoxUserNotificationTests */, 394767D61DBF990F00D72256 /* Frameworks */, 394767981DBF985400D72256 /* Products */, ); @@ -956,10 +905,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 3928EFBC1E475E4C00C19B6E /* user_notification_timeInterval_trigger.json in Resources */, - 3928EFBE1E475E4C00C19B6E /* user_notification_calendar_trigger.json in Resources */, - 3928EFBF1E475E4C00C19B6E /* user_notification_push_trigger.json in Resources */, - 3928EFBD1E475E4C00C19B6E /* user_notification_location_trigger.json in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -977,11 +922,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 394D589C1E50B59400556DB9 /* NSBundle+TestsFix.m in Sources */, - 3928EFA81E47404900C19B6E /* DetoxUserNotificationTests.swift in Sources */, - 3928EFB51E47571500C19B6E /* TestableAppDelegate.swift in Sources */, - 39DA0E2822D72AEF001E63A0 /* UIApplication+MockedSharedApplication.m in Sources */, - 3928EFB71E475C1F00C19B6E /* UNApiAppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/detox/ios/DetoxUserNotificationTests/Bridging-Header.h b/detox/ios/DetoxUserNotificationTests/Bridging-Header.h deleted file mode 100644 index afe1462925..0000000000 --- a/detox/ios/DetoxUserNotificationTests/Bridging-Header.h +++ /dev/null @@ -1,9 +0,0 @@ -// -// Bridging-Header.h -// Detox -// -// Created by Leo Natan (Wix) on 7/11/19. -// Copyright © 2019 Wix. All rights reserved. -// - -#import "UIApplication+MockedSharedApplication.h" diff --git a/detox/ios/DetoxUserNotificationTests/DetoxUserNotificationTests.swift b/detox/ios/DetoxUserNotificationTests/DetoxUserNotificationTests.swift deleted file mode 100644 index aa90763dcc..0000000000 --- a/detox/ios/DetoxUserNotificationTests/DetoxUserNotificationTests.swift +++ /dev/null @@ -1,136 +0,0 @@ -// -// DetoxUserNotificationTests.swift -// DetoxUserNotificationTests -// -// Created by Leo Natan (Wix) on 05/02/2017. -// Copyright © 2017 Wix. All rights reserved. -// - -import XCTest -@testable import Detox - -class DetoxUserNotificationTests: XCTestCase { - lazy var urlForPushUserNotification : URL = { - return Bundle(for: DetoxUserNotificationTests.self).url(forResource: "user_notification_push_trigger", withExtension: "json")! - }() - - lazy var urlForCalendarUserNotification : URL = { - return Bundle(for: DetoxUserNotificationTests.self).url(forResource: "user_notification_calendar_trigger", withExtension: "json")! - }() - - override func setUp() { - super.setUp() - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func sharedLocalUserNotificationAssertions(for appDelegate: TestableAppDelegate, dispatcher: DetoxUserNotificationDispatcher) { - _ = appDelegate.application(UIApplication.shared, willFinishLaunchingWithOptions: [:]) - _ = appDelegate.application(UIApplication.shared, didFinishLaunchingWithOptions: [:]) - dispatcher.dispatch(on: appDelegate, simulateDuringLaunch: true) - } - - func sharedRemoteUserNotificationAssertions(for appDelegate: TestableAppDelegate, dispatcher: DetoxUserNotificationDispatcher, onLaunch: Bool) { - XCTAssertTrue(dispatcher.remoteNotificationDictionary != nil) - _ = appDelegate.application(UIApplication.shared, willFinishLaunchingWithOptions: [.remoteNotification: dispatcher.remoteNotificationDictionary!]) - _ = appDelegate.application(UIApplication.shared, didFinishLaunchingWithOptions: [.remoteNotification: dispatcher.remoteNotificationDictionary!]) - dispatcher.dispatch(on: appDelegate, simulateDuringLaunch: onLaunch) - - if onLaunch { - XCTAssertTrue(appDelegate.remoteNotificationObjectWasFoundInWillLaunch) - XCTAssertTrue(appDelegate.remoteNotificationObjectWasFoundInDidLaunch) - } - } - - func testUNApiSwallowOnActive() { - DTXApplicationMock(nil, "UNApiAppDelegate") - UIApplication.shared.applicationState = .active - let appDelegate = UIApplication.shared.delegate as! UNApiAppDelegate - appDelegate.swallowActiveUserNotification = true - - let dispatcher = DetoxUserNotificationDispatcher(userNotificationDataUrl: urlForPushUserNotification) - - sharedRemoteUserNotificationAssertions(for: appDelegate, dispatcher: dispatcher, onLaunch: false) - - XCTAssertTrue(appDelegate.userNotificationAPIWasCalled) - XCTAssertTrue(appDelegate.userNotificationWillPresentWasCalled) - XCTAssertFalse(appDelegate.userNotificationdidReceiveWasCalled) - XCTAssertEqual(appDelegate.userNotificationTriggerType, .push) - XCTAssertEqual(appDelegate.userNotificationTitle, "From push") - } - - func testUNApiDoesntSwallowOnInactive() { - DTXApplicationMock(nil, "UNApiAppDelegate") - UIApplication.shared.applicationState = .inactive - let appDelegate = UIApplication.shared.delegate as! UNApiAppDelegate - appDelegate.swallowActiveUserNotification = true - - let dispatcher = DetoxUserNotificationDispatcher(userNotificationDataUrl: urlForPushUserNotification) - - sharedRemoteUserNotificationAssertions(for: appDelegate, dispatcher: dispatcher, onLaunch: false) - - XCTAssert(appDelegate.userNotificationAPIWasCalled) - XCTAssertFalse(appDelegate.userNotificationWillPresentWasCalled) - XCTAssert(appDelegate.userNotificationdidReceiveWasCalled) - XCTAssertEqual(appDelegate.userNotificationTriggerType, .push) - XCTAssertEqual(appDelegate.userNotificationTitle, "From push") - } - - func testUNApiDoesntSwallowOnBackground() { - DTXApplicationMock(nil, "UNApiAppDelegate") - UIApplication.shared.applicationState = .background - let appDelegate = UIApplication.shared.delegate as! UNApiAppDelegate - appDelegate.swallowActiveUserNotification = true - - let dispatcher = DetoxUserNotificationDispatcher(userNotificationDataUrl: urlForPushUserNotification) - - sharedRemoteUserNotificationAssertions(for: appDelegate, dispatcher: dispatcher, onLaunch: false) - - XCTAssert(appDelegate.userNotificationAPIWasCalled) - XCTAssertFalse(appDelegate.userNotificationWillPresentWasCalled) - XCTAssert(appDelegate.userNotificationdidReceiveWasCalled) - XCTAssertEqual(appDelegate.userNotificationTriggerType, .push) - XCTAssertEqual(appDelegate.userNotificationTitle, "From push") - } - - func testUNApiWithPushOnLaunch() { - DTXApplicationMock(nil, "UNApiAppDelegate") - let appDelegate = UIApplication.shared.delegate as! UNApiAppDelegate - let dispatcher = DetoxUserNotificationDispatcher(userNotificationDataUrl: urlForPushUserNotification) - - sharedRemoteUserNotificationAssertions(for: appDelegate, dispatcher: dispatcher, onLaunch: true) - - XCTAssertTrue(appDelegate.userNotificationAPIWasCalled) - XCTAssertFalse(appDelegate.userNotificationWillPresentWasCalled) - XCTAssertTrue(appDelegate.userNotificationdidReceiveWasCalled) - XCTAssertEqual(appDelegate.userNotificationTriggerType, .push) - XCTAssertEqual(appDelegate.userNotificationTitle, "From push") - } - - func testUNApiWithCalendarOnLaunch() { - DTXApplicationMock(nil, "UNApiAppDelegate") - let appDelegate = UIApplication.shared.delegate as! UNApiAppDelegate - let dispatcher = DetoxUserNotificationDispatcher(userNotificationDataUrl: urlForCalendarUserNotification) - - sharedLocalUserNotificationAssertions(for: appDelegate, dispatcher: dispatcher) - - XCTAssert(appDelegate.userNotificationAPIWasCalled) - XCTAssertEqual(appDelegate.userNotificationTriggerType, .calendar) - XCTAssertEqual(appDelegate.userNotificationTitle, "From calendar") - } - - func testLegacyApiWithLocalOnLaunch() { - DTXApplicationMock(nil, "UNApiAppDelegate") - let appDelegate = UIApplication.shared.delegate as! TestableAppDelegate - let dispatcher = DetoxUserNotificationDispatcher(userNotificationDataUrl: urlForCalendarUserNotification) - - sharedLocalUserNotificationAssertions(for: appDelegate, dispatcher: dispatcher) - - XCTAssertTrue(appDelegate.userNotificationAPIWasCalled) - XCTAssertEqual(appDelegate.userNotificationTriggerType, .calendar) - XCTAssertEqual(appDelegate.userNotificationTitle, "From calendar") - } -} diff --git a/detox/ios/DetoxUserNotificationTests/Info.plist b/detox/ios/DetoxUserNotificationTests/Info.plist deleted file mode 100644 index 6c6c23c43a..0000000000 --- a/detox/ios/DetoxUserNotificationTests/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/detox/ios/DetoxUserNotificationTests/NSBundle+TestsFix.h b/detox/ios/DetoxUserNotificationTests/NSBundle+TestsFix.h deleted file mode 100644 index f24f5a9410..0000000000 --- a/detox/ios/DetoxUserNotificationTests/NSBundle+TestsFix.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// NSBundle+TestsFix.h -// Detox -// -// Created by Leo Natan (Wix) on 12/02/2017. -// Copyright © 2017 Wix. All rights reserved. -// - -#import - -@interface NSBundle (TestsFix) - -@end diff --git a/detox/ios/DetoxUserNotificationTests/NSBundle+TestsFix.m b/detox/ios/DetoxUserNotificationTests/NSBundle+TestsFix.m deleted file mode 100644 index f81d8faf80..0000000000 --- a/detox/ios/DetoxUserNotificationTests/NSBundle+TestsFix.m +++ /dev/null @@ -1,41 +0,0 @@ -// -// NSBundle+TestsFix.m -// Detox -// -// Created by Leo Natan (Wix) on 12/02/2017. -// Copyright © 2017 Wix. All rights reserved. -// - -#import "NSBundle+TestsFix.h" -@import MobileCoreServices; - -@interface _LSQueryResult : NSObject @end - -@interface LSResourceProxy : _LSQueryResult @end - -@interface LSBundleProxy : LSResourceProxy - -+ (instancetype)bundleProxyForIdentifier:(NSString*)arg1; - -@end - -@interface LSBundleProxy (TestsFix) @end - -@implementation LSBundleProxy (TestsFix) - -+ (instancetype)bundleProxyForCurrentProcess -{ - return [self bundleProxyForIdentifier:@"com.apple.mobilesafari"]; -} - -@end - -@implementation NSBundle (TestsFix) - -+ (instancetype)un_applicationBundle -{ - return [NSBundle bundleForClass:NSClassFromString(@"DTXUserNotificationDispatcher")]; -} - -@end - diff --git a/detox/ios/DetoxUserNotificationTests/TestableAppDelegate.swift b/detox/ios/DetoxUserNotificationTests/TestableAppDelegate.swift deleted file mode 100644 index e99229ea97..0000000000 --- a/detox/ios/DetoxUserNotificationTests/TestableAppDelegate.swift +++ /dev/null @@ -1,62 +0,0 @@ -// -// TestableAppDelegate.swift -// Detox -// -// Created by Leo Natan (Wix) on 05/02/2017. -// Copyright © 2017 Wix. All rights reserved. -// - -import UIKit -import UserNotifications - -enum TestableAppDelegateNotifcationTriggerType { - case unknown - case push - case calendar - case location - case timeInterval -} - -@objc(TestableAppDelegate) -class TestableAppDelegate: NSObject, UIApplicationDelegate { - var remoteNotificationObjectWasFoundInWillLaunch = false - var remoteNotificationObjectWasFoundInDidLaunch = false - - var userNotificationAPIWasCalled = false - - var userNotificationTriggerType = TestableAppDelegateNotifcationTriggerType.unknown - var userNotificationTitle : String? - - func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { - remoteNotificationObjectWasFoundInWillLaunch = launchOptions?[.remoteNotification] != nil - return true - } - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { - remoteNotificationObjectWasFoundInDidLaunch = launchOptions?[.remoteNotification] != nil - - if remoteNotificationObjectWasFoundInDidLaunch { - userNotificationTriggerType = .push - userNotificationTitle = ((launchOptions?[.remoteNotification] as! NSDictionary).value(forKeyPath: "aps.alert.title") as! String) - } - - return true - } -} - -extension TestableAppDelegate { - class func triggerType(from notification: UNNotification) -> TestableAppDelegateNotifcationTriggerType { - switch notification.request.trigger { - case is UNPushNotificationTrigger: - return .push - case is UNTimeIntervalNotificationTrigger: - return .timeInterval - case is UNCalendarNotificationTrigger: - return .calendar - case is UNLocationNotificationTrigger: - return .location - default: - return .unknown - } - } -} diff --git a/detox/ios/DetoxUserNotificationTests/UIApplication+MockedSharedApplication.h b/detox/ios/DetoxUserNotificationTests/UIApplication+MockedSharedApplication.h deleted file mode 100644 index 35aa630190..0000000000 --- a/detox/ios/DetoxUserNotificationTests/UIApplication+MockedSharedApplication.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// UIApplication+MockedSharedApplication.h -// DetoxUserNotificationTests -// -// Created by Leo Natan (Wix) on 7/11/19. -// Copyright © 2019 Wix. All rights reserved. -// - -#import - -extern void DTXApplicationMock(NSString * _Nullable principalClassName, NSString * _Nullable delegateClassName); - -@interface UIApplication (MockedSharedApplication) - -@property(nonatomic,readwrite) UIApplicationState applicationState; - -@end diff --git a/detox/ios/DetoxUserNotificationTests/UIApplication+MockedSharedApplication.m b/detox/ios/DetoxUserNotificationTests/UIApplication+MockedSharedApplication.m deleted file mode 100644 index f4dbc2132f..0000000000 --- a/detox/ios/DetoxUserNotificationTests/UIApplication+MockedSharedApplication.m +++ /dev/null @@ -1,40 +0,0 @@ -// -// UIApplication+MockedSharedApplication.m -// DetoxUserNotificationTests -// -// Created by Leo Natan (Wix) on 7/11/19. -// Copyright © 2019 Wix. All rights reserved. -// - -#import "UIApplication+MockedSharedApplication.h" - -static UIApplication* __mockApp; -static id __mockAppDelegate; - -static UIApplicationState __applicationStateOverride; - -@implementation UIApplication (MockedSharedApplication) - -- (void)setApplicationState:(UIApplicationState)applicationState -{ - __applicationStateOverride = applicationState; -} - -void DTXApplicationMock(NSString * _Nullable principalClassName, NSString * _Nullable delegateClassName) -{ - __mockApp = [NSClassFromString(principalClassName ?: @"UIApplication") alloc]; - __mockAppDelegate = [NSClassFromString(delegateClassName) new]; - __mockApp.delegate = __mockAppDelegate; -} - -- (UIApplicationState)applicationState -{ - return __applicationStateOverride; -} - -+ (UIApplication *)sharedApplication -{ - return __mockApp; -} - -@end diff --git a/detox/ios/DetoxUserNotificationTests/UNApiAppDelegate.swift b/detox/ios/DetoxUserNotificationTests/UNApiAppDelegate.swift deleted file mode 100644 index a3ebd62552..0000000000 --- a/detox/ios/DetoxUserNotificationTests/UNApiAppDelegate.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// UNApiAppDelegate.swift -// Detox -// -// Created by Leo Natan (Wix) on 05/02/2017. -// Copyright © 2017 Wix. All rights reserved. -// - -import UIKit -import UserNotifications - -@objc(UNApiAppDelegate) -class UNApiAppDelegate: TestableAppDelegate, UNUserNotificationCenterDelegate { - var userNotificationWillPresentWasCalled = false - var userNotificationdidReceiveWasCalled = false - var swallowActiveUserNotification = false - - override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]?) -> Bool { - UNUserNotificationCenter.current().delegate = self - - return super.application(application, didFinishLaunchingWithOptions: launchOptions) - } - - private func markUNApiCalled(notification: UNNotification) { - userNotificationAPIWasCalled = true - userNotificationTriggerType = TestableAppDelegate.triggerType(from: notification) - userNotificationTitle = notification.request.content.title - } - - func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { - userNotificationWillPresentWasCalled = true - markUNApiCalled(notification: notification) - - if swallowActiveUserNotification { - completionHandler([]) - } else { - completionHandler([.alert, .badge, .sound]) - } - } - - func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Swift.Void) { - userNotificationdidReceiveWasCalled = true - markUNApiCalled(notification: response.notification) - } -} diff --git a/detox/ios/DetoxUserNotificationTests/user_notification_calendar_trigger.json b/detox/ios/DetoxUserNotificationTests/user_notification_calendar_trigger.json deleted file mode 100644 index 3fbe289265..0000000000 --- a/detox/ios/DetoxUserNotificationTests/user_notification_calendar_trigger.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "trigger": { - "type": "calendar", - "date-components": { - "era": 1, - "year": 2017, - "month": 1, - "day": 1, - "hour": 0, - "minute": 0, - "second": 0, - "weekday": 0, - "weekdayOrdinal": 0, - "quarter": 1, - "weekOfMonth": 1, - "weekOfYear": 1, - "leapMonth": false - }, - "repeats": true - }, - "title": "From calendar", - "subtitle": "Subtitle", - "body": "Body", - "badge": 1, - "payload": { - "key1": "value1", - "key2": "value2" - }, - "category": "com.example.category", - "user-text": "Hi there!", - "content-available": 0, - "action-identifier": "default" -} diff --git a/detox/ios/DetoxUserNotificationTests/user_notification_location_trigger.json b/detox/ios/DetoxUserNotificationTests/user_notification_location_trigger.json deleted file mode 100644 index 15d99948e4..0000000000 --- a/detox/ios/DetoxUserNotificationTests/user_notification_location_trigger.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "trigger": { - "type": "location", - "region": { - "identifier": "my-id", - "center": { - "latitude": 123.31, - "longitude": 21.31 - }, - "radius": 15.5, - "notifyOnEntry": true, - "notifyOnExit": false - }, - "repeats": true - }, - "title": "Title", - "subtitle": "Subtitle", - "body": "Body", - "badge": 1, - "payload": { - "key1": "value1", - "key2": "value2" - }, - "category": "com.example.category", - "user-text": "Hi there!", - "content-available": 0, - "action-identifier": "default2" -} \ No newline at end of file diff --git a/detox/ios/DetoxUserNotificationTests/user_notification_push_trigger.json b/detox/ios/DetoxUserNotificationTests/user_notification_push_trigger.json deleted file mode 100644 index 48e294dbc0..0000000000 --- a/detox/ios/DetoxUserNotificationTests/user_notification_push_trigger.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "trigger": { - "type": "push" - }, - "title": "From push", - "subtitle": "Subtitle", - "body": "Body", - "badge": 1, - "payload": { - "key1": "value1", - "key2": "value2" - }, - "category": "com.example.category", - "content-available": 0, - "action-identifier": "default" -} diff --git a/detox/ios/DetoxUserNotificationTests/user_notification_timeInterval_trigger.json b/detox/ios/DetoxUserNotificationTests/user_notification_timeInterval_trigger.json deleted file mode 100644 index 2a48f05b23..0000000000 --- a/detox/ios/DetoxUserNotificationTests/user_notification_timeInterval_trigger.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "trigger": { - "type": "timeInterval", - "timeInterval": 30, - "repeats": false - }, - "title": "Title", - "subtitle": "Subtitle", - "body": "Body", - "badge": 1, - "payload": { - "key1": "value1", - "key2": "value2" - }, - "category": "com.example.category", - "user-text": "Hi there!", - "content-available": 0, - "action-identifier": "default2" -} \ No newline at end of file From 200cb995e3c594c19cb398903ac7f6bff42ce0f0 Mon Sep 17 00:00:00 2001 From: igorgn <50628426+igorgn@users.noreply.github.com> Date: Wed, 1 May 2024 15:00:04 +0300 Subject: [PATCH 04/13] chore(ci): migrate to M2 agents (#4452) Co-authored-by: Asaf Korem <55082339+asafkorem@users.noreply.github.com> --- .buildkite/jobs/pipeline.android_demo_app_rn_73.yml | 7 ++++--- .buildkite/jobs/pipeline.android_rn_71.yml | 8 +++++--- .buildkite/jobs/pipeline.android_rn_73.yml | 9 +++++---- .buildkite/jobs/pipeline.ios_demo_app_rn_71.yml | 6 ++++-- .buildkite/jobs/pipeline.ios_demo_app_rn_73.yml | 6 ++++-- .buildkite/jobs/pipeline.ios_rn_71.yml | 8 +++++--- .buildkite/jobs/pipeline.ios_rn_73.yml | 6 +++--- .buildkite/pipeline.release.fast.yml | 8 ++++---- .buildkite/pipeline_common.sh | 4 ++++ .xcoderc | 2 +- detox/test/e2e/33.attributes.test.js | 2 +- detox/test/e2e/detox.config.js | 2 +- examples/demo-native-ios/package.json | 3 ++- examples/demo-react-native/detox.config.js | 2 +- 14 files changed, 44 insertions(+), 29 deletions(-) diff --git a/.buildkite/jobs/pipeline.android_demo_app_rn_73.yml b/.buildkite/jobs/pipeline.android_demo_app_rn_73.yml index 9d3f2a1145..7a07d6837b 100644 --- a/.buildkite/jobs/pipeline.android_demo_app_rn_73.yml +++ b/.buildkite/jobs/pipeline.android_demo_app_rn_73.yml @@ -7,7 +7,8 @@ REACT_NATIVE_COMPAT_TEST: true # Only set 'true' in jobs with the latest supported RN DETOX_DISABLE_POD_INSTALL: true DETOX_DISABLE_POSTINSTALL: true - JAVA_HOME: /opt/openjdk/jdk-17.0.9.jdk/Contents/Home/ artifact_paths: - - "/Users/builder/work/coverage/**/*.lcov" - - "/Users/builder/work/artifacts*.tar.gz" + - "/Users/builder/uibuilder/work/coverage/**/*.lcov" + - "/Users/builder/uibuilder/work/artifacts*.tar.gz" + agents: + queue: m2-oss diff --git a/.buildkite/jobs/pipeline.android_rn_71.yml b/.buildkite/jobs/pipeline.android_rn_71.yml index 86b06155b1..a7d35956d8 100644 --- a/.buildkite/jobs/pipeline.android_rn_71.yml +++ b/.buildkite/jobs/pipeline.android_rn_71.yml @@ -8,6 +8,8 @@ DETOX_DISABLE_POSTINSTALL: true SKIP_UNIT_TESTS: true artifact_paths: - - "/Users/builder/work/coverage/**/*.lcov" - - "/Users/builder/work/**/allure-report-*.html" - - "/Users/builder/work/artifacts*.tar.gz" + - "/Users/builder/uibuilder/work/coverage/**/*.lcov" + - "/Users/builder/uibuilder/work/**/allure-report-*.html" + - "/Users/builder/uibuilder/work/artifacts*.tar.gz" + agents: + queue: m2-oss diff --git a/.buildkite/jobs/pipeline.android_rn_73.yml b/.buildkite/jobs/pipeline.android_rn_73.yml index a272b358d2..9006f47009 100644 --- a/.buildkite/jobs/pipeline.android_rn_73.yml +++ b/.buildkite/jobs/pipeline.android_rn_73.yml @@ -6,8 +6,9 @@ REACT_NATIVE_VERSION: 0.73.2 DETOX_DISABLE_POD_INSTALL: true DETOX_DISABLE_POSTINSTALL: true - JAVA_HOME: /opt/openjdk/jdk-17.0.9.jdk/Contents/Home/ artifact_paths: - - "/Users/builder/work/coverage/**/*.lcov" - - "/Users/builder/work/**/allure-report-*.html" - - "/Users/builder/work/artifacts*.tar.gz" + - "/Users/builder/uibuilder/work/coverage/**/*.lcov" + - "/Users/builder/uibuilder/work/**/allure-report-*.html" + - "/Users/builder/uibuilder/work/artifacts*.tar.gz" + agents: + queue: m2-oss diff --git a/.buildkite/jobs/pipeline.ios_demo_app_rn_71.yml b/.buildkite/jobs/pipeline.ios_demo_app_rn_71.yml index 83f272b4ae..0c4c8bf77a 100644 --- a/.buildkite/jobs/pipeline.ios_demo_app_rn_71.yml +++ b/.buildkite/jobs/pipeline.ios_demo_app_rn_71.yml @@ -5,5 +5,7 @@ env: REACT_NATIVE_VERSION: 0.71.10 artifact_paths: - - "/Users/builder/work/coverage/**/*.lcov" - - "/Users/builder/work/artifacts*.tar.gz" + - "/Users/builder/uibuilder/work/coverage/**/*.lcov" + - "/Users/builder/uibuilder/work/artifacts*.tar.gz" + agents: + queue: m2-oss diff --git a/.buildkite/jobs/pipeline.ios_demo_app_rn_73.yml b/.buildkite/jobs/pipeline.ios_demo_app_rn_73.yml index 956d7bb7e0..4e49cd63b7 100644 --- a/.buildkite/jobs/pipeline.ios_demo_app_rn_73.yml +++ b/.buildkite/jobs/pipeline.ios_demo_app_rn_73.yml @@ -5,5 +5,7 @@ env: REACT_NATIVE_VERSION: 0.73.2 artifact_paths: - - "/Users/builder/work/coverage/**/*.lcov" - - "/Users/builder/work/artifacts*.tar.gz" + - "/Users/builder/uibuilder/work/coverage/**/*.lcov" + - "/Users/builder/uibuilder/work/artifacts*.tar.gz" + agents: + queue: m2-oss diff --git a/.buildkite/jobs/pipeline.ios_rn_71.yml b/.buildkite/jobs/pipeline.ios_rn_71.yml index 854ef4ce20..254964c47a 100644 --- a/.buildkite/jobs/pipeline.ios_rn_71.yml +++ b/.buildkite/jobs/pipeline.ios_rn_71.yml @@ -5,6 +5,8 @@ env: REACT_NATIVE_VERSION: 0.71.10 artifact_paths: - - "/Users/builder/work/coverage/**/*.lcov" - - "/Users/builder/work/**/allure-report-*.html" - - "/Users/builder/work/artifacts*.tar.gz" + - "/Users/builder/uibuilder/work/coverage/**/*.lcov" + - "/Users/builder/uibuilder/work/**/allure-report-*.html" + - "/Users/builder/uibuilder/work/artifacts*.tar.gz" + agents: + queue: m2-oss diff --git a/.buildkite/jobs/pipeline.ios_rn_73.yml b/.buildkite/jobs/pipeline.ios_rn_73.yml index 661a72ea6c..6d462a9e30 100644 --- a/.buildkite/jobs/pipeline.ios_rn_73.yml +++ b/.buildkite/jobs/pipeline.ios_rn_73.yml @@ -5,6 +5,6 @@ env: REACT_NATIVE_VERSION: 0.73.2 artifact_paths: - - "/Users/builder/work/coverage/**/*.lcov" - - "/Users/builder/work/**/allure-report-*.html" - - "/Users/builder/work/artifacts*.tar.gz" + - "/Users/builder/uibuilder/work/coverage/**/*.lcov" + - "/Users/builder/uibuilder/work/**/allure-report-*.html" + - "/Users/builder/uibuilder/work/artifacts*.tar.gz" diff --git a/.buildkite/pipeline.release.fast.yml b/.buildkite/pipeline.release.fast.yml index dec7e19ecb..159f48a24b 100644 --- a/.buildkite/pipeline.release.fast.yml +++ b/.buildkite/pipeline.release.fast.yml @@ -4,7 +4,7 @@ command: - "nvm install" - "npm run package:ios" - artifact_paths: "/Users/builder/work/detox/*.tbz" + artifact_paths: "/Users/builder/uibuilder/work/detox/*.tbz" - label: ":android: Package android" key: 'android_package' @@ -15,8 +15,8 @@ env: DETOX_DISABLE_POSTINSTALL: true DETOX_DISABLE_POD_INSTALL: true - JAVA_HOME: /opt/openjdk/jdk-17.0.9.jdk/Contents/Home/ - artifact_paths: "/Users/builder/work/detox/Detox-android/**/*" + JAVA_HOME: /opt/openjdk/openlogic-openjdk-17.0.9+9-mac-x64/jdk-17.0.9.jdk/Contents/Home + artifact_paths: "/Users/builder/uibuilder/work/detox/Detox-android/**/*" - label: ":android: Package android Legacy" key: 'android_package_legacy' @@ -28,7 +28,7 @@ REACT_NATIVE_VERSION: 0.71.10 DETOX_DISABLE_POSTINSTALL: true DETOX_DISABLE_POD_INSTALL: true - artifact_paths: "/Users/builder/work/detox/Detox-android/**/*" + artifact_paths: "/Users/builder/uibuilder/work/detox/Detox-android/**/*" - label: ":shipit: Publish" depends_on: diff --git a/.buildkite/pipeline_common.sh b/.buildkite/pipeline_common.sh index f2fc0e9e79..d0dc816e93 100755 --- a/.buildkite/pipeline_common.sh +++ b/.buildkite/pipeline_common.sh @@ -1,5 +1,9 @@ #!/bin/bash -e +echo "agents: + queue: m2-oss" +echo "env: + JAVA_HOME: /opt/openjdk/openlogic-openjdk-17.0.9+9-mac-x64/jdk-17.0.9.jdk/Contents/Home" echo "steps:" cat .buildkite/jobs/pipeline.ios_rn_73.yml diff --git a/.xcoderc b/.xcoderc index ccc2f3b87f..9dc738e691 100644 --- a/.xcoderc +++ b/.xcoderc @@ -1 +1 @@ -15.1 \ No newline at end of file +15.0.1 \ No newline at end of file diff --git a/detox/test/e2e/33.attributes.test.js b/detox/test/e2e/33.attributes.test.js index 2ddaf6b6e5..515861feb4 100644 --- a/detox/test/e2e/33.attributes.test.js +++ b/detox/test/e2e/33.attributes.test.js @@ -186,7 +186,7 @@ describe('Attributes', () => { it(':ios: should have Date .value', () => { expect(attributes).toMatchObject({ - date: expect.stringMatching(/^2022-01-01T00:00:00[+\-]\d{2}:\d{2}$/), + date: expect.stringMatching(/^2022-01-01T00:00:00([+-]\d{2}:\d{2}|Z)$/), }); }); }); diff --git a/detox/test/e2e/detox.config.js b/detox/test/e2e/detox.config.js index e8762e625d..025fd65468 100644 --- a/detox/test/e2e/detox.config.js +++ b/detox/test/e2e/detox.config.js @@ -100,7 +100,7 @@ const config = { headless: Boolean(process.env.CI), device: { type: 'iPhone 15 Pro Max', - os: "17.2", + os: '17.0.1' }, }, diff --git a/examples/demo-native-ios/package.json b/examples/demo-native-ios/package.json index 8f1b321593..778370665a 100644 --- a/examples/demo-native-ios/package.json +++ b/examples/demo-native-ios/package.json @@ -23,7 +23,8 @@ "simulator": { "type": "ios.simulator", "device": { - "type": "iPhone 15 Pro Max" + "type": "iPhone 15 Pro Max", + "os": "17.0.1" } } }, diff --git a/examples/demo-react-native/detox.config.js b/examples/demo-react-native/detox.config.js index 2103e8bfcb..2535ae53db 100644 --- a/examples/demo-react-native/detox.config.js +++ b/examples/demo-react-native/detox.config.js @@ -46,7 +46,7 @@ module.exports = { headless: Boolean(process.env.CI), device: { type: "iPhone 15 Pro Max", - os: "17.2", + os: "17.0.1" } }, emulator: { From faa878ae472ce46ee1eebfdeacb8118c33a720fc Mon Sep 17 00:00:00 2001 From: Yaroslav Serhieiev Date: Sat, 4 May 2024 20:46:04 +0300 Subject: [PATCH 05/13] chore: update allure integration (#4479) --- detox/jest.config.js | 2 +- detox/package.json | 2 +- detox/test/e2e/19.crash-handling.test.js | 8 ++++---- detox/test/e2e/detox.config.js | 7 +++---- detox/test/e2e/jest.config.js | 17 ++++++++++------- detox/test/package.json | 4 +--- generation/package.json | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/detox/jest.config.js b/detox/jest.config.js index 6ca2c4a514..a1fac63a8a 100644 --- a/detox/jest.config.js +++ b/detox/jest.config.js @@ -4,7 +4,7 @@ const DEBUG = process.argv.includes('--reporters'); const jestAllure2ReporterOptions = { testCase: { labels: { - package: ({ filePath }) => filePath.slice(1).join('/'), + package: ({ filePath }) => `unit.${filePath.slice(1, -1).join('.')}`, testMethod: ({ testCase }) => testCase.fullName, tag: ['unit'], }, diff --git a/detox/package.json b/detox/package.json index 9dfd93323e..e9e4248431 100644 --- a/detox/package.json +++ b/detox/package.json @@ -56,7 +56,7 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-unicorn": "^50.0.1", "jest": "^29.6.3", - "jest-allure2-reporter": "^2.0.0-beta.9", + "jest-allure2-reporter": "^2.0.0-beta.15", "metro-react-native-babel-preset": "0.76.8", "prettier": "^3.1.1", "react-native": "0.73.2", diff --git a/detox/test/e2e/19.crash-handling.test.js b/detox/test/e2e/19.crash-handling.test.js index 7eb0bba2b8..aff94b9d27 100644 --- a/detox/test/e2e/19.crash-handling.test.js +++ b/detox/test/e2e/19.crash-handling.test.js @@ -29,11 +29,11 @@ describe('Crash Handling', () => { await expect(element(by.text('Sanity'))).toBeVisible(); }); + /** + * @issue https://github.com/wix/Detox/issues/4377 + * @tag flaky + */ it('Should print generic connectivity error when the app was terminated intentionally', async () => { - /** - * @issue https://github.com/wix/Detox/issues/4377 - * @tag flaky - */ await device.terminateApp(); await new Promise((resolve) => setTimeout(resolve, 2000)); // see the issue for details await expectToThrow(() => element(by.text('Crash')).tap(), 'Detox can\'t seem to connect to the test app(s)!'); diff --git a/detox/test/e2e/detox.config.js b/detox/test/e2e/detox.config.js index 025fd65468..ffc31b48e7 100644 --- a/detox/test/e2e/detox.config.js +++ b/detox/test/e2e/detox.config.js @@ -8,6 +8,7 @@ const launchArgs = { /** @type {Detox.DetoxConfig} */ const config = { + extends: 'detox-allure2-adapter/preset-detox', testRunner: { args: { $0: process.env.CI ? 'nyc jest' : 'jest', @@ -42,11 +43,9 @@ const config = { plugins: { log: 'all', screenshot: { - shouldTakeAutomaticSnapshots: true, - takeWhen: {} + keepOnlyFailedTestsArtifacts: false, }, - uiHierarchy: 'enabled' - } + }, }, apps: { diff --git a/detox/test/e2e/jest.config.js b/detox/test/e2e/jest.config.js index 7f4cb68a9a..c167e05595 100644 --- a/detox/test/e2e/jest.config.js +++ b/detox/test/e2e/jest.config.js @@ -14,21 +14,24 @@ module.exports = async () => { /** @type {import('jest-allure2-reporter').ReporterOptions} */ const jestAllure2ReporterOptions = { + extends: require.resolve('detox-allure2-adapter/preset-allure'), overwrite: !process.env.CI, - attachments: { - fileHandler: 'copy', - }, testCase: { labels: { - package: ({ filePath }) => filePath.slice(1).join('/'), + package: ({ filePath }) => `${filePath.slice(1, -1).join('.')}.${_.kebabCase(filePath.at(-1))}`, testMethod: ({ testCase }) => testCase.fullName, tag: ['e2e', ...config.configurationName.split('.')], }, + links: { + issue: 'https://github.com/wix/Detox/issues/{{name}}', + }, }, - environment: () => ({ + environment: async ({ $ }) => ({ 'version.node': process.version, - 'version.jest': require('jest/package.json').version, - 'version.allure-reporter': require('jest-allure2-reporter/package.json').version, + 'version.jest': await $.manifest('jest', 'version'), + 'version.jest-metadata': await $.manifest('jest-metadata', 'version'), + 'version.allure-reporter': await $.manifest('jest-allure2-reporter', 'version'), + 'version.allure-adapter': await $.manifest('detox-allure2-adapter', 'version'), ..._(process.env) .pickBy((_1, key) => key.match(/detox/i)) .mapKeys((_1, key) => 'env.' + key) diff --git a/detox/test/package.json b/detox/test/package.json index 29113ee418..6f7c6d7d52 100644 --- a/detox/test/package.json +++ b/detox/test/package.json @@ -61,16 +61,14 @@ "@typescript-eslint/parser": "^6.16.0", "cross-env": "^7.0.3", "detox": "^20.20.3", - "detox-allure2-adapter": "^1.0.0-alpha.3", + "detox-allure2-adapter": "^1.0.0-alpha.7", "eslint": "^8.56.0", "eslint-plugin-unicorn": "^50.0.1", "execa": "^5.1.1", "express": "^4.15.3", "glob": "^7.2.0", "jest": "^29.6.3", - "jest-allure2-reporter": "^2.0.0-beta.9", "jest-junit": "^10.0.0", - "jest-metadata": "^1.3.1", "lodash": "^4.14.1", "metro-react-native-babel-preset": "0.76.8", "nyc": "^15.1.0", diff --git a/generation/package.json b/generation/package.json index ebea32743d..8af60b6736 100644 --- a/generation/package.json +++ b/generation/package.json @@ -30,7 +30,7 @@ }, "devDependencies": { "jest": "^27.0.0", - "jest-allure2-reporter": "^2.0.0-beta.9", + "jest-allure2-reporter": "^2.0.0-beta.15", "lint-staged": "^6.0.0", "prettier": "^1.8.2" }, From ea47057ff05e6c6afe4e0c6f4a916c07cf975f26 Mon Sep 17 00:00:00 2001 From: Yaroslav Serhieiev Date: Sun, 5 May 2024 11:51:51 +0300 Subject: [PATCH 06/13] chore: remove failing adapter check --- detox/test/e2e/jest.config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/detox/test/e2e/jest.config.js b/detox/test/e2e/jest.config.js index c167e05595..b539fb0782 100644 --- a/detox/test/e2e/jest.config.js +++ b/detox/test/e2e/jest.config.js @@ -31,7 +31,6 @@ module.exports = async () => { 'version.jest': await $.manifest('jest', 'version'), 'version.jest-metadata': await $.manifest('jest-metadata', 'version'), 'version.allure-reporter': await $.manifest('jest-allure2-reporter', 'version'), - 'version.allure-adapter': await $.manifest('detox-allure2-adapter', 'version'), ..._(process.env) .pickBy((_1, key) => key.match(/detox/i)) .mapKeys((_1, key) => 'env.' + key) From 047c95a6b1b079c60a9690d5834fd4977ca3bfde Mon Sep 17 00:00:00 2001 From: Asaf Korem <55082339+asafkorem@users.noreply.github.com> Date: Sun, 5 May 2024 17:59:39 +0300 Subject: [PATCH 07/13] chore(ci): fix buildkite pipelines configurations. (#4478) * chore(ci): add missing queue param to buildkite job. * refactor(ci): remove redundant (duplicated) config from buildkite yamls. agents config already exists on pipeline.common. * chore(ci): configure agents queue for all pipelines (fix). It was missing for release and debug pipelines. * chore(ci): fix debug pipeline options (steps). * Update .buildkite/pipeline.debug.yml * Update .buildkite/pipeline.sh --------- Co-authored-by: igorgn <50628426+igorgn@users.noreply.github.com> --- .../jobs/pipeline.android_demo_app_rn_73.yml | 2 -- .buildkite/jobs/pipeline.android_rn_71.yml | 2 -- .buildkite/jobs/pipeline.android_rn_73.yml | 2 -- .../jobs/pipeline.ios_demo_app_rn_71.yml | 2 -- .../jobs/pipeline.ios_demo_app_rn_73.yml | 2 -- .buildkite/jobs/pipeline.ios_rn_71.yml | 2 -- .buildkite/pipeline.debug.yml | 18 +++++++++--------- .buildkite/pipeline_common.sh | 4 ---- 8 files changed, 9 insertions(+), 25 deletions(-) diff --git a/.buildkite/jobs/pipeline.android_demo_app_rn_73.yml b/.buildkite/jobs/pipeline.android_demo_app_rn_73.yml index 7a07d6837b..9408d7bf97 100644 --- a/.buildkite/jobs/pipeline.android_demo_app_rn_73.yml +++ b/.buildkite/jobs/pipeline.android_demo_app_rn_73.yml @@ -10,5 +10,3 @@ artifact_paths: - "/Users/builder/uibuilder/work/coverage/**/*.lcov" - "/Users/builder/uibuilder/work/artifacts*.tar.gz" - agents: - queue: m2-oss diff --git a/.buildkite/jobs/pipeline.android_rn_71.yml b/.buildkite/jobs/pipeline.android_rn_71.yml index a7d35956d8..9f36466864 100644 --- a/.buildkite/jobs/pipeline.android_rn_71.yml +++ b/.buildkite/jobs/pipeline.android_rn_71.yml @@ -11,5 +11,3 @@ - "/Users/builder/uibuilder/work/coverage/**/*.lcov" - "/Users/builder/uibuilder/work/**/allure-report-*.html" - "/Users/builder/uibuilder/work/artifacts*.tar.gz" - agents: - queue: m2-oss diff --git a/.buildkite/jobs/pipeline.android_rn_73.yml b/.buildkite/jobs/pipeline.android_rn_73.yml index 9006f47009..97c7a48228 100644 --- a/.buildkite/jobs/pipeline.android_rn_73.yml +++ b/.buildkite/jobs/pipeline.android_rn_73.yml @@ -10,5 +10,3 @@ - "/Users/builder/uibuilder/work/coverage/**/*.lcov" - "/Users/builder/uibuilder/work/**/allure-report-*.html" - "/Users/builder/uibuilder/work/artifacts*.tar.gz" - agents: - queue: m2-oss diff --git a/.buildkite/jobs/pipeline.ios_demo_app_rn_71.yml b/.buildkite/jobs/pipeline.ios_demo_app_rn_71.yml index 0c4c8bf77a..9ac8f58fdc 100644 --- a/.buildkite/jobs/pipeline.ios_demo_app_rn_71.yml +++ b/.buildkite/jobs/pipeline.ios_demo_app_rn_71.yml @@ -7,5 +7,3 @@ artifact_paths: - "/Users/builder/uibuilder/work/coverage/**/*.lcov" - "/Users/builder/uibuilder/work/artifacts*.tar.gz" - agents: - queue: m2-oss diff --git a/.buildkite/jobs/pipeline.ios_demo_app_rn_73.yml b/.buildkite/jobs/pipeline.ios_demo_app_rn_73.yml index 4e49cd63b7..a4420a2c06 100644 --- a/.buildkite/jobs/pipeline.ios_demo_app_rn_73.yml +++ b/.buildkite/jobs/pipeline.ios_demo_app_rn_73.yml @@ -7,5 +7,3 @@ artifact_paths: - "/Users/builder/uibuilder/work/coverage/**/*.lcov" - "/Users/builder/uibuilder/work/artifacts*.tar.gz" - agents: - queue: m2-oss diff --git a/.buildkite/jobs/pipeline.ios_rn_71.yml b/.buildkite/jobs/pipeline.ios_rn_71.yml index 254964c47a..88f4070289 100644 --- a/.buildkite/jobs/pipeline.ios_rn_71.yml +++ b/.buildkite/jobs/pipeline.ios_rn_71.yml @@ -8,5 +8,3 @@ - "/Users/builder/uibuilder/work/coverage/**/*.lcov" - "/Users/builder/uibuilder/work/**/allure-report-*.html" - "/Users/builder/uibuilder/work/artifacts*.tar.gz" - agents: - queue: m2-oss diff --git a/.buildkite/pipeline.debug.yml b/.buildkite/pipeline.debug.yml index cbcdc58b57..b5962cdf2f 100644 --- a/.buildkite/pipeline.debug.yml +++ b/.buildkite/pipeline.debug.yml @@ -8,20 +8,20 @@ steps: multiple: true hint: "hey Chef, what are we cooking today?" options: - - label: "iOS RN 70" + - label: "iOS RN 71" value: "ios_rn_71" - - label: "iOS RN 70" - value: "ios_rn_71" - - label: "iOS Demo App RN 70" - value: "ios_demo_app_rn_70" + - label: "iOS RN 73" + value: "ios_rn_73" - label: "iOS Demo App RN 71" value: "ios_demo_app_rn_71" - - label: "Android RN 70" - value: "android_rn_70" + - label: "iOS Demo App RN 73" + value: "ios_demo_app_rn_73" - label: "Android RN 71" value: "android_rn_71" - - label: "Android Demo App RN 71" - value: "android_demo_app_rn_71" + - label: "Android RN 73" + value: "android_rn_73" + - label: "Android Demo App RN 73" + value: "android_demo_app_rn_73" - label: "Get Release Pipeline" command: '.buildkite/pipeline.sh debug | buildkite-agent pipeline upload' diff --git a/.buildkite/pipeline_common.sh b/.buildkite/pipeline_common.sh index d0dc816e93..f2fc0e9e79 100755 --- a/.buildkite/pipeline_common.sh +++ b/.buildkite/pipeline_common.sh @@ -1,9 +1,5 @@ #!/bin/bash -e -echo "agents: - queue: m2-oss" -echo "env: - JAVA_HOME: /opt/openjdk/openlogic-openjdk-17.0.9+9-mac-x64/jdk-17.0.9.jdk/Contents/Home" echo "steps:" cat .buildkite/jobs/pipeline.ios_rn_73.yml From 6f35c850de4157f2a7e141f0fa862a082955934a Mon Sep 17 00:00:00 2001 From: Georgy Date: Mon, 6 May 2024 15:25:55 +0300 Subject: [PATCH 08/13] Fixed scrolling inaccuracy on Android (#4482) Fixed scrolling inaccuracy on Android --- .../espresso/scroll/DetoxScrollActions.kt | 4 +- .../wix/detox/espresso/scroll/DetoxSwipe.kt | 2 +- .../detox/espresso/scroll/FlinglessSwiper.kt | 50 ---- .../detox/espresso/scroll/ScrollHelper.java | 4 +- .../espresso/scroll/FlinglessSwiperSpec.kt | 237 ------------------ detox/test/e2e/03.actions-scroll.test.js | 8 +- .../03.actions.visibility-workaround.test.js | 3 +- detox/test/src/Screens/ScrollActionsScreen.js | 2 +- 8 files changed, 12 insertions(+), 298 deletions(-) delete mode 100644 detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/FlinglessSwiper.kt delete mode 100644 detox/android/detox/src/testFull/java/com/wix/detox/espresso/scroll/FlinglessSwiperSpec.kt diff --git a/detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/DetoxScrollActions.kt b/detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/DetoxScrollActions.kt index 4ef29102e0..9a07902d30 100644 --- a/detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/DetoxScrollActions.kt +++ b/detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/DetoxScrollActions.kt @@ -20,7 +20,7 @@ abstract class DetoxScrollActionBase internal constructor( : ViewAction { override fun getConstraints(): Matcher = allOf(isAssignableFrom(View::class.java), isDisplayed()) override fun perform(uiController: UiController?, view: View?) = - ScrollHelper.perform(uiController, view, direction, amountInDp, startOffsetPercentX, startOffsetPercentY) + ScrollHelper.perform(uiController, view, direction, amountInDp, startOffsetPercentX, startOffsetPercentY) } class DetoxScrollAction(@MotionDir direction: Int, amountInDp: Double, startOffsetPercentX: Float?, startOffsetPercentY: Float?) @@ -30,6 +30,8 @@ class DetoxScrollAction(@MotionDir direction: Int, amountInDp: Double, startOffs override fun perform(uiController: UiController?, view: View?) { try { super.perform(uiController, view) + } catch (e: ScrollEdgeException) { + // Hit the edge } catch (e: Exception) { throw DetoxRuntimeException(e) } diff --git a/detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/DetoxSwipe.kt b/detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/DetoxSwipe.kt index 31c8a29519..b8567a4442 100644 --- a/detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/DetoxSwipe.kt +++ b/detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/DetoxSwipe.kt @@ -1,7 +1,7 @@ package com.wix.detox.espresso.scroll /** - * Along with [FlinglessSwiper], this is based on from Espresso's implementation of Swiping + * Along with [LinearSwiper], this is based on from Espresso's implementation of Swiping * (i.e. in [androidx.test.espresso.action.Swipe] - typically dispatched via the * [androidx.test.espresso.action.GeneralSwipeAction] action class). * diff --git a/detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/FlinglessSwiper.kt b/detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/FlinglessSwiper.kt deleted file mode 100644 index 6a0c0c853b..0000000000 --- a/detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/FlinglessSwiper.kt +++ /dev/null @@ -1,50 +0,0 @@ -package com.wix.detox.espresso.scroll - -import android.view.ViewConfiguration -import androidx.test.espresso.UiController -import com.wix.detox.espresso.action.common.MotionEvents - -/** - * A detox-swiper that, given the total expected motions, tries to swipe fast and yet avoid an - * undesired fling, typically triggered at the end of a swipe motion over scrollable views. It mostly - * relies on [ViewConfiguration.getScaledMinimumFlingVelocity] (i.e. tries to keep swiping below - * that velocity, at least at the end). - * - * @see DetoxSwipe - */ -class FlinglessSwiper @JvmOverloads constructor( - expectedMotions: Int, - uiController: UiController, - viewConfig: ViewConfiguration, - motionEvents: MotionEvents = MotionEvents()) - : DetoxSwiper(uiController, motionEvents) { - - private val pixelsPerSecond = viewConfig.scaledMinimumFlingVelocity * VELOCITY_SAFETY_RATIO - private val fastEventsCountLimit = expectedMotions * FAST_EVENTS_RATIO - - override fun calcEventTime(targetX: Float, targetY: Float): Long { - val lastEvent = events.last() - var dt = 10 - - val motionsCount = events.size - - if (motionsCount >= fastEventsCountLimit) { - val dx = Math.abs((targetX - lastEvent.x)) - val dy = Math.abs((targetY - lastEvent.y)) - - val dtX = ((dx / pixelsPerSecond) * 1000).toInt() - val dtY = ((dy / pixelsPerSecond) * 1000).toInt() - - dt = Math.max(dtX, dtY) - } - - return lastEvent.eventTime + Math.max(dt, 10) - } - - - companion object { -// private const val LOG_TAG = "DetoxBatchedSwiper" - private const val VELOCITY_SAFETY_RATIO = .99f - private const val FAST_EVENTS_RATIO = .75f - } -} diff --git a/detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/ScrollHelper.java b/detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/ScrollHelper.java index bef721c984..c9e5f9282a 100644 --- a/detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/ScrollHelper.java +++ b/detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/ScrollHelper.java @@ -29,7 +29,7 @@ public class ScrollHelper { private static final String LOG_TAG = "DetoxScrollHelper"; - private static final int SCROLL_MOTIONS = 70; + private static final int SCROLL_MOTIONS = 40; private static final int MAX_FLING_WAITS = 3; private static final double DEFAULT_DEADZONE_PERCENT = 0.05; @@ -95,7 +95,7 @@ private static void scrollOnce(UiController uiController, View view, @MotionDir } private static void doScroll(final Context context, final UiController uiController, int downX, int downY, int upX, int upY) { - final DetoxSwiper swiper = new FlinglessSwiper(SCROLL_MOTIONS, uiController, ViewConfiguration.get(context)); + final DetoxSwiper swiper = new LinearSwiper(uiController); final DetoxSwipe swipe = new DetoxSwipe(downX, downY, upX, upY, SCROLL_MOTIONS, swiper); swipe.perform(); } diff --git a/detox/android/detox/src/testFull/java/com/wix/detox/espresso/scroll/FlinglessSwiperSpec.kt b/detox/android/detox/src/testFull/java/com/wix/detox/espresso/scroll/FlinglessSwiperSpec.kt deleted file mode 100644 index 71856eab0e..0000000000 --- a/detox/android/detox/src/testFull/java/com/wix/detox/espresso/scroll/FlinglessSwiperSpec.kt +++ /dev/null @@ -1,237 +0,0 @@ -package com.wix.detox.espresso.scroll - -import android.view.MotionEvent -import android.view.ViewConfiguration -import androidx.test.espresso.UiController -import com.wix.detox.espresso.action.common.MotionEvents -import org.assertj.core.api.Assertions.assertThat -import org.mockito.kotlin.* -import org.spekframework.spek2.Spek -import org.spekframework.spek2.style.specification.describe - -object FlinglessSwiperSpec: Spek({ - describe("Flingless Swiper") { - val swipeStartTime = 1000L - - lateinit var uiController: UiController - lateinit var downEvent: MotionEvent - lateinit var moveEvent: MotionEvent - lateinit var upEvent: MotionEvent - lateinit var motionEvents: MotionEvents - lateinit var viewConfig: ViewConfiguration - - beforeEachTest { - uiController = mock() - downEvent = mock(name = "downEventMock") { - on { downTime }.doReturn(swipeStartTime) - on { eventTime }.doReturn(swipeStartTime) - } - moveEvent = mock(name = "moveEventMock") { - on { downTime }.doReturn(swipeStartTime) - on { eventTime }.doReturn(swipeStartTime) - } - upEvent = mock(name = "upEventMock") { - on { downTime }.doReturn(swipeStartTime) - on { eventTime }.doReturn(swipeStartTime) - } - motionEvents = mock(name = "motionEventsMock") { - on { obtainDownEvent(any(), any(), any()) }.doReturn(downEvent) - on { obtainMoveEvent(any(), any(), any(), any()) }.doReturn(moveEvent) - on { obtainUpEvent(any(), any(), any(), any()) }.doReturn(upEvent) - } - viewConfig = mock() - } - - fun uut(expectedMotions: Int = -1) = FlinglessSwiper(expectedMotions, uiController, viewConfig, motionEvents) - - describe("start") { - it("should obtain a down event") { - uut().startAt(666f, 999f) - verify(motionEvents).obtainDownEvent(eq(666f), eq(999f), any()) - } - - it("should throw a descriptive error if already started") { - var err: Exception? = null - try { - with (uut()) { - startAt(666f, 999f) - startAt(667f, 998f) - } - } catch (e: Exception) { - err = e - } - assertThat(err).isNotNull() - assertThat(err).hasMessage("Swiper already started") - } - } - - describe("move") { - val SWIPER_VELOCITY = 99f - - beforeEachTest { - whenever(viewConfig.scaledMinimumFlingVelocity).doReturn(100) // i.e. we expect the swiper to apply a safety margin of 99%, hence actual velocity = 99 px/sec - } - - it("should obtain a move event") { - with(uut()) { - startAt(666f, 999f) - moveTo(111f, 222f) - } - verify(motionEvents).obtainMoveEvent(eq(downEvent), any(), eq(111f), eq(222f)) - } - - it("should throw descriptive error if moved before starting") { - var err: Exception? = null - try { - uut().moveTo(111f, 222f) - } catch (e: Exception) { - err = e - } - assertThat(err).isNotNull() - assertThat(err).hasMessage("Swiper not initialized - did you forget to call startAt()?") - } - - describe("event time") { - it("should set event time according to min fling speed config (1 second if distance=velocity)") { - val expectedEventTime = swipeStartTime + 1000L - - with(uut()) { - startAt(0f, 0f) - moveTo(0f, SWIPER_VELOCITY) - } - - verify(motionEvents).obtainMoveEvent(any(), eq(expectedEventTime), any(), any()) - } - - it("should set event time according to negative scroll direction") { - whenever(downEvent.y).doReturn(SWIPER_VELOCITY) - - val expectedEventTime = swipeStartTime + 1000L - - with(uut()) { - startAt(0f, SWIPER_VELOCITY) - moveTo(0f, 0f) - } - - verify(motionEvents).obtainMoveEvent(any(), eq(expectedEventTime), any(), any()) - } - - it("should set event time proportional to min fling speed config (half the distance => half the time)") { - val expectedEventTime = swipeStartTime + 500L - - with(uut()) { - startAt(0f, 0f) - moveTo(0f, SWIPER_VELOCITY/2) - } - - verify(motionEvents).obtainMoveEvent(any(), eq(expectedEventTime), any(), any()) - } - - it("should apply a min event-time delta of 10ms") { - val expectedMinDelta = 10 - val expectedEventTime = swipeStartTime + expectedMinDelta - - with(uut()) { - startAt(0f, 0f) - moveTo(0f, .765f) // i.e. raw result is 9ms, but it won't be used - } - - verify(motionEvents).obtainMoveEvent(any(), eq(expectedEventTime), any(), any()) - } - - it("should take x-axis movement into account in event time calcs") { - val expectedEventTime = swipeStartTime + 1000L - - with(uut()) { - startAt(0f, 0f) - moveTo(SWIPER_VELOCITY, 0f) - } - - verify(motionEvents).obtainMoveEvent(any(), eq(expectedEventTime), any(), any()) - } - - it("should optimize by applying fling-speed limitation only in last 25% of events") { - whenever(moveEvent.y).doReturn(255f) - - with(uut(expectedMotions = 4)) { - startAt(0f, 0f) - moveTo(0f, 85f) - moveTo(0f, 170f) - moveTo(0f, 255f) - moveTo(0f, 340f) - } - - verify(motionEvents, times(3)).obtainMoveEvent(any(), eq(swipeStartTime + 10L), any(), any()) - verify(motionEvents, times(1)).obtainMoveEvent(any(), eq(swipeStartTime + 858), any(), any()) - } - } - } - - describe("finish") { - it("should throw descriptive error if not started") { - var err: Exception? = null - try { - with (uut()) { - finishAt(1f, 1f) - } - } catch (e: Exception) { - err = e - } - assertThat(err).isNotNull() - assertThat(err).hasMessage("Swiper not initialized - did you forget to call startAt()?") - } - - it("should finish by obtaining an up event") { - whenever(downEvent.x).doReturn(666f) - whenever(downEvent.y).doReturn(999f) - whenever(viewConfig.scaledMinimumFlingVelocity).doReturn(100) - - val expectedEventTime = swipeStartTime + 1000L - - with(uut()) { - startAt(666f, 999f) - finishAt(666f + 99f, 999f + 99f) - } - verify(motionEvents).obtainUpEvent(downEvent, expectedEventTime, 666f + 99f, 999f + 99f) - } - - it("should finish by flushing all events to ui controller") { - with(uut()) { - startAt(0f, 0f) - moveTo(1f, 1f) - finishAt(2f, 2f) - } - verify(uiController).injectMotionEventSequence(eq(listOf(downEvent, moveEvent, upEvent))) - } - - it("should finish by recycling all events") { - with(uut()) { - startAt(0f, 0f) - moveTo(1f, 1f) - finishAt(2f, 2f) - } - - verify(downEvent).recycle() - verify(upEvent).recycle() - verify(moveEvent).recycle() - } - - it("should recycle all events even if ui controller fails") { - whenever(uiController.injectMotionEventSequence(any())).doThrow(RuntimeException()) - - with(uut()) { - startAt(0f, 0f) - moveTo(1f, 1f) - try { - finishAt(2f, 2f) - } catch (ex: Exception) { - } - } - - verify(downEvent).recycle() - verify(upEvent).recycle() - verify(moveEvent).recycle() - } - } - } -}) diff --git a/detox/test/e2e/03.actions-scroll.test.js b/detox/test/e2e/03.actions-scroll.test.js index 6615d6ea4b..5fb3ea65d9 100644 --- a/detox/test/e2e/03.actions-scroll.test.js +++ b/detox/test/e2e/03.actions-scroll.test.js @@ -18,10 +18,10 @@ describe('Actions - Scroll', () => { await expect(element(by.text('Text4'))).not.toBeVisible(); }); - custom.it.withFailureIf.android('should scroll for a large amount in direction', async () => { - await expect(element(by.text('Text6'))).not.toBeVisible(); - await element(by.id('ScrollView161')).scroll(220, 'down'); - await expect(element(by.text('Text6'))).toBeVisible(); + it('should scroll for a large amount in direction', async () => { + await expect(element(by.text('Text12'))).not.toBeVisible(); + await element(by.id('ScrollView161')).scroll(1000, 'down'); + await expect(element(by.text('Text12'))).toBeVisible(); }); it('should scroll for a large amount in horizontal direction', async () => { diff --git a/detox/test/e2e/03.actions.visibility-workaround.test.js b/detox/test/e2e/03.actions.visibility-workaround.test.js index c9406d45af..c7e7bb66a3 100644 --- a/detox/test/e2e/03.actions.visibility-workaround.test.js +++ b/detox/test/e2e/03.actions.visibility-workaround.test.js @@ -1,5 +1,4 @@ const {scrollViewDriver} = require('./drivers/fs-scroll-driver'); -const {expectToThrow} = require('./utils/custom-expects'); /** * A mini suite providing an alternative to tests failing due to issues found in RN 58+ on Android (see @@ -32,7 +31,7 @@ describe(':android: Visibility-bug workaround actions', () => { await expect(scrollViewDriver.firstItem()).toBeVisible(); await expect(scrollViewDriver.lastItem()).not.toBeVisible(); - await expectToThrow(() => scrollViewDriver.scrollBy(1000)); + await scrollViewDriver.scrollBy(3000); await expect(scrollViewDriver.firstItem()).not.toBeVisible(); await expect(scrollViewDriver.lastItem()).toBeVisible(); diff --git a/detox/test/src/Screens/ScrollActionsScreen.js b/detox/test/src/Screens/ScrollActionsScreen.js index 47dafe7218..f60391d69a 100644 --- a/detox/test/src/Screens/ScrollActionsScreen.js +++ b/detox/test/src/Screens/ScrollActionsScreen.js @@ -19,7 +19,7 @@ export default class ScrollActionsScreen extends Component { render() { return ( - + { Array.from({length: 20}, (_, index) => this.renderItem(index + 1)) From 9afc061062f8825f4536f4389278f216f6ffea06 Mon Sep 17 00:00:00 2001 From: Georgy Steshin Date: Wed, 8 May 2024 11:56:35 +0300 Subject: [PATCH 09/13] Fixed the types of whileElement to be aligned with the documantation and the reality --- detox/detox.d.ts | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/detox/detox.d.ts b/detox/detox.d.ts index 6adc73128e..a521dfb67e 100644 --- a/detox/detox.d.ts +++ b/detox/detox.d.ts @@ -1279,12 +1279,28 @@ declare global { * Performs the action repeatedly on the element until an expectation is met * @example await waitFor(element(by.text('Item #5'))).toBeVisible().whileElement(by.id('itemsList')).scroll(50, 'down'); */ - whileElement(by: NativeMatcher): NativeElement & WaitFor; + whileElement(by: NativeMatcher): NativeElementWaitableActions & WaitFor; // TODO: not sure about & WaitFor - check if we can chain whileElement multiple times } - interface NativeElementActions { + interface NativeElementWaitableActions { + /** + * Swipes in the provided direction at the provided speed, started from percentage. + * @param speed default: `fast` + * @param percentage screen percentage to swipe; valid input: `[0.0, 1.0]` + * @param optional normalizedStartingPointX X coordinate of swipe starting point, relative to the view width; valid input: `[0.0, 1.0]` + * @param normalizedStartingPointY Y coordinate of swipe starting point, relative to the view height; valid input: `[0.0, 1.0]` + * @example await element(by.id('scrollView')).swipe('down'); + * @example await element(by.id('scrollView')).swipe('down', 'fast'); + * @example await element(by.id('scrollView')).swipe('down', 'fast', 0.5); + * @example await element(by.id('scrollView')).swipe('down', 'fast', 0.5, 0.2); + * @example await element(by.id('scrollView')).swipe('down', 'fast', 0.5, 0.2, 0.5); + */ + swipe(direction: Direction, speed?: Speed, percentage?: number, normalizedStartingPointX?: number, normalizedStartingPointY?: number): Promise; + } + + interface NativeElementActions extends NativeElementWaitableActions{ /** * Simulate tap on an element * @param point relative coordinates to the matched element (the element size could changes on different devices or even when changing the device font size) From bd8cb74af3a9836c3be4ea5c00714092a3c96d11 Mon Sep 17 00:00:00 2001 From: Georgy Steshin Date: Wed, 8 May 2024 12:00:13 +0300 Subject: [PATCH 10/13] Fixed prev commit --- detox/detox.d.ts | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/detox/detox.d.ts b/detox/detox.d.ts index a521dfb67e..54759f434d 100644 --- a/detox/detox.d.ts +++ b/detox/detox.d.ts @@ -1408,20 +1408,6 @@ declare global { */ adjustSliderToPosition(newPosition: number): Promise; - /** - * Swipes in the provided direction at the provided speed, started from percentage. - * @param speed default: `fast` - * @param percentage screen percentage to swipe; valid input: `[0.0, 1.0]` - * @param optional normalizedStartingPointX X coordinate of swipe starting point, relative to the view width; valid input: `[0.0, 1.0]` - * @param normalizedStartingPointY Y coordinate of swipe starting point, relative to the view height; valid input: `[0.0, 1.0]` - * @example await element(by.id('scrollView')).swipe('down'); - * @example await element(by.id('scrollView')).swipe('down', 'fast'); - * @example await element(by.id('scrollView')).swipe('down', 'fast', 0.5); - * @example await element(by.id('scrollView')).swipe('down', 'fast', 0.5, 0.2); - * @example await element(by.id('scrollView')).swipe('down', 'fast', 0.5, 0.2, 0.5); - */ - swipe(direction: Direction, speed?: Speed, percentage?: number, normalizedStartingPointX?: number, normalizedStartingPointY?: number): Promise; - /** * Sets a picker view’s column to the given value. This function supports both date pickers and general picker views. (iOS Only) * Note: When working with date pickers, you should always set an explicit locale when launching your app in order to prevent flakiness from different date and time styles. From 335125a0430087c3ed0ab3287735bdbf09d987a0 Mon Sep 17 00:00:00 2001 From: Georgy Steshin Date: Wed, 8 May 2024 12:06:54 +0300 Subject: [PATCH 11/13] Fixed prev commit --- detox/detox.d.ts | 51 ++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/detox/detox.d.ts b/detox/detox.d.ts index 54759f434d..1427071e8f 100644 --- a/detox/detox.d.ts +++ b/detox/detox.d.ts @@ -1285,19 +1285,22 @@ declare global { } interface NativeElementWaitableActions { + /** - * Swipes in the provided direction at the provided speed, started from percentage. - * @param speed default: `fast` - * @param percentage screen percentage to swipe; valid input: `[0.0, 1.0]` - * @param optional normalizedStartingPointX X coordinate of swipe starting point, relative to the view width; valid input: `[0.0, 1.0]` - * @param normalizedStartingPointY Y coordinate of swipe starting point, relative to the view height; valid input: `[0.0, 1.0]` - * @example await element(by.id('scrollView')).swipe('down'); - * @example await element(by.id('scrollView')).swipe('down', 'fast'); - * @example await element(by.id('scrollView')).swipe('down', 'fast', 0.5); - * @example await element(by.id('scrollView')).swipe('down', 'fast', 0.5, 0.2); - * @example await element(by.id('scrollView')).swipe('down', 'fast', 0.5, 0.2, 0.5); + * Scrolls a given amount of pixels in the provided direction, starting from the provided start positions. + * @param pixels - independent device pixels + * @param direction - left/right/up/down + * @param startPositionX - the X starting scroll position, in percentage; valid input: `[0.0, 1.0]`, `NaN`; default: `NaN`—choose the best value automatically + * @param startPositionY - the Y starting scroll position, in percentage; valid input: `[0.0, 1.0]`, `NaN`; default: `NaN`—choose the best value automatically + * @example await element(by.id('scrollView')).scroll(100, 'down', NaN, 0.85); + * @example await element(by.id('scrollView')).scroll(100, 'up'); */ - swipe(direction: Direction, speed?: Speed, percentage?: number, normalizedStartingPointX?: number, normalizedStartingPointY?: number): Promise; + scroll( + pixels: number, + direction: Direction, + startPositionX?: number, + startPositionY?: number + ): Promise; } interface NativeElementActions extends NativeElementWaitableActions{ @@ -1369,20 +1372,18 @@ declare global { tapReturnKey(): Promise; /** - * Scrolls a given amount of pixels in the provided direction, starting from the provided start positions. - * @param pixels - independent device pixels - * @param direction - left/right/up/down - * @param startPositionX - the X starting scroll position, in percentage; valid input: `[0.0, 1.0]`, `NaN`; default: `NaN`—choose the best value automatically - * @param startPositionY - the Y starting scroll position, in percentage; valid input: `[0.0, 1.0]`, `NaN`; default: `NaN`—choose the best value automatically - * @example await element(by.id('scrollView')).scroll(100, 'down', NaN, 0.85); - * @example await element(by.id('scrollView')).scroll(100, 'up'); - */ - scroll( - pixels: number, - direction: Direction, - startPositionX?: number, - startPositionY?: number - ): Promise; + * Swipes in the provided direction at the provided speed, started from percentage. + * @param speed default: `fast` + * @param percentage screen percentage to swipe; valid input: `[0.0, 1.0]` + * @param optional normalizedStartingPointX X coordinate of swipe starting point, relative to the view width; valid input: `[0.0, 1.0]` + * @param normalizedStartingPointY Y coordinate of swipe starting point, relative to the view height; valid input: `[0.0, 1.0]` + * @example await element(by.id('scrollView')).swipe('down'); + * @example await element(by.id('scrollView')).swipe('down', 'fast'); + * @example await element(by.id('scrollView')).swipe('down', 'fast', 0.5); + * @example await element(by.id('scrollView')).swipe('down', 'fast', 0.5, 0.2); + * @example await element(by.id('scrollView')).swipe('down', 'fast', 0.5, 0.2, 0.5); + */ + swipe(direction: Direction, speed?: Speed, percentage?: number, normalizedStartingPointX?: number, normalizedStartingPointY?: number): Promise; /** * Scroll to index. From 44684450bce6525f6e2b328928047854bf482b55 Mon Sep 17 00:00:00 2001 From: Georgy Steshin Date: Wed, 8 May 2024 12:16:57 +0300 Subject: [PATCH 12/13] Fixed PR --- detox/detox.d.ts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/detox/detox.d.ts b/detox/detox.d.ts index 1427071e8f..2ef5483ea2 100644 --- a/detox/detox.d.ts +++ b/detox/detox.d.ts @@ -1371,20 +1371,6 @@ declare global { */ tapReturnKey(): Promise; - /** - * Swipes in the provided direction at the provided speed, started from percentage. - * @param speed default: `fast` - * @param percentage screen percentage to swipe; valid input: `[0.0, 1.0]` - * @param optional normalizedStartingPointX X coordinate of swipe starting point, relative to the view width; valid input: `[0.0, 1.0]` - * @param normalizedStartingPointY Y coordinate of swipe starting point, relative to the view height; valid input: `[0.0, 1.0]` - * @example await element(by.id('scrollView')).swipe('down'); - * @example await element(by.id('scrollView')).swipe('down', 'fast'); - * @example await element(by.id('scrollView')).swipe('down', 'fast', 0.5); - * @example await element(by.id('scrollView')).swipe('down', 'fast', 0.5, 0.2); - * @example await element(by.id('scrollView')).swipe('down', 'fast', 0.5, 0.2, 0.5); - */ - swipe(direction: Direction, speed?: Speed, percentage?: number, normalizedStartingPointX?: number, normalizedStartingPointY?: number): Promise; - /** * Scroll to index. * @example await element(by.id('scrollView')).scrollToIndex(10); @@ -1409,6 +1395,20 @@ declare global { */ adjustSliderToPosition(newPosition: number): Promise; + /** + * Swipes in the provided direction at the provided speed, started from percentage. + * @param speed default: `fast` + * @param percentage screen percentage to swipe; valid input: `[0.0, 1.0]` + * @param optional normalizedStartingPointX X coordinate of swipe starting point, relative to the view width; valid input: `[0.0, 1.0]` + * @param normalizedStartingPointY Y coordinate of swipe starting point, relative to the view height; valid input: `[0.0, 1.0]` + * @example await element(by.id('scrollView')).swipe('down'); + * @example await element(by.id('scrollView')).swipe('down', 'fast'); + * @example await element(by.id('scrollView')).swipe('down', 'fast', 0.5); + * @example await element(by.id('scrollView')).swipe('down', 'fast', 0.5, 0.2); + * @example await element(by.id('scrollView')).swipe('down', 'fast', 0.5, 0.2, 0.5); + */ + swipe(direction: Direction, speed?: Speed, percentage?: number, normalizedStartingPointX?: number, normalizedStartingPointY?: number): Promise; + /** * Sets a picker view’s column to the given value. This function supports both date pickers and general picker views. (iOS Only) * Note: When working with date pickers, you should always set an explicit locale when launching your app in order to prevent flakiness from different date and time styles. From 60d78796b0d84325a6a6865c576ae13f27d20639 Mon Sep 17 00:00:00 2001 From: Georgy Steshin Date: Thu, 9 May 2024 14:47:36 +0300 Subject: [PATCH 13/13] Added tests --- detox/test/types/detox-global-tests.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/detox/test/types/detox-global-tests.ts b/detox/test/types/detox-global-tests.ts index 293cf930cd..efb86e0cb8 100644 --- a/detox/test/types/detox-global-tests.ts +++ b/detox/test/types/detox-global-tests.ts @@ -92,6 +92,14 @@ describe("Test", () => { .whileElement(by.id("ScrollView630")) .scroll(50, "down"); + await waitFor(element(by.text("Text5"))) + .toBeVisible() + .whileElement(by.id("ScrollView630")) + .scroll(50, "down", 0.5, 0.5); + + // @ts-expect-error + await waitFor(element(by.text("Text5"))).toBeVisible().whileElement(by.id("ScrollView630")).tap(); + await web.element(by.web.id("btnSave")).tap(); await web.element(by.web.id("btnSave")).runScript('(el) => el.click()'); const scriptResult = await web.element(by.web.id("btnSave")).runScript(function (el: any, text: string) {