@deque/axe-appium3-webdriveragent 0.0.0-stage → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (678) hide show
  1. package/Configurations/IOSSettings.xcconfig +31 -0
  2. package/Configurations/IOSTestSettings.xcconfig +1 -0
  3. package/Configurations/TVOSSettings.xcconfig +31 -0
  4. package/Configurations/TVOSTestSettings.xcconfig +1 -0
  5. package/LICENSE +66 -0
  6. package/LICENSE-3RD-PARTY.md +70 -0
  7. package/MySwiftFramework/JSONHelper.swift +31 -0
  8. package/MySwiftFramework/MySwiftFramework.h +18 -0
  9. package/PrivateHeaders/AccessibilityUtilities/AXSettings.h +15 -0
  10. package/PrivateHeaders/MobileCoreServices/LSApplicationWorkspace.h +127 -0
  11. package/PrivateHeaders/TextInput/TIPreferencesController.h +45 -0
  12. package/PrivateHeaders/UIKitCore/UIKeyboardImpl.h +27 -0
  13. package/PrivateHeaders/XCTest/CDStructures.h +7 -0
  14. package/PrivateHeaders/XCTest/NSFastEnumeration-Protocol.h +23 -0
  15. package/PrivateHeaders/XCTest/XCAXClient_iOS.h +91 -0
  16. package/PrivateHeaders/XCTest/XCApplicationQuery.h +30 -0
  17. package/PrivateHeaders/XCTest/XCDebugLogDelegate-Protocol.h +23 -0
  18. package/PrivateHeaders/XCTest/XCPointerEvent.h +63 -0
  19. package/PrivateHeaders/XCTest/XCPointerEventPath.h +65 -0
  20. package/PrivateHeaders/XCTest/XCSynthesizedEventRecord.h +55 -0
  21. package/PrivateHeaders/XCTest/XCTAggregateSuiteRunStatistics.h +38 -0
  22. package/PrivateHeaders/XCTest/XCTAttachmentManager.h +33 -0
  23. package/PrivateHeaders/XCTest/XCTCapabilities.h +35 -0
  24. package/PrivateHeaders/XCTest/XCTCapabilitiesProviding-Protocol.h +23 -0
  25. package/PrivateHeaders/XCTest/XCTElementSetTransformer-Protocol.h +35 -0
  26. package/PrivateHeaders/XCTest/XCTElementSnapshotAttributeDataSource-Protocol.h +33 -0
  27. package/PrivateHeaders/XCTest/XCTElementSnapshotProvider-Protocol.h +23 -0
  28. package/PrivateHeaders/XCTest/XCTExpectedFailureContextManager.h +35 -0
  29. package/PrivateHeaders/XCTest/XCTFuture.h +45 -0
  30. package/PrivateHeaders/XCTest/XCTHarnessEventReporting-Protocol.h +29 -0
  31. package/PrivateHeaders/XCTest/XCTIssue.h +49 -0
  32. package/PrivateHeaders/XCTest/XCTIssueHandling-Protocol.h +26 -0
  33. package/PrivateHeaders/XCTest/XCTMacCatalystStatusProviding-Protocol.h +23 -0
  34. package/PrivateHeaders/XCTest/XCTMeasureOptions.h +48 -0
  35. package/PrivateHeaders/XCTest/XCTMemoryChecker.h +50 -0
  36. package/PrivateHeaders/XCTest/XCTMemoryCheckerDelegate-Protocol.h +26 -0
  37. package/PrivateHeaders/XCTest/XCTMessagingChannel_IDEToRunner-Protocol.h +27 -0
  38. package/PrivateHeaders/XCTest/XCTMessagingChannel_RunnerToDaemon-Protocol.h +39 -0
  39. package/PrivateHeaders/XCTest/XCTMessagingChannel_RunnerToIDE-Protocol.h +32 -0
  40. package/PrivateHeaders/XCTest/XCTMessagingRole_ActivityReporting-Protocol.h +24 -0
  41. package/PrivateHeaders/XCTest/XCTMessagingRole_AttachmentFutureResultStatusUpdating-Protocol.h +23 -0
  42. package/PrivateHeaders/XCTest/XCTMessagingRole_BundleRequesting-Protocol.h +24 -0
  43. package/PrivateHeaders/XCTest/XCTMessagingRole_CapabilityExchange-Protocol.h +56 -0
  44. package/PrivateHeaders/XCTest/XCTMessagingRole_DebugLogging-Protocol.h +23 -0
  45. package/PrivateHeaders/XCTest/XCTMessagingRole_EventSynthesis-Protocol.h +34 -0
  46. package/PrivateHeaders/XCTest/XCTMessagingRole_ForcePressureSupportQuerying-Protocol.h +25 -0
  47. package/PrivateHeaders/XCTest/XCTMessagingRole_HIDEventRecording-Protocol.h +25 -0
  48. package/PrivateHeaders/XCTest/XCTMessagingRole_MemoryTesting-Protocol.h +23 -0
  49. package/PrivateHeaders/XCTest/XCTMessagingRole_PerformanceMeasurementReporting-Protocol.h +23 -0
  50. package/PrivateHeaders/XCTest/XCTMessagingRole_ProcessMonitoring-Protocol.h +25 -0
  51. package/PrivateHeaders/XCTest/XCTMessagingRole_ProtectedResourceAuthorization-Protocol.h +22 -0
  52. package/PrivateHeaders/XCTest/XCTMessagingRole_ScreenRecording-Protocol.h +24 -0
  53. package/PrivateHeaders/XCTest/XCTMessagingRole_SelfDiagnosisIssueReporting-Protocol.h +23 -0
  54. package/PrivateHeaders/XCTest/XCTMessagingRole_SignpostRequesting-Protocol.h +24 -0
  55. package/PrivateHeaders/XCTest/XCTMessagingRole_SiriAutomation-Protocol.h +27 -0
  56. package/PrivateHeaders/XCTest/XCTMessagingRole_SystemConfiguration-Protocol.h +27 -0
  57. package/PrivateHeaders/XCTest/XCTMessagingRole_TelemetrySending-Protocol.h +23 -0
  58. package/PrivateHeaders/XCTest/XCTMessagingRole_TestExecution-Protocol.h +28 -0
  59. package/PrivateHeaders/XCTest/XCTMessagingRole_TestReporting-Protocol.h +40 -0
  60. package/PrivateHeaders/XCTest/XCTMessagingRole_UIAutomation-Protocol.h +29 -0
  61. package/PrivateHeaders/XCTest/XCTMessagingRole_UIAutomationRunnerEventReporting-Protocol.h +27 -0
  62. package/PrivateHeaders/XCTest/XCTMessagingRole_UserPresence-Protocol.h +24 -0
  63. package/PrivateHeaders/XCTest/XCTMetricDiagnosticHelper.h +49 -0
  64. package/PrivateHeaders/XCTest/XCTNSPredicateExpectationObject-Protocol.h +23 -0
  65. package/PrivateHeaders/XCTest/XCTPromise.h +30 -0
  66. package/PrivateHeaders/XCTest/XCTRemoteSignpostListenerProxy-Protocol.h +29 -0
  67. package/PrivateHeaders/XCTest/XCTRepetitionPolicy.h +43 -0
  68. package/PrivateHeaders/XCTest/XCTReportingSession.h +50 -0
  69. package/PrivateHeaders/XCTest/XCTReportingSessionConfiguration-Protocol.h +27 -0
  70. package/PrivateHeaders/XCTest/XCTReportingSessionIssueReporter-Protocol.h +23 -0
  71. package/PrivateHeaders/XCTest/XCTReportingSessionTestContainer-Protocol.h +26 -0
  72. package/PrivateHeaders/XCTest/XCTReportingSessionTestReporter.h +51 -0
  73. package/PrivateHeaders/XCTest/XCTRunnerAutomationSession-Protocol.h +38 -0
  74. package/PrivateHeaders/XCTest/XCTRunnerDaemonSession.h +96 -0
  75. package/PrivateHeaders/XCTest/XCTRunnerDaemonSessionUIAutomationDelegate-Protocol.h +33 -0
  76. package/PrivateHeaders/XCTest/XCTRunnerIDESession.h +99 -0
  77. package/PrivateHeaders/XCTest/XCTRunnerIDESessionDelegate-Protocol.h +24 -0
  78. package/PrivateHeaders/XCTest/XCTRuntimeDiagnosticsPolicy.h +36 -0
  79. package/PrivateHeaders/XCTest/XCTRuntimeIssueDetectionPolicy.h +39 -0
  80. package/PrivateHeaders/XCTest/XCTScreenCapturePolicy.h +35 -0
  81. package/PrivateHeaders/XCTest/XCTSignpostListener-Protocol.h +25 -0
  82. package/PrivateHeaders/XCTest/XCTSkippedTestContext.h +37 -0
  83. package/PrivateHeaders/XCTest/XCTSourceCodeContext.h +39 -0
  84. package/PrivateHeaders/XCTest/XCTSourceCodeLocation.h +31 -0
  85. package/PrivateHeaders/XCTest/XCTTagSelection.h +41 -0
  86. package/PrivateHeaders/XCTest/XCTTestIdentifier.h +81 -0
  87. package/PrivateHeaders/XCTest/XCTTestIdentifierSet.h +54 -0
  88. package/PrivateHeaders/XCTest/XCTTestSelection.h +35 -0
  89. package/PrivateHeaders/XCTest/XCTWaiter.h +54 -0
  90. package/PrivateHeaders/XCTest/XCTWaiterManagement-Protocol.h +24 -0
  91. package/PrivateHeaders/XCTest/XCTWaiterManager-Protocol.h +25 -0
  92. package/PrivateHeaders/XCTest/XCTWaiterWait.h +40 -0
  93. package/PrivateHeaders/XCTest/XCTest.h +53 -0
  94. package/PrivateHeaders/XCTest/XCTestCase.h +180 -0
  95. package/PrivateHeaders/XCTest/XCTestCaseDiscoveryUIAutomationDelegate-Protocol.h +20 -0
  96. package/PrivateHeaders/XCTest/XCTestCaseRun.h +28 -0
  97. package/PrivateHeaders/XCTest/XCTestCaseUIAutomationDelegate-Protocol.h +25 -0
  98. package/PrivateHeaders/XCTest/XCTestCastMethodNamesUIAutomationDelegate-Protocol.h +24 -0
  99. package/PrivateHeaders/XCTest/XCTestConfiguration.h +94 -0
  100. package/PrivateHeaders/XCTest/XCTestDriver.h +64 -0
  101. package/PrivateHeaders/XCTest/XCTestExpectation.h +50 -0
  102. package/PrivateHeaders/XCTest/XCTestExpectationDelegate-Protocol.h +23 -0
  103. package/PrivateHeaders/XCTest/XCTestObservationCenter.h +60 -0
  104. package/PrivateHeaders/XCTest/XCTestRun.h +44 -0
  105. package/PrivateHeaders/XCTest/XCUIAXNotificationHandling-Protocol.h +25 -0
  106. package/PrivateHeaders/XCTest/XCUIAccessibilityInterface-Protocol.h +58 -0
  107. package/PrivateHeaders/XCTest/XCUIAlertMonitoring-Protocol.h +27 -0
  108. package/PrivateHeaders/XCTest/XCUIApplication.h +98 -0
  109. package/PrivateHeaders/XCTest/XCUIApplicationAutomationSessionProviding-Protocol.h +26 -0
  110. package/PrivateHeaders/XCTest/XCUIApplicationImpl.h +90 -0
  111. package/PrivateHeaders/XCTest/XCUIApplicationImplReporter-Protocol.h +26 -0
  112. package/PrivateHeaders/XCTest/XCUIApplicationManaging-Protocol.h +23 -0
  113. package/PrivateHeaders/XCTest/XCUIApplicationMonitor-Protocol.h +43 -0
  114. package/PrivateHeaders/XCTest/XCUIApplicationOpenRequest.h +34 -0
  115. package/PrivateHeaders/XCTest/XCUIApplicationPlatformServicesProviderDelegate-Protocol.h +25 -0
  116. package/PrivateHeaders/XCTest/XCUIApplicationProcess.h +105 -0
  117. package/PrivateHeaders/XCTest/XCUIApplicationProcessDelegate-Protocol.h +25 -0
  118. package/PrivateHeaders/XCTest/XCUIApplicationProcessManaging-Protocol.h +26 -0
  119. package/PrivateHeaders/XCTest/XCUIApplicationProcessTracker-Protocol.h +28 -0
  120. package/PrivateHeaders/XCTest/XCUIApplicationRegistry.h +32 -0
  121. package/PrivateHeaders/XCTest/XCUIButtonConsole.h +26 -0
  122. package/PrivateHeaders/XCTest/XCUICoordinate.h +49 -0
  123. package/PrivateHeaders/XCTest/XCUIDevice.h +134 -0
  124. package/PrivateHeaders/XCTest/XCUIDeviceAutomationModeInterface-Protocol.h +25 -0
  125. package/PrivateHeaders/XCTest/XCUIDeviceDelayedAttachmentTransferSupportInterface-Protocol.h +22 -0
  126. package/PrivateHeaders/XCTest/XCUIDeviceEventAndStateInterface-Protocol.h +40 -0
  127. package/PrivateHeaders/XCTest/XCUIElement.h +207 -0
  128. package/PrivateHeaders/XCTest/XCUIElementAttributesPrivate-Protocol.h +26 -0
  129. package/PrivateHeaders/XCTest/XCUIElementEventTarget-Protocol.h +38 -0
  130. package/PrivateHeaders/XCTest/XCUIElementQuery.h +166 -0
  131. package/PrivateHeaders/XCTest/XCUIElementTypeQueryProvider_Private-Protocol.h +24 -0
  132. package/PrivateHeaders/XCTest/XCUIEventRecording-Protocol.h +37 -0
  133. package/PrivateHeaders/XCTest/XCUIHitPointResult.h +25 -0
  134. package/PrivateHeaders/XCTest/XCUIInterruptionMonitoring-Protocol.h +27 -0
  135. package/PrivateHeaders/XCTest/XCUIIssueDiagnosticsProviding-Protocol.h +23 -0
  136. package/PrivateHeaders/XCTest/XCUIKnobControl.h +26 -0
  137. package/PrivateHeaders/XCTest/XCUILocation.h +24 -0
  138. package/PrivateHeaders/XCTest/XCUIPlatformApplicationServicesProviding-Protocol.h +33 -0
  139. package/PrivateHeaders/XCTest/XCUIRemoteAccessibilityInterface-Protocol.h +45 -0
  140. package/PrivateHeaders/XCTest/XCUIRemoteDeviceRunner-Protocol.h +24 -0
  141. package/PrivateHeaders/XCTest/XCUIRemoteSiriInterface-Protocol.h +30 -0
  142. package/PrivateHeaders/XCTest/XCUIResetAuthorizationStatusOfProtectedResourcesInterface-Protocol.h +22 -0
  143. package/PrivateHeaders/XCTest/XCUIScreen.h +53 -0
  144. package/PrivateHeaders/XCTest/XCUIScreenDataSource-Protocol.h +35 -0
  145. package/PrivateHeaders/XCTest/XCUISiriService.h +39 -0
  146. package/PrivateHeaders/XCTest/XCUISystem.h +26 -0
  147. package/PrivateHeaders/XCTest/XCUIXcodeApplicationManaging-Protocol.h +27 -0
  148. package/PrivateHeaders/XCTest/_TtC10XCTestCore19XCTReportingContext.h +26 -0
  149. package/PrivateHeaders/XCTest/_XCTMessaging_VoidProtocol-Protocol.h +20 -0
  150. package/PrivateHeaders/XCTest/_XCTestObservationInternal-Protocol.h +26 -0
  151. package/PrivateHeaders/XCTest/_XCTestObservationPrivate-Protocol.h +27 -0
  152. package/README.md +57 -2
  153. package/Scripts/build-webdriveragent.mjs +93 -0
  154. package/Scripts/build.sh +137 -0
  155. package/Scripts/bundle-mobile-assets.sh +35 -0
  156. package/Scripts/embed-runner-icon.sh +118 -0
  157. package/Scripts/fetch-prebuilt-wda.mjs +81 -0
  158. package/Scripts/update-wda-version.mjs +44 -0
  159. package/WebDriverAgent.xcodeproj/project.pbxproj +8522 -0
  160. package/WebDriverAgent.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  161. package/WebDriverAgent.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  162. package/WebDriverAgent.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +5 -0
  163. package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/IntegrationApp.xcscheme +87 -0
  164. package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/IntegrationApp_tvOS.xcscheme +78 -0
  165. package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/IntegrationApp_watchOS.xcscheme +78 -0
  166. package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/IntegrationTests_1.xcscheme +93 -0
  167. package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/IntegrationTests_2.xcscheme +93 -0
  168. package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/IntegrationTests_3.xcscheme +93 -0
  169. package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/IntegrationTests_tvOS.xcscheme +93 -0
  170. package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/IntegrationTests_watchOS.xcscheme +93 -0
  171. package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentLib.xcscheme +125 -0
  172. package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentLib_tvOS.xcscheme +95 -0
  173. package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentLib_watchOS.xcscheme +85 -0
  174. package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentRunner-nodebug.xcscheme +87 -0
  175. package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentRunner.xcscheme +132 -0
  176. package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentRunner_noauth.xcscheme +70 -0
  177. package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentRunner_tvOS.xcscheme +123 -0
  178. package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentRunner_watchOS.xcscheme +128 -0
  179. package/WebDriverAgentLib/Categories/FBXCElementSnapshotWrapper+Helpers.h +100 -0
  180. package/WebDriverAgentLib/Categories/FBXCElementSnapshotWrapper+Helpers.m +192 -0
  181. package/WebDriverAgentLib/Categories/NSDictionary+FBUtf8SafeDictionary.h +39 -0
  182. package/WebDriverAgentLib/Categories/NSDictionary+FBUtf8SafeDictionary.m +105 -0
  183. package/WebDriverAgentLib/Categories/NSExpression+FBFormat.h +29 -0
  184. package/WebDriverAgentLib/Categories/NSExpression+FBFormat.m +34 -0
  185. package/WebDriverAgentLib/Categories/NSString+FBVisualLength.h +18 -0
  186. package/WebDriverAgentLib/Categories/NSString+FBVisualLength.m +18 -0
  187. package/WebDriverAgentLib/Categories/NSString+FBXMLSafeString.h +27 -0
  188. package/WebDriverAgentLib/Categories/NSString+FBXMLSafeString.m +30 -0
  189. package/WebDriverAgentLib/Categories/XCAXClient_iOS+FBSnapshotReqParams.h +26 -0
  190. package/WebDriverAgentLib/Categories/XCAXClient_iOS+FBSnapshotReqParams.m +181 -0
  191. package/WebDriverAgentLib/Categories/XCTIssue+FBPatcher.h +17 -0
  192. package/WebDriverAgentLib/Categories/XCTIssue+FBPatcher.m +35 -0
  193. package/WebDriverAgentLib/Categories/XCUIApplication+FBAlert.h +47 -0
  194. package/WebDriverAgentLib/Categories/XCUIApplication+FBAlert.m +179 -0
  195. package/WebDriverAgentLib/Categories/XCUIApplication+FBFocused.h +23 -0
  196. package/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.h +186 -0
  197. package/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m +674 -0
  198. package/WebDriverAgentLib/Categories/XCUIApplication+FBQuiescence.h +24 -0
  199. package/WebDriverAgentLib/Categories/XCUIApplication+FBQuiescence.m +28 -0
  200. package/WebDriverAgentLib/Categories/XCUIApplication+FBTouchAction.h +82 -0
  201. package/WebDriverAgentLib/Categories/XCUIApplication+FBTouchAction.m +198 -0
  202. package/WebDriverAgentLib/Categories/XCUIApplication+FBUIInterruptions.h +22 -0
  203. package/WebDriverAgentLib/Categories/XCUIApplication+FBUIInterruptions.m +31 -0
  204. package/WebDriverAgentLib/Categories/XCUIApplicationProcess+FBQuiescence.h +27 -0
  205. package/WebDriverAgentLib/Categories/XCUIApplicationProcess+FBQuiescence.m +111 -0
  206. package/WebDriverAgentLib/Categories/XCUIDevice+FBHealthCheck.h +30 -0
  207. package/WebDriverAgentLib/Categories/XCUIDevice+FBHealthCheck.m +47 -0
  208. package/WebDriverAgentLib/Categories/XCUIDevice+FBHelpers.h +236 -0
  209. package/WebDriverAgentLib/Categories/XCUIDevice+FBHelpers.m +478 -0
  210. package/WebDriverAgentLib/Categories/XCUIDevice+FBHinge.h +41 -0
  211. package/WebDriverAgentLib/Categories/XCUIDevice+FBHinge.m +215 -0
  212. package/WebDriverAgentLib/Categories/XCUIDevice+FBRotation.h +46 -0
  213. package/WebDriverAgentLib/Categories/XCUIDevice+FBRotation.m +108 -0
  214. package/WebDriverAgentLib/Categories/XCUIDevice+FBVoiceOver.h +66 -0
  215. package/WebDriverAgentLib/Categories/XCUIDevice+FBVoiceOver.m +218 -0
  216. package/WebDriverAgentLib/Categories/XCUIElement+FBAccessibility.h +29 -0
  217. package/WebDriverAgentLib/Categories/XCUIElement+FBAccessibility.m +50 -0
  218. package/WebDriverAgentLib/Categories/XCUIElement+FBCaching.h +19 -0
  219. package/WebDriverAgentLib/Categories/XCUIElement+FBCaching.m +36 -0
  220. package/WebDriverAgentLib/Categories/XCUIElement+FBClassChain.h +57 -0
  221. package/WebDriverAgentLib/Categories/XCUIElement+FBClassChain.m +239 -0
  222. package/WebDriverAgentLib/Categories/XCUIElement+FBCustomActions.h +27 -0
  223. package/WebDriverAgentLib/Categories/XCUIElement+FBCustomActions.m +127 -0
  224. package/WebDriverAgentLib/Categories/XCUIElement+FBFind.h +75 -0
  225. package/WebDriverAgentLib/Categories/XCUIElement+FBFind.m +146 -0
  226. package/WebDriverAgentLib/Categories/XCUIElement+FBForceTouch.h +38 -0
  227. package/WebDriverAgentLib/Categories/XCUIElement+FBForceTouch.m +55 -0
  228. package/WebDriverAgentLib/Categories/XCUIElement+FBIsVisible.h +28 -0
  229. package/WebDriverAgentLib/Categories/XCUIElement+FBIsVisible.m +78 -0
  230. package/WebDriverAgentLib/Categories/XCUIElement+FBMinMax.h +33 -0
  231. package/WebDriverAgentLib/Categories/XCUIElement+FBMinMax.m +75 -0
  232. package/WebDriverAgentLib/Categories/XCUIElement+FBPickerWheel.h +45 -0
  233. package/WebDriverAgentLib/Categories/XCUIElement+FBPickerWheel.m +59 -0
  234. package/WebDriverAgentLib/Categories/XCUIElement+FBResolve.h +37 -0
  235. package/WebDriverAgentLib/Categories/XCUIElement+FBResolve.m +51 -0
  236. package/WebDriverAgentLib/Categories/XCUIElement+FBScrolling.h +98 -0
  237. package/WebDriverAgentLib/Categories/XCUIElement+FBScrolling.m +465 -0
  238. package/WebDriverAgentLib/Categories/XCUIElement+FBSwiping.h +38 -0
  239. package/WebDriverAgentLib/Categories/XCUIElement+FBSwiping.m +56 -0
  240. package/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.h +35 -0
  241. package/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m +71 -0
  242. package/WebDriverAgentLib/Categories/XCUIElement+FBTyping.h +97 -0
  243. package/WebDriverAgentLib/Categories/XCUIElement+FBTyping.m +233 -0
  244. package/WebDriverAgentLib/Categories/XCUIElement+FBUID.h +42 -0
  245. package/WebDriverAgentLib/Categories/XCUIElement+FBUID.m +85 -0
  246. package/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.h +108 -0
  247. package/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.m +175 -0
  248. package/WebDriverAgentLib/Categories/XCUIElement+FBVisibleFrame.h +35 -0
  249. package/WebDriverAgentLib/Categories/XCUIElement+FBVisibleFrame.m +61 -0
  250. package/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.h +32 -0
  251. package/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.m +299 -0
  252. package/WebDriverAgentLib/Categories/XCUIElementQuery+FBHelpers.h +28 -0
  253. package/WebDriverAgentLib/Categories/XCUIElementQuery+FBHelpers.m +47 -0
  254. package/WebDriverAgentLib/Commands/AxeAuthCommands.h +30 -0
  255. package/WebDriverAgentLib/Commands/AxeAuthCommands.m +175 -0
  256. package/WebDriverAgentLib/Commands/AxeAutoScanCommands.h +19 -0
  257. package/WebDriverAgentLib/Commands/AxeAutoScanCommands.m +143 -0
  258. package/WebDriverAgentLib/Commands/AxeProductDeclaration.h +21 -0
  259. package/WebDriverAgentLib/Commands/AxeProductDeclaration.m +40 -0
  260. package/WebDriverAgentLib/Commands/AxeReportCommands.h +20 -0
  261. package/WebDriverAgentLib/Commands/AxeReportCommands.m +62 -0
  262. package/WebDriverAgentLib/Commands/AxeScanCommands.h +20 -0
  263. package/WebDriverAgentLib/Commands/AxeScanCommands.m +386 -0
  264. package/WebDriverAgentLib/Commands/AxeUsageCommands.h +27 -0
  265. package/WebDriverAgentLib/Commands/AxeUsageCommands.m +90 -0
  266. package/WebDriverAgentLib/Commands/FBAlertViewCommands.h +19 -0
  267. package/WebDriverAgentLib/Commands/FBAlertViewCommands.m +104 -0
  268. package/WebDriverAgentLib/Commands/FBCustomCommands.h +19 -0
  269. package/WebDriverAgentLib/Commands/FBCustomCommands.m +848 -0
  270. package/WebDriverAgentLib/Commands/FBDebugCommands.h +19 -0
  271. package/WebDriverAgentLib/Commands/FBDebugCommands.m +81 -0
  272. package/WebDriverAgentLib/Commands/FBElementCommands.h +19 -0
  273. package/WebDriverAgentLib/Commands/FBElementCommands.m +775 -0
  274. package/WebDriverAgentLib/Commands/FBFindElementCommands.h +18 -0
  275. package/WebDriverAgentLib/Commands/FBFindElementCommands.m +186 -0
  276. package/WebDriverAgentLib/Commands/FBOrientationCommands.h +19 -0
  277. package/WebDriverAgentLib/Commands/FBOrientationCommands.m +192 -0
  278. package/WebDriverAgentLib/Commands/FBScreenshotCommands.h +19 -0
  279. package/WebDriverAgentLib/Commands/FBScreenshotCommands.m +40 -0
  280. package/WebDriverAgentLib/Commands/FBSessionCommands.h +19 -0
  281. package/WebDriverAgentLib/Commands/FBSessionCommands.m +519 -0
  282. package/WebDriverAgentLib/Commands/FBTouchActionCommands.h +19 -0
  283. package/WebDriverAgentLib/Commands/FBTouchActionCommands.m +41 -0
  284. package/WebDriverAgentLib/Commands/FBTouchIDCommands.h +19 -0
  285. package/WebDriverAgentLib/Commands/FBTouchIDCommands.m +30 -0
  286. package/WebDriverAgentLib/Commands/FBUnknownCommands.h +19 -0
  287. package/WebDriverAgentLib/Commands/FBUnknownCommands.m +39 -0
  288. package/WebDriverAgentLib/Commands/FBVideoCommands.h +19 -0
  289. package/WebDriverAgentLib/Commands/FBVideoCommands.m +84 -0
  290. package/WebDriverAgentLib/FBAlert.h +104 -0
  291. package/WebDriverAgentLib/FBAlert.m +454 -0
  292. package/WebDriverAgentLib/Info.plist +26 -0
  293. package/WebDriverAgentLib/Routing/FBCommandHandler.h +38 -0
  294. package/WebDriverAgentLib/Routing/FBCommandStatus.h +80 -0
  295. package/WebDriverAgentLib/Routing/FBCommandStatus.m +279 -0
  296. package/WebDriverAgentLib/Routing/FBElement.h +98 -0
  297. package/WebDriverAgentLib/Routing/FBElementCache.h +61 -0
  298. package/WebDriverAgentLib/Routing/FBElementCache.m +100 -0
  299. package/WebDriverAgentLib/Routing/FBElementUtils.h +76 -0
  300. package/WebDriverAgentLib/Routing/FBElementUtils.m +153 -0
  301. package/WebDriverAgentLib/Routing/FBExceptionHandler.h +29 -0
  302. package/WebDriverAgentLib/Routing/FBExceptionHandler.m +65 -0
  303. package/WebDriverAgentLib/Routing/FBExceptions.h +69 -0
  304. package/WebDriverAgentLib/Routing/FBExceptions.m +27 -0
  305. package/WebDriverAgentLib/Routing/FBHTTPServer.h +97 -0
  306. package/WebDriverAgentLib/Routing/FBHTTPServer.m +955 -0
  307. package/WebDriverAgentLib/Routing/FBHTTPStatusCodes.h +581 -0
  308. package/WebDriverAgentLib/Routing/FBResponseJSONPayload.h +29 -0
  309. package/WebDriverAgentLib/Routing/FBResponseJSONPayload.m +58 -0
  310. package/WebDriverAgentLib/Routing/FBResponsePayload.h +74 -0
  311. package/WebDriverAgentLib/Routing/FBResponsePayload.m +148 -0
  312. package/WebDriverAgentLib/Routing/FBRoute.h +86 -0
  313. package/WebDriverAgentLib/Routing/FBRoute.m +183 -0
  314. package/WebDriverAgentLib/Routing/FBRouteRequest-Private.h +20 -0
  315. package/WebDriverAgentLib/Routing/FBRouteRequest.h +39 -0
  316. package/WebDriverAgentLib/Routing/FBRouteRequest.m +32 -0
  317. package/WebDriverAgentLib/Routing/FBScreenRecordingContainer.h +65 -0
  318. package/WebDriverAgentLib/Routing/FBScreenRecordingContainer.m +88 -0
  319. package/WebDriverAgentLib/Routing/FBScreenRecordingPromise.h +29 -0
  320. package/WebDriverAgentLib/Routing/FBScreenRecordingPromise.m +31 -0
  321. package/WebDriverAgentLib/Routing/FBScreenRecordingRequest.h +39 -0
  322. package/WebDriverAgentLib/Routing/FBScreenRecordingRequest.m +99 -0
  323. package/WebDriverAgentLib/Routing/FBSession-Private.h +26 -0
  324. package/WebDriverAgentLib/Routing/FBSession.h +179 -0
  325. package/WebDriverAgentLib/Routing/FBSession.m +575 -0
  326. package/WebDriverAgentLib/Routing/FBTCPSocket.h +117 -0
  327. package/WebDriverAgentLib/Routing/FBTCPSocket.m +244 -0
  328. package/WebDriverAgentLib/Routing/FBWebServer.h +68 -0
  329. package/WebDriverAgentLib/Routing/FBWebServer.m +306 -0
  330. package/WebDriverAgentLib/Routing/FBXCAccessibilityElement.h +34 -0
  331. package/WebDriverAgentLib/Routing/FBXCAccessibilityElement.m +17 -0
  332. package/WebDriverAgentLib/Routing/FBXCDeviceEvent.h +34 -0
  333. package/WebDriverAgentLib/Routing/FBXCDeviceEvent.m +42 -0
  334. package/WebDriverAgentLib/Routing/FBXCElementSnapshot.h +82 -0
  335. package/WebDriverAgentLib/Routing/FBXCElementSnapshot.m +9 -0
  336. package/WebDriverAgentLib/Routing/FBXCElementSnapshotWrapper.h +29 -0
  337. package/WebDriverAgentLib/Routing/FBXCElementSnapshotWrapper.m +114 -0
  338. package/WebDriverAgentLib/Routing/RouteRequest.h +28 -0
  339. package/WebDriverAgentLib/Routing/RouteRequest.m +25 -0
  340. package/WebDriverAgentLib/Routing/RouteResponse.h +30 -0
  341. package/WebDriverAgentLib/Routing/RouteResponse.m +54 -0
  342. package/WebDriverAgentLib/Utilities/FBAccessibilityTraits.h +20 -0
  343. package/WebDriverAgentLib/Utilities/FBAccessibilityTraits.m +61 -0
  344. package/WebDriverAgentLib/Utilities/FBActiveAppDetectionPoint.h +56 -0
  345. package/WebDriverAgentLib/Utilities/FBActiveAppDetectionPoint.m +115 -0
  346. package/WebDriverAgentLib/Utilities/FBAlertsMonitor.h +51 -0
  347. package/WebDriverAgentLib/Utilities/FBAlertsMonitor.m +110 -0
  348. package/WebDriverAgentLib/Utilities/FBBaseActionsSynthesizer.h +132 -0
  349. package/WebDriverAgentLib/Utilities/FBBaseActionsSynthesizer.m +165 -0
  350. package/WebDriverAgentLib/Utilities/FBCapabilities.h +43 -0
  351. package/WebDriverAgentLib/Utilities/FBCapabilities.m +24 -0
  352. package/WebDriverAgentLib/Utilities/FBClassChainQueryParser.h +99 -0
  353. package/WebDriverAgentLib/Utilities/FBClassChainQueryParser.m +666 -0
  354. package/WebDriverAgentLib/Utilities/FBConfiguration.h +379 -0
  355. package/WebDriverAgentLib/Utilities/FBConfiguration.m +476 -0
  356. package/WebDriverAgentLib/Utilities/FBDebugLogDelegateDecorator.h +26 -0
  357. package/WebDriverAgentLib/Utilities/FBDebugLogDelegateDecorator.m +49 -0
  358. package/WebDriverAgentLib/Utilities/FBElementHelpers.h +29 -0
  359. package/WebDriverAgentLib/Utilities/FBElementHelpers.m +21 -0
  360. package/WebDriverAgentLib/Utilities/FBElementTypeTransformer.h +45 -0
  361. package/WebDriverAgentLib/Utilities/FBElementTypeTransformer.m +149 -0
  362. package/WebDriverAgentLib/Utilities/FBErrorBuilder.h +64 -0
  363. package/WebDriverAgentLib/Utilities/FBErrorBuilder.m +75 -0
  364. package/WebDriverAgentLib/Utilities/FBFailureProofTestCase.h +19 -0
  365. package/WebDriverAgentLib/Utilities/FBFailureProofTestCase.m +74 -0
  366. package/WebDriverAgentLib/Utilities/FBImageProcessor.h +55 -0
  367. package/WebDriverAgentLib/Utilities/FBImageProcessor.m +197 -0
  368. package/WebDriverAgentLib/Utilities/FBImageUtils.h +25 -0
  369. package/WebDriverAgentLib/Utilities/FBImageUtils.m +80 -0
  370. package/WebDriverAgentLib/Utilities/FBKeyboard.h +37 -0
  371. package/WebDriverAgentLib/Utilities/FBKeyboard.m +123 -0
  372. package/WebDriverAgentLib/Utilities/FBLogger.h +32 -0
  373. package/WebDriverAgentLib/Utilities/FBLogger.m +47 -0
  374. package/WebDriverAgentLib/Utilities/FBMacros.h +66 -0
  375. package/WebDriverAgentLib/Utilities/FBMathUtils.h +100 -0
  376. package/WebDriverAgentLib/Utilities/FBMathUtils.m +147 -0
  377. package/WebDriverAgentLib/Utilities/FBMjpegServer.h +36 -0
  378. package/WebDriverAgentLib/Utilities/FBMjpegServer.m +248 -0
  379. package/WebDriverAgentLib/Utilities/FBNotificationsHelper.h +37 -0
  380. package/WebDriverAgentLib/Utilities/FBNotificationsHelper.m +29 -0
  381. package/WebDriverAgentLib/Utilities/FBPasteboard.h +40 -0
  382. package/WebDriverAgentLib/Utilities/FBPasteboard.m +176 -0
  383. package/WebDriverAgentLib/Utilities/FBProtocolHelpers.h +46 -0
  384. package/WebDriverAgentLib/Utilities/FBProtocolHelpers.m +144 -0
  385. package/WebDriverAgentLib/Utilities/FBReflectionUtils.h +23 -0
  386. package/WebDriverAgentLib/Utilities/FBReflectionUtils.m +31 -0
  387. package/WebDriverAgentLib/Utilities/FBRunLoopSpinner.h +77 -0
  388. package/WebDriverAgentLib/Utilities/FBRunLoopSpinner.m +94 -0
  389. package/WebDriverAgentLib/Utilities/FBRuntimeUtils.h +79 -0
  390. package/WebDriverAgentLib/Utilities/FBRuntimeUtils.m +112 -0
  391. package/WebDriverAgentLib/Utilities/FBScreen.h +49 -0
  392. package/WebDriverAgentLib/Utilities/FBScreen.m +128 -0
  393. package/WebDriverAgentLib/Utilities/FBScreenshot.h +44 -0
  394. package/WebDriverAgentLib/Utilities/FBScreenshot.m +231 -0
  395. package/WebDriverAgentLib/Utilities/FBSettings.h +51 -0
  396. package/WebDriverAgentLib/Utilities/FBSettings.m +45 -0
  397. package/WebDriverAgentLib/Utilities/FBSettingsHandler.h +35 -0
  398. package/WebDriverAgentLib/Utilities/FBSettingsHandler.m +398 -0
  399. package/WebDriverAgentLib/Utilities/FBTVNavigationTracker-Private.h +37 -0
  400. package/WebDriverAgentLib/Utilities/FBTVNavigationTracker.h +77 -0
  401. package/WebDriverAgentLib/Utilities/FBTVNavigationTracker.m +177 -0
  402. package/WebDriverAgentLib/Utilities/FBUnattachedAppLauncher.h +26 -0
  403. package/WebDriverAgentLib/Utilities/FBUnattachedAppLauncher.m +21 -0
  404. package/WebDriverAgentLib/Utilities/FBW3CActionsHelpers.h +42 -0
  405. package/WebDriverAgentLib/Utilities/FBW3CActionsHelpers.m +119 -0
  406. package/WebDriverAgentLib/Utilities/FBW3CActionsSynthesizer.h +19 -0
  407. package/WebDriverAgentLib/Utilities/FBW3CActionsSynthesizer.m +1011 -0
  408. package/WebDriverAgentLib/Utilities/FBWebServerParams.h +22 -0
  409. package/WebDriverAgentLib/Utilities/FBWebServerParams.m +23 -0
  410. package/WebDriverAgentLib/Utilities/FBXCAXClientProxy.h +171 -0
  411. package/WebDriverAgentLib/Utilities/FBXCAXClientProxy.m +240 -0
  412. package/WebDriverAgentLib/Utilities/FBXCTestDaemonsProxy.h +45 -0
  413. package/WebDriverAgentLib/Utilities/FBXCTestDaemonsProxy.m +362 -0
  414. package/WebDriverAgentLib/Utilities/FBXCodeCompatibility.h +73 -0
  415. package/WebDriverAgentLib/Utilities/FBXCodeCompatibility.m +129 -0
  416. package/WebDriverAgentLib/Utilities/FBXMLGenerationOptions.h +45 -0
  417. package/WebDriverAgentLib/Utilities/FBXMLGenerationOptions.m +25 -0
  418. package/WebDriverAgentLib/Utilities/FBXPath-Private.h +61 -0
  419. package/WebDriverAgentLib/Utilities/FBXPath.h +59 -0
  420. package/WebDriverAgentLib/Utilities/FBXPath.m +1087 -0
  421. package/WebDriverAgentLib/Utilities/FBXPathExtensions.h +40 -0
  422. package/WebDriverAgentLib/Utilities/FBXPathExtensions.m +418 -0
  423. package/WebDriverAgentLib/Utilities/LRUCache/LRUCache.h +66 -0
  424. package/WebDriverAgentLib/Utilities/LRUCache/LRUCache.m +149 -0
  425. package/WebDriverAgentLib/Utilities/LRUCache/LRUCacheNode.h +43 -0
  426. package/WebDriverAgentLib/Utilities/LRUCache/LRUCacheNode.m +51 -0
  427. package/WebDriverAgentLib/Utilities/NSPredicate+FBFormat.h +42 -0
  428. package/WebDriverAgentLib/Utilities/NSPredicate+FBFormat.m +69 -0
  429. package/WebDriverAgentLib/Utilities/XCTestPrivateSymbols.h +78 -0
  430. package/WebDriverAgentLib/Utilities/XCTestPrivateSymbols.m +127 -0
  431. package/WebDriverAgentLib/Utilities/XCUIApplicationProcessDelay.h +37 -0
  432. package/WebDriverAgentLib/Utilities/XCUIApplicationProcessDelay.m +83 -0
  433. package/WebDriverAgentLib/WebDriverAgentLib.h +61 -0
  434. package/WebDriverAgentRunner/Assets.xcassets/AppIcon.appiconset/Contents.json +14 -0
  435. package/WebDriverAgentRunner/Assets.xcassets/AppIcon.appiconset/icon-1024.png +0 -0
  436. package/WebDriverAgentRunner/Assets.xcassets/Contents.json +6 -0
  437. package/WebDriverAgentRunner/Info.plist +30 -0
  438. package/WebDriverAgentRunner/UITestingUITests.m +58 -0
  439. package/WebDriverAgentTests/IntegrationApp/COORDINATE_PROBE.md +52 -0
  440. package/WebDriverAgentTests/IntegrationApp/Classes/AppDelegate.h +14 -0
  441. package/WebDriverAgentTests/IntegrationApp/Classes/AppDelegate.m +38 -0
  442. package/WebDriverAgentTests/IntegrationApp/Classes/FBAlertViewController.h +14 -0
  443. package/WebDriverAgentTests/IntegrationApp/Classes/FBAlertViewController.m +82 -0
  444. package/WebDriverAgentTests/IntegrationApp/Classes/FBCoordinateProbeViewController.h +4 -0
  445. package/WebDriverAgentTests/IntegrationApp/Classes/FBCoordinateProbeViewController.m +194 -0
  446. package/WebDriverAgentTests/IntegrationApp/Classes/FBNavigationController.h +12 -0
  447. package/WebDriverAgentTests/IntegrationApp/Classes/FBNavigationController.m +25 -0
  448. package/WebDriverAgentTests/IntegrationApp/Classes/FBScrollViewController.h +13 -0
  449. package/WebDriverAgentTests/IntegrationApp/Classes/FBScrollViewController.m +52 -0
  450. package/WebDriverAgentTests/IntegrationApp/Classes/FBTableDataSource.h +16 -0
  451. package/WebDriverAgentTests/IntegrationApp/Classes/FBTableDataSource.m +35 -0
  452. package/WebDriverAgentTests/IntegrationApp/Classes/SceneDelegate.h +20 -0
  453. package/WebDriverAgentTests/IntegrationApp/Classes/SceneDelegate.m +81 -0
  454. package/WebDriverAgentTests/IntegrationApp/Classes/TouchSpotView.h +17 -0
  455. package/WebDriverAgentTests/IntegrationApp/Classes/TouchSpotView.m +28 -0
  456. package/WebDriverAgentTests/IntegrationApp/Classes/TouchViewController.h +23 -0
  457. package/WebDriverAgentTests/IntegrationApp/Classes/TouchViewController.m +29 -0
  458. package/WebDriverAgentTests/IntegrationApp/Classes/TouchableView.h +30 -0
  459. package/WebDriverAgentTests/IntegrationApp/Classes/TouchableView.m +119 -0
  460. package/WebDriverAgentTests/IntegrationApp/Classes/ViewController.h +12 -0
  461. package/WebDriverAgentTests/IntegrationApp/Classes/ViewController.m +144 -0
  462. package/WebDriverAgentTests/IntegrationApp/Info.plist +71 -0
  463. package/WebDriverAgentTests/IntegrationApp/Resources/Base.lproj/Main.storyboard +650 -0
  464. package/WebDriverAgentTests/IntegrationApp/main.m +15 -0
  465. package/WebDriverAgentTests/IntegrationApp_tvOS/AppDelegate.h +13 -0
  466. package/WebDriverAgentTests/IntegrationApp_tvOS/AppDelegate.m +26 -0
  467. package/WebDriverAgentTests/IntegrationApp_tvOS/Info.plist +41 -0
  468. package/WebDriverAgentTests/IntegrationApp_tvOS/SceneDelegate.h +15 -0
  469. package/WebDriverAgentTests/IntegrationApp_tvOS/SceneDelegate.m +22 -0
  470. package/WebDriverAgentTests/IntegrationApp_tvOS/ViewController.h +13 -0
  471. package/WebDriverAgentTests/IntegrationApp_tvOS/ViewController.m +79 -0
  472. package/WebDriverAgentTests/IntegrationApp_tvOS/main.m +17 -0
  473. package/WebDriverAgentTests/IntegrationApp_watchOS/ContentView.swift +31 -0
  474. package/WebDriverAgentTests/IntegrationApp_watchOS/WatchSpikeApp.swift +18 -0
  475. package/WebDriverAgentTests/IntegrationTests/FBAlertTests.m +175 -0
  476. package/WebDriverAgentTests/IntegrationTests/FBAutoAlertsHandlerTests.m +79 -0
  477. package/WebDriverAgentTests/IntegrationTests/FBConfigurationTests.m +123 -0
  478. package/WebDriverAgentTests/IntegrationTests/FBDisplayGestureTests.m +541 -0
  479. package/WebDriverAgentTests/IntegrationTests/FBElementAttributeTests.m +273 -0
  480. package/WebDriverAgentTests/IntegrationTests/FBElementSwipingTests.m +222 -0
  481. package/WebDriverAgentTests/IntegrationTests/FBElementVisibilityTests.m +68 -0
  482. package/WebDriverAgentTests/IntegrationTests/FBFailureProofTestCaseTests.m +41 -0
  483. package/WebDriverAgentTests/IntegrationTests/FBForceTouchTests.m +88 -0
  484. package/WebDriverAgentTests/IntegrationTests/FBImageProcessorTests.m +116 -0
  485. package/WebDriverAgentTests/IntegrationTests/FBIntegrationAppTests.m +87 -0
  486. package/WebDriverAgentTests/IntegrationTests/FBIntegrationTestCase.h +101 -0
  487. package/WebDriverAgentTests/IntegrationTests/FBIntegrationTestCase.m +176 -0
  488. package/WebDriverAgentTests/IntegrationTests/FBKeyboardTests.m +61 -0
  489. package/WebDriverAgentTests/IntegrationTests/FBPasteboardTests.m +92 -0
  490. package/WebDriverAgentTests/IntegrationTests/FBPickerWheelSelectTests.m +55 -0
  491. package/WebDriverAgentTests/IntegrationTests/FBSafariAlertTests.m +77 -0
  492. package/WebDriverAgentTests/IntegrationTests/FBScreenTests.m +450 -0
  493. package/WebDriverAgentTests/IntegrationTests/FBScrollingTests.m +123 -0
  494. package/WebDriverAgentTests/IntegrationTests/FBSessionIntegrationTests.m +228 -0
  495. package/WebDriverAgentTests/IntegrationTests/FBTapTest.m +186 -0
  496. package/WebDriverAgentTests/IntegrationTests/FBTestMacros.h +33 -0
  497. package/WebDriverAgentTests/IntegrationTests/FBTypingTest.m +68 -0
  498. package/WebDriverAgentTests/IntegrationTests/FBVideoRecordingTests.m +63 -0
  499. package/WebDriverAgentTests/IntegrationTests/FBVoiceOverTests.m +103 -0
  500. package/WebDriverAgentTests/IntegrationTests/FBW3CMultiTouchActionsIntegrationTests.m +159 -0
  501. package/WebDriverAgentTests/IntegrationTests/FBW3CTouchActionsIntegrationTests.m +700 -0
  502. package/WebDriverAgentTests/IntegrationTests/FBW3CTypeActionsTests.m +184 -0
  503. package/WebDriverAgentTests/IntegrationTests/FBXPathIntegrationTests.m +260 -0
  504. package/WebDriverAgentTests/IntegrationTests/Info.plist +24 -0
  505. package/WebDriverAgentTests/IntegrationTests/XCElementSnapshotHelperTests.m +205 -0
  506. package/WebDriverAgentTests/IntegrationTests/XCElementSnapshotHitPointTests.m +30 -0
  507. package/WebDriverAgentTests/IntegrationTests/XCUIApplicationHelperTests.m +162 -0
  508. package/WebDriverAgentTests/IntegrationTests/XCUIDeviceHealthCheckTests.m +27 -0
  509. package/WebDriverAgentTests/IntegrationTests/XCUIDeviceHelperTests.m +236 -0
  510. package/WebDriverAgentTests/IntegrationTests/XCUIDeviceRotationTests.m +105 -0
  511. package/WebDriverAgentTests/IntegrationTests/XCUIElementAttributesTests.m +248 -0
  512. package/WebDriverAgentTests/IntegrationTests/XCUIElementFBFindTests.m +673 -0
  513. package/WebDriverAgentTests/IntegrationTests/XCUIElementHelperIntegrationTests.m +51 -0
  514. package/WebDriverAgentTests/IntegrationTests_tvOS/FBTVFocusIntegrationTests.m +84 -0
  515. package/WebDriverAgentTests/IntegrationTests_tvOS/Info.plist +24 -0
  516. package/WebDriverAgentTests/IntegrationTests_watchOS/IntegrationTests_watchOS-Bridging-Header.h +23 -0
  517. package/WebDriverAgentTests/IntegrationTests_watchOS/WDAAlertIntegrationTests.swift +25 -0
  518. package/WebDriverAgentTests/IntegrationTests_watchOS/WDAAppLifecycleIntegrationTests.swift +37 -0
  519. package/WebDriverAgentTests/IntegrationTests_watchOS/WDAClickIntegrationTests.swift +25 -0
  520. package/WebDriverAgentTests/IntegrationTests_watchOS/WDADeviceIntegrationTests.swift +92 -0
  521. package/WebDriverAgentTests/IntegrationTests_watchOS/WDAElementAttributeIntegrationTests.swift +39 -0
  522. package/WebDriverAgentTests/IntegrationTests_watchOS/WDAFindIntegrationTests.swift +101 -0
  523. package/WebDriverAgentTests/IntegrationTests_watchOS/WDAMjpegStreamingIntegrationTests.swift +81 -0
  524. package/WebDriverAgentTests/IntegrationTests_watchOS/WDAScreenshotAndSourceIntegrationTests.swift +54 -0
  525. package/WebDriverAgentTests/IntegrationTests_watchOS/WDATypingIntegrationTests.swift +73 -0
  526. package/WebDriverAgentTests/IntegrationTests_watchOS/WDAWatchInProcessTestCase.swift +51 -0
  527. package/WebDriverAgentTests/UnitTests/Doubles/XCElementSnapshotDouble.h +16 -0
  528. package/WebDriverAgentTests/UnitTests/Doubles/XCElementSnapshotDouble.m +110 -0
  529. package/WebDriverAgentTests/UnitTests/Doubles/XCUIApplicationDouble.h +17 -0
  530. package/WebDriverAgentTests/UnitTests/Doubles/XCUIApplicationDouble.m +66 -0
  531. package/WebDriverAgentTests/UnitTests/Doubles/XCUIElementDouble.h +55 -0
  532. package/WebDriverAgentTests/UnitTests/Doubles/XCUIElementDouble.m +114 -0
  533. package/WebDriverAgentTests/UnitTests/FBClassChainTests.m +313 -0
  534. package/WebDriverAgentTests/UnitTests/FBConfigurationTests.m +72 -0
  535. package/WebDriverAgentTests/UnitTests/FBCustomCommandsTests.m +144 -0
  536. package/WebDriverAgentTests/UnitTests/FBElementCacheTests.m +124 -0
  537. package/WebDriverAgentTests/UnitTests/FBElementTypeTransformerTests.m +45 -0
  538. package/WebDriverAgentTests/UnitTests/FBElementUtilitiesTests.m +76 -0
  539. package/WebDriverAgentTests/UnitTests/FBErrorBuilderTests.m +61 -0
  540. package/WebDriverAgentTests/UnitTests/FBExceptionHandlerTests.m +59 -0
  541. package/WebDriverAgentTests/UnitTests/FBHTTPServerSessionTests.m +151 -0
  542. package/WebDriverAgentTests/UnitTests/FBHTTPServerTests.m +458 -0
  543. package/WebDriverAgentTests/UnitTests/FBLRUCacheTests.m +161 -0
  544. package/WebDriverAgentTests/UnitTests/FBMathUtilsTests.m +196 -0
  545. package/WebDriverAgentTests/UnitTests/FBProtocolHelpersTests.m +81 -0
  546. package/WebDriverAgentTests/UnitTests/FBResponseJSONPayloadTests.m +76 -0
  547. package/WebDriverAgentTests/UnitTests/FBRouteTests.m +129 -0
  548. package/WebDriverAgentTests/UnitTests/FBRunLoopSpinnerTests.m +98 -0
  549. package/WebDriverAgentTests/UnitTests/FBRuntimeUtilsTests.m +45 -0
  550. package/WebDriverAgentTests/UnitTests/FBSDKVersionTests.m +66 -0
  551. package/WebDriverAgentTests/UnitTests/FBSessionTests.m +268 -0
  552. package/WebDriverAgentTests/UnitTests/FBTouchableViewTests.m +121 -0
  553. package/WebDriverAgentTests/UnitTests/FBXCAXClientProxyTests.m +90 -0
  554. package/WebDriverAgentTests/UnitTests/FBXMLSafeStringTests.m +35 -0
  555. package/WebDriverAgentTests/UnitTests/FBXPathTests.m +381 -0
  556. package/WebDriverAgentTests/UnitTests/Info.plist +24 -0
  557. package/WebDriverAgentTests/UnitTests/NSDictionaryFBUtf8SafeTests.m +77 -0
  558. package/WebDriverAgentTests/UnitTests/NSExpressionFBFormatTests.m +60 -0
  559. package/WebDriverAgentTests/UnitTests/NSPredicateFBFormatTests.m +72 -0
  560. package/WebDriverAgentTests/UnitTests/XCUIElementHelpersTests.m +50 -0
  561. package/WebDriverAgentTests/UnitTests_tvOS/Doubles/FBXCAccessibilityElementDouble.h +27 -0
  562. package/WebDriverAgentTests/UnitTests_tvOS/Doubles/FBXCAccessibilityElementDouble.m +23 -0
  563. package/WebDriverAgentTests/UnitTests_tvOS/Doubles/FBXCElementSnapshotDouble.h +43 -0
  564. package/WebDriverAgentTests/UnitTests_tvOS/Doubles/FBXCElementSnapshotDouble.m +24 -0
  565. package/WebDriverAgentTests/UnitTests_tvOS/Doubles/XCUIElementDouble.h +47 -0
  566. package/WebDriverAgentTests/UnitTests_tvOS/Doubles/XCUIElementDouble.m +81 -0
  567. package/WebDriverAgentTests/UnitTests_tvOS/FBTVNavigationTrackerTests.m +134 -0
  568. package/WebDriverAgentTests/UnitTests_tvOS/Info.plist +24 -0
  569. package/axeDevToolsXCUI.xcframework/Info.plist +50 -0
  570. package/axeDevToolsXCUI.xcframework/LICENSE-3RD-PARTY-axe-devtools-ios.md +29 -0
  571. package/axeDevToolsXCUI.xcframework/axe-devtools-ios-4.3.1.cdx.json +75 -0
  572. package/axeDevToolsXCUI.xcframework/axe-devtools-ios-4.3.1.spdx.json +67 -0
  573. package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/HTMLReportTemplate.html +1912 -0
  574. package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Headers/AxeTestBundleObserver.h +55 -0
  575. package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Headers/axeDevToolsXCUI-Swift.h +1546 -0
  576. package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Headers/axeDevToolsXCUI.h +17 -0
  577. package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Info.plist +57 -0
  578. package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/LICENSE.md +7 -0
  579. package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios.abi.json +34308 -0
  580. package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios.private.swiftinterface +927 -0
  581. package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  582. package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios.swiftinterface +927 -0
  583. package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Modules/module.modulemap +10 -0
  584. package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/axeDevToolsXCUI +0 -0
  585. package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/HTMLReportTemplate.html +1912 -0
  586. package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Headers/AxeTestBundleObserver.h +55 -0
  587. package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Headers/axeDevToolsXCUI-Swift.h +3088 -0
  588. package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Headers/axeDevToolsXCUI.h +17 -0
  589. package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Info.plist +53 -0
  590. package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/LICENSE.md +7 -0
  591. package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios-simulator.abi.json +34308 -0
  592. package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +927 -0
  593. package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  594. package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +927 -0
  595. package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/x86_64-apple-ios-simulator.abi.json +34308 -0
  596. package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +927 -0
  597. package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  598. package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +927 -0
  599. package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/module.modulemap +10 -0
  600. package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/_CodeSignature/CodeResources +278 -0
  601. package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/axeDevToolsXCUI +0 -0
  602. package/build/lib/check-dependencies.d.ts +6 -0
  603. package/build/lib/check-dependencies.d.ts.map +1 -0
  604. package/build/lib/check-dependencies.js +50 -0
  605. package/build/lib/check-dependencies.js.map +1 -0
  606. package/build/lib/constants.d.ts +25 -0
  607. package/build/lib/constants.d.ts.map +1 -0
  608. package/build/lib/constants.js +28 -0
  609. package/build/lib/constants.js.map +1 -0
  610. package/build/lib/index.d.ts +7 -0
  611. package/build/lib/index.d.ts.map +1 -0
  612. package/build/lib/index.js +7 -0
  613. package/build/lib/index.js.map +1 -0
  614. package/build/lib/logger.d.ts +2 -0
  615. package/build/lib/logger.d.ts.map +1 -0
  616. package/build/lib/logger.js +3 -0
  617. package/build/lib/logger.js.map +1 -0
  618. package/build/lib/no-session-proxy.d.ts +7 -0
  619. package/build/lib/no-session-proxy.d.ts.map +1 -0
  620. package/build/lib/no-session-proxy.js +17 -0
  621. package/build/lib/no-session-proxy.js.map +1 -0
  622. package/build/lib/types.d.ts +206 -0
  623. package/build/lib/types.d.ts.map +1 -0
  624. package/build/lib/types.js +2 -0
  625. package/build/lib/types.js.map +1 -0
  626. package/build/lib/utils/index.d.ts +11 -0
  627. package/build/lib/utils/index.d.ts.map +1 -0
  628. package/build/lib/utils/index.js +13 -0
  629. package/build/lib/utils/index.js.map +1 -0
  630. package/build/lib/utils/module.d.ts +25 -0
  631. package/build/lib/utils/module.d.ts.map +1 -0
  632. package/build/lib/utils/module.js +47 -0
  633. package/build/lib/utils/module.js.map +1 -0
  634. package/build/lib/utils/platform.d.ts +19 -0
  635. package/build/lib/utils/platform.d.ts.map +1 -0
  636. package/build/lib/utils/platform.js +32 -0
  637. package/build/lib/utils/platform.js.map +1 -0
  638. package/build/lib/utils/processes.d.ts +34 -0
  639. package/build/lib/utils/processes.d.ts.map +1 -0
  640. package/build/lib/utils/processes.js +151 -0
  641. package/build/lib/utils/processes.js.map +1 -0
  642. package/build/lib/utils/security.d.ts +5 -0
  643. package/build/lib/utils/security.d.ts.map +1 -0
  644. package/build/lib/utils/security.js +12 -0
  645. package/build/lib/utils/security.js.map +1 -0
  646. package/build/lib/utils/xctestrun.d.ts +51 -0
  647. package/build/lib/utils/xctestrun.d.ts.map +1 -0
  648. package/build/lib/utils/xctestrun.js +135 -0
  649. package/build/lib/utils/xctestrun.js.map +1 -0
  650. package/build/lib/wda-strategies.d.ts +69 -0
  651. package/build/lib/wda-strategies.d.ts.map +1 -0
  652. package/build/lib/wda-strategies.js +247 -0
  653. package/build/lib/wda-strategies.js.map +1 -0
  654. package/build/lib/webdriveragent.d.ts +175 -0
  655. package/build/lib/webdriveragent.d.ts.map +1 -0
  656. package/build/lib/webdriveragent.js +540 -0
  657. package/build/lib/webdriveragent.js.map +1 -0
  658. package/build/lib/xcodebuild.d.ts +98 -0
  659. package/build/lib/xcodebuild.d.ts.map +1 -0
  660. package/build/lib/xcodebuild.js +562 -0
  661. package/build/lib/xcodebuild.js.map +1 -0
  662. package/build/tsconfig.tsbuildinfo +1 -0
  663. package/lib/check-dependencies.ts +64 -0
  664. package/lib/constants.ts +33 -0
  665. package/lib/index.ts +7 -0
  666. package/lib/logger.ts +3 -0
  667. package/lib/no-session-proxy.ts +19 -0
  668. package/lib/types.ts +238 -0
  669. package/lib/utils/index.ts +20 -0
  670. package/lib/utils/module.ts +66 -0
  671. package/lib/utils/platform.ts +34 -0
  672. package/lib/utils/processes.ts +174 -0
  673. package/lib/utils/security.ts +16 -0
  674. package/lib/utils/xctestrun.ts +188 -0
  675. package/lib/wda-strategies.ts +343 -0
  676. package/lib/webdriveragent.ts +642 -0
  677. package/lib/xcodebuild.ts +678 -0
  678. package/package.json +114 -3
@@ -0,0 +1,848 @@
1
+ /**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
9
+ #import "FBCustomCommands.h"
10
+
11
+ #if TARGET_OS_WATCH
12
+ @import WatchKit;
13
+ #endif
14
+ #import <XCTest/XCUIDevice.h>
15
+ #import <CoreLocation/CoreLocation.h>
16
+
17
+ #import "FBConfiguration.h"
18
+ #import "FBKeyboard.h"
19
+ #import "FBNotificationsHelper.h"
20
+ #import "FBMathUtils.h"
21
+ #import "FBPasteboard.h"
22
+ #import "FBResponsePayload.h"
23
+ #import "FBRoute.h"
24
+ #import "FBRouteRequest.h"
25
+ #import "FBRunLoopSpinner.h"
26
+ #import "FBScreen.h"
27
+ #import "FBSession.h"
28
+ #import "FBXCodeCompatibility.h"
29
+ #import "XCUIApplication.h"
30
+ #import "XCUIApplication+FBHelpers.h"
31
+ #import "XCUIDevice+FBHelpers.h"
32
+ #import "XCUIDevice+FBHinge.h"
33
+ #import "XCUIDevice+FBVoiceOver.h"
34
+ #import "XCUIElement.h"
35
+ #import "XCUIElement+FBIsVisible.h"
36
+ #import "XCUIElementQuery.h"
37
+ #import "XCUIScreen.h"
38
+ #import "FBUnattachedAppLauncher.h"
39
+
40
+ @implementation FBCustomCommands
41
+
42
+ + (NSArray *)routes
43
+ {
44
+ return
45
+ @[
46
+ [[FBRoute POST:@"/timeouts"] respondWithTarget:self action:@selector(handleTimeouts:)],
47
+ [[FBRoute POST:@"/wda/homescreen"].withoutSession respondWithTarget:self action:@selector(handleHomescreenCommand:)],
48
+ [[FBRoute POST:@"/wda/deactivateApp"] respondWithTarget:self action:@selector(handleDeactivateAppCommand:)],
49
+ [[FBRoute POST:@"/wda/keyboard/dismiss"] respondWithTarget:self action:@selector(handleDismissKeyboardCommand:)],
50
+ [[FBRoute POST:@"/wda/lock"].withoutSession respondWithTarget:self action:@selector(handleLock:)],
51
+ [[FBRoute POST:@"/wda/lock"] respondWithTarget:self action:@selector(handleLock:)],
52
+ [[FBRoute POST:@"/wda/unlock"].withoutSession respondWithTarget:self action:@selector(handleUnlock:)],
53
+ [[FBRoute POST:@"/wda/unlock"] respondWithTarget:self action:@selector(handleUnlock:)],
54
+ [[FBRoute GET:@"/wda/locked"].withoutSession respondWithTarget:self action:@selector(handleIsLocked:)],
55
+ [[FBRoute GET:@"/wda/locked"] respondWithTarget:self action:@selector(handleIsLocked:)],
56
+ [[FBRoute GET:@"/wda/screen"] respondWithTarget:self action:@selector(handleGetScreen:)],
57
+ [[FBRoute GET:@"/wda/screen"].withoutSession respondWithTarget:self action:@selector(handleGetScreen:)],
58
+ [[FBRoute GET:@"/wda/screens"].standalone respondWithTarget:self action:@selector(handleGetScreens:)],
59
+ [[FBRoute GET:@"/wda/screens"].withoutSession.standalone respondWithTarget:self action:@selector(handleGetScreens:)],
60
+ [[FBRoute GET:@"/wda/activeAppInfo"] respondWithTarget:self action:@selector(handleActiveAppInfo:)],
61
+ [[FBRoute GET:@"/wda/activeAppInfo"].withoutSession respondWithTarget:self action:@selector(handleActiveAppInfo:)],
62
+ #if !TARGET_OS_TV && !TARGET_OS_WATCH // tvOS/watchOS do not provide relevant APIs
63
+ [[FBRoute POST:@"/wda/setPasteboard"] respondWithTarget:self action:@selector(handleSetPasteboard:)],
64
+ [[FBRoute POST:@"/wda/setPasteboard"].withoutSession respondWithTarget:self action:@selector(handleSetPasteboard:)],
65
+ [[FBRoute POST:@"/wda/getPasteboard"] respondWithTarget:self action:@selector(handleGetPasteboard:)],
66
+ [[FBRoute POST:@"/wda/getPasteboard"].withoutSession respondWithTarget:self action:@selector(handleGetPasteboard:)],
67
+ [[FBRoute GET:@"/wda/batteryInfo"] respondWithTarget:self action:@selector(handleGetBatteryInfo:)],
68
+ #endif
69
+ [[FBRoute POST:@"/wda/pressButton"] respondWithTarget:self action:@selector(handlePressButtonCommand:)],
70
+ #if TARGET_OS_WATCH
71
+ [[FBRoute POST:@"/wda/rotateDigitalCrown"] respondWithTarget:self action:@selector(handleRotateDigitalCrownCommand:)],
72
+ [[FBRoute POST:@"/wda/performHandGesture"] respondWithTarget:self action:@selector(handlePerformHandGestureCommand:)],
73
+ #endif
74
+ [[FBRoute POST:@"/wda/performAccessibilityAudit"] respondWithTarget:self action:@selector(handlePerformAccessibilityAudit:)],
75
+ [[FBRoute POST:@"/wda/performIoHidEvent"] respondWithTarget:self action:@selector(handlePeformIOHIDEvent:)],
76
+ [[FBRoute POST:@"/wda/expectNotification"] respondWithTarget:self action:@selector(handleExpectNotification:)],
77
+ [[FBRoute POST:@"/wda/siri/activate"] respondWithTarget:self action:@selector(handleActivateSiri:)],
78
+ [[FBRoute POST:@"/wda/apps/launchUnattached"].withoutSession respondWithTarget:self action:@selector(handleLaunchUnattachedApp:)],
79
+ [[FBRoute GET:@"/wda/device/hingeAngle"] respondWithTarget:self action:@selector(handleGetSimulatedHingeAngle:)],
80
+ [[FBRoute GET:@"/wda/device/hingeAngle"].withoutSession respondWithTarget:self action:@selector(handleGetSimulatedHingeAngle:)],
81
+ [[FBRoute POST:@"/wda/device/hingeAngle"] respondWithTarget:self action:@selector(handleSetSimulatedHingeAngle:)],
82
+ [[FBRoute POST:@"/wda/device/hingeAngle"].withoutSession respondWithTarget:self action:@selector(handleSetSimulatedHingeAngle:)],
83
+ [[FBRoute GET:@"/wda/device/info"] respondWithTarget:self action:@selector(handleGetDeviceInfo:)],
84
+ [[FBRoute POST:@"/wda/resetAppAuth"] respondWithTarget:self action:@selector(handleResetAppAuth:)],
85
+ [[FBRoute GET:@"/wda/device/info"].withoutSession respondWithTarget:self action:@selector(handleGetDeviceInfo:)],
86
+ [[FBRoute POST:@"/wda/device/appearance"].withoutSession respondWithTarget:self action:@selector(handleSetDeviceAppearance:)],
87
+ [[FBRoute GET:@"/wda/device/location"] respondWithTarget:self action:@selector(handleGetLocation:)],
88
+ [[FBRoute GET:@"/wda/device/location"].withoutSession respondWithTarget:self action:@selector(handleGetLocation:)],
89
+ #if !TARGET_OS_TV // tvOS does not provide relevant APIs
90
+ #if !TARGET_OS_WATCH
91
+ #if __clang_major__ >= 15
92
+ [[FBRoute POST:@"/wda/element/:uuid/keyboardInput"] respondWithTarget:self action:@selector(handleKeyboardInput:)],
93
+ #endif
94
+ #endif
95
+ [[FBRoute GET:@"/wda/simulatedLocation"] respondWithTarget:self action:@selector(handleGetSimulatedLocation:)],
96
+ [[FBRoute GET:@"/wda/simulatedLocation"].withoutSession respondWithTarget:self action:@selector(handleGetSimulatedLocation:)],
97
+ [[FBRoute POST:@"/wda/simulatedLocation"] respondWithTarget:self action:@selector(handleSetSimulatedLocation:)],
98
+ [[FBRoute POST:@"/wda/simulatedLocation"].withoutSession respondWithTarget:self action:@selector(handleSetSimulatedLocation:)],
99
+ [[FBRoute DELETE:@"/wda/simulatedLocation"] respondWithTarget:self action:@selector(handleClearSimulatedLocation:)],
100
+ [[FBRoute DELETE:@"/wda/simulatedLocation"].withoutSession respondWithTarget:self action:@selector(handleClearSimulatedLocation:)],
101
+ #endif
102
+ [[FBRoute POST:@"/wda/voiceOver/enable"] respondWithTarget:self action:@selector(handleVoiceOverEnable:)],
103
+ [[FBRoute POST:@"/wda/voiceOver/enable"].withoutSession respondWithTarget:self action:@selector(handleVoiceOverEnable:)],
104
+ [[FBRoute POST:@"/wda/voiceOver/disable"] respondWithTarget:self action:@selector(handleVoiceOverDisable:)],
105
+ [[FBRoute POST:@"/wda/voiceOver/disable"].withoutSession respondWithTarget:self action:@selector(handleVoiceOverDisable:)],
106
+ [[FBRoute GET:@"/wda/voiceOver/enabled"] respondWithTarget:self action:@selector(handleVoiceOverEnabled:)],
107
+ [[FBRoute GET:@"/wda/voiceOver/enabled"].withoutSession respondWithTarget:self action:@selector(handleVoiceOverEnabled:)],
108
+ [[FBRoute POST:@"/wda/voiceOver/move"] respondWithTarget:self action:@selector(handleVoiceOverMove:)],
109
+ [[FBRoute POST:@"/wda/voiceOver/move"].withoutSession respondWithTarget:self action:@selector(handleVoiceOverMove:)],
110
+ [[FBRoute GET:@"/wda/voiceOver/currentSpeech"] respondWithTarget:self action:@selector(handleVoiceOverCurrentSpeech:)],
111
+ [[FBRoute GET:@"/wda/voiceOver/currentSpeech"].withoutSession respondWithTarget:self action:@selector(handleVoiceOverCurrentSpeech:)],
112
+ [[FBRoute OPTIONS:@"/*"].withoutSession respondWithTarget:self action:@selector(handlePingCommand:)],
113
+ ];
114
+ }
115
+
116
+
117
+ #pragma mark - Commands
118
+
119
+ + (id<FBResponsePayload>)handleHomescreenCommand:(FBRouteRequest *)request
120
+ {
121
+ NSError *error;
122
+ if (![[XCUIDevice sharedDevice] fb_goToHomescreenWithError:&error]) {
123
+ return FBResponseWithStatus([FBCommandStatus unknownErrorWithMessage:error.description
124
+ traceback:nil]);
125
+ }
126
+ return FBResponseWithOK();
127
+ }
128
+
129
+ + (id<FBResponsePayload>)handleDeactivateAppCommand:(FBRouteRequest *)request
130
+ {
131
+ NSNumber *requestedDuration = request.arguments[@"duration"];
132
+ NSTimeInterval duration = (requestedDuration ? requestedDuration.doubleValue : 3.);
133
+ NSError *error;
134
+ if (![request.session.activeApplication fb_deactivateWithDuration:duration error:&error]) {
135
+ return FBResponseWithUnknownError(error);
136
+ }
137
+ return FBResponseWithOK();
138
+ }
139
+
140
+ + (id<FBResponsePayload>)handleTimeouts:(FBRouteRequest *)request
141
+ {
142
+ // This method is intentionally not supported.
143
+ return FBResponseWithOK();
144
+ }
145
+
146
+ + (id<FBResponsePayload>)handleDismissKeyboardCommand:(FBRouteRequest *)request
147
+ {
148
+ NSError *error;
149
+ BOOL isDismissed = [request.session.activeApplication fb_dismissKeyboardWithKeyNames:request.arguments[@"keyNames"]
150
+ error:&error];
151
+ return isDismissed
152
+ ? FBResponseWithOK()
153
+ : FBResponseWithStatus([FBCommandStatus invalidElementStateErrorWithMessage:error.description
154
+ traceback:nil]);
155
+ }
156
+
157
+ + (id<FBResponsePayload>)handlePingCommand:(FBRouteRequest *)request
158
+ {
159
+ return FBResponseWithOK();
160
+ }
161
+
162
+ #pragma mark - Helpers
163
+
164
+ + (id<FBResponsePayload>)handleGetScreen:(FBRouteRequest *)request
165
+ {
166
+ NSError *error = nil;
167
+ XCUIScreen *screen = [FBScreen currentScreenWithError:&error];
168
+ if (nil == screen) {
169
+ return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:error.localizedDescription
170
+ traceback:nil]);
171
+ }
172
+ XCUIApplication *app = XCUIApplication.fb_systemApplication;
173
+ CGSize screenSize = CGSizeMake(CGRectGetWidth(screen.bounds) / screen.scale,
174
+ CGRectGetHeight(screen.bounds) / screen.scale);
175
+ #if !TARGET_OS_TV && !TARGET_OS_WATCH
176
+ XCUIApplication *activeApp = request.session ? request.session.activeApplication : XCUIApplication.fb_activeApplication;
177
+ UIInterfaceOrientation orientation = activeApp.interfaceOrientation;
178
+ // Screen bounds describe the panel's native orientation. Some physical iPads
179
+ // expose landscape-native bounds even while the application is in portrait.
180
+ // Normalize the full screen separately from compatibility-mode app frames.
181
+ if (UIInterfaceOrientationIsPortrait(orientation) && screenSize.width > screenSize.height) {
182
+ screenSize = CGSizeMake(screenSize.height, screenSize.width);
183
+ }
184
+ screenSize = FBAdjustDimensionsForApplication(screenSize, orientation);
185
+ #endif
186
+
187
+ // SpringBoard can expose hidden status bars belonging to other displays, and
188
+ // Duo also exposes full-screen containers for its side-mounted status UI.
189
+ // Only a visible horizontal bar at the top of this display can be subtracted
190
+ // from a rectangular viewport.
191
+ CGSize statusBarSize = CGSizeZero;
192
+ for (XCUIElement *statusBar in app.statusBars.allElementsBoundByIndex) {
193
+ // Resolve the element before reading its screen: displayID can be zero on
194
+ // an unresolved query result even when the bar belongs to the main screen.
195
+ CGRect frame = statusBar.frame;
196
+ if (statusBar.screen.displayID != screen.displayID || !statusBar.fb_isVisible) {
197
+ continue;
198
+ }
199
+ if (fabs(CGRectGetMinY(frame)) <= 1 && fabs(CGRectGetMinX(frame)) <= 1
200
+ && fabs(CGRectGetWidth(frame) - screenSize.width) <= 1
201
+ && CGRectGetHeight(frame) > 0 && CGRectGetHeight(frame) < screenSize.height
202
+ && CGRectGetHeight(frame) < CGRectGetWidth(frame)) {
203
+ statusBarSize = frame.size;
204
+ break;
205
+ }
206
+ }
207
+
208
+ return FBResponseWithObject(
209
+ @{
210
+ @"screenSize":@{@"width": @(screenSize.width),
211
+ @"height": @(screenSize.height)
212
+ },
213
+ @"statusBarSize": @{@"width": @(statusBarSize.width),
214
+ @"height": @(statusBarSize.height),
215
+ },
216
+ @"displayId": @(screen.displayID),
217
+ @"scale": @(screen.scale),
218
+ });
219
+ }
220
+
221
+ + (id<FBResponsePayload>)handleGetScreens:(FBRouteRequest *)request
222
+ {
223
+ NSError *error;
224
+ NSArray<NSDictionary<NSString *, id> *> *screens = [FBScreen screensWithError:&error];
225
+ if (nil == screens) {
226
+ return FBResponseWithUnknownError(error);
227
+ }
228
+ return FBResponseWithObject(screens);
229
+ }
230
+
231
+ + (id<FBResponsePayload>)handleLock:(FBRouteRequest *)request
232
+ {
233
+ NSError *error;
234
+ if (![[XCUIDevice sharedDevice] fb_lockScreen:&error]) {
235
+ return FBResponseWithUnknownError(error);
236
+ }
237
+ return FBResponseWithOK();
238
+ }
239
+
240
+ + (id<FBResponsePayload>)handleIsLocked:(FBRouteRequest *)request
241
+ {
242
+ BOOL isLocked = [XCUIDevice sharedDevice].fb_isScreenLocked;
243
+ return FBResponseWithObject(isLocked ? @YES : @NO);
244
+ }
245
+
246
+ + (id<FBResponsePayload>)handleUnlock:(FBRouteRequest *)request
247
+ {
248
+ NSError *error;
249
+ if (![[XCUIDevice sharedDevice] fb_unlockScreen:&error]) {
250
+ return FBResponseWithUnknownError(error);
251
+ }
252
+ return FBResponseWithOK();
253
+ }
254
+
255
+ + (id<FBResponsePayload>)handleActiveAppInfo:(FBRouteRequest *)request
256
+ {
257
+ XCUIApplication *app = request.session.activeApplication ?: XCUIApplication.fb_activeApplication;
258
+ // .identifier can be nil if the app stopped answering accessibility requests
259
+ // and accessibilityDeadline aborted the underlying snapshot fetch (#1210).
260
+ NSString *name = app.identifier ?: @"unknown";
261
+ return FBResponseWithObject(@{
262
+ @"pid": @(app.processID),
263
+ @"bundleId": app.bundleID,
264
+ @"name": name,
265
+ @"processArguments": [self processArguments:app],
266
+ });
267
+ }
268
+
269
+ /**
270
+ * Returns current active app and its arguments of active session
271
+ *
272
+ * @return The dictionary of current active bundleId and its process/environment argumens
273
+ *
274
+ * @example
275
+ *
276
+ * [self currentActiveApplication]
277
+ * //=> {
278
+ * // "processArguments" : {
279
+ * // "env" : {
280
+ * // "HAPPY" : "testing"
281
+ * // },
282
+ * // "args" : [
283
+ * // "happy",
284
+ * // "tseting"
285
+ * // ]
286
+ * // }
287
+ *
288
+ * [self currentActiveApplication]
289
+ * //=> {}
290
+ */
291
+ + (NSDictionary *)processArguments:(XCUIApplication *)app
292
+ {
293
+ // Can be nil if no active activation is defined by XCTest
294
+ if (app == nil) {
295
+ return @{};
296
+ }
297
+
298
+ return
299
+ @{
300
+ @"args": app.launchArguments,
301
+ @"env": app.launchEnvironment
302
+ };
303
+ }
304
+
305
+ #if !TARGET_OS_TV && !TARGET_OS_WATCH
306
+ + (id<FBResponsePayload>)handleSetPasteboard:(FBRouteRequest *)request
307
+ {
308
+ NSString *contentType = request.arguments[@"contentType"] ?: @"plaintext";
309
+ NSData *content = [[NSData alloc] initWithBase64EncodedString:(NSString *)request.arguments[@"content"]
310
+ options:NSDataBase64DecodingIgnoreUnknownCharacters];
311
+ if (nil == content) {
312
+ return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:@"Cannot decode the pasteboard content from base64" traceback:nil]);
313
+ }
314
+ NSError *error;
315
+ if (![FBPasteboard setData:content forType:contentType error:&error]) {
316
+ return FBResponseWithUnknownError(error);
317
+ }
318
+ return FBResponseWithOK();
319
+ }
320
+
321
+ + (id<FBResponsePayload>)handleGetPasteboard:(FBRouteRequest *)request
322
+ {
323
+ NSString *contentType = request.arguments[@"contentType"] ?: @"plaintext";
324
+ NSError *error;
325
+ id result = [FBPasteboard dataForType:contentType error:&error];
326
+ if (nil == result) {
327
+ return FBResponseWithUnknownError(error);
328
+ }
329
+ return FBResponseWithObject([result base64EncodedStringWithOptions:(NSDataBase64EncodingOptions)0]);
330
+ }
331
+
332
+ + (id<FBResponsePayload>)handleGetBatteryInfo:(FBRouteRequest *)request
333
+ {
334
+ if (![[UIDevice currentDevice] isBatteryMonitoringEnabled]) {
335
+ [[UIDevice currentDevice] setBatteryMonitoringEnabled:YES];
336
+ }
337
+ return FBResponseWithObject(@{
338
+ @"level": @([UIDevice currentDevice].batteryLevel),
339
+ @"state": @([UIDevice currentDevice].batteryState)
340
+ });
341
+ }
342
+ #endif
343
+
344
+ + (id<FBResponsePayload>)handlePressButtonCommand:(FBRouteRequest *)request
345
+ {
346
+ NSError *error;
347
+ if (![XCUIDevice.sharedDevice fb_pressButton:(id)request.arguments[@"name"]
348
+ forDuration:(NSNumber *)request.arguments[@"duration"]
349
+ error:&error]) {
350
+ return FBResponseWithUnknownError(error);
351
+ }
352
+ return FBResponseWithOK();
353
+ }
354
+
355
+ #if TARGET_OS_WATCH
356
+ + (id<FBResponsePayload>)handleRotateDigitalCrownCommand:(FBRouteRequest *)request
357
+ {
358
+ NSNumber *delta = request.arguments[@"delta"];
359
+ if (nil == delta) {
360
+ return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:@"'delta' argument is mandatory"
361
+ traceback:nil]);
362
+ }
363
+ NSError *error;
364
+ if (![XCUIDevice.sharedDevice fb_rotateDigitalCrown:delta.doubleValue
365
+ velocity:request.arguments[@"velocity"]
366
+ error:&error]) {
367
+ return FBResponseWithUnknownError(error);
368
+ }
369
+ return FBResponseWithOK();
370
+ }
371
+
372
+ + (id<FBResponsePayload>)handlePerformHandGestureCommand:(FBRouteRequest *)request
373
+ {
374
+ NSString *gestureName = request.arguments[@"name"];
375
+ if (nil == gestureName) {
376
+ return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:@"'name' argument is mandatory"
377
+ traceback:nil]);
378
+ }
379
+ NSError *error;
380
+ if (![XCUIDevice.sharedDevice fb_performHandGesture:gestureName error:&error]) {
381
+ return FBResponseWithUnknownError(error);
382
+ }
383
+ return FBResponseWithOK();
384
+ }
385
+ #endif
386
+
387
+ + (id<FBResponsePayload>)handleActivateSiri:(FBRouteRequest *)request
388
+ {
389
+ NSError *error;
390
+ if (![XCUIDevice.sharedDevice fb_activateSiriVoiceRecognitionWithText:(id)request.arguments[@"text"] error:&error]) {
391
+ return FBResponseWithUnknownError(error);
392
+ }
393
+ return FBResponseWithOK();
394
+ }
395
+
396
+ + (id <FBResponsePayload>)handlePeformIOHIDEvent:(FBRouteRequest *)request
397
+ {
398
+ NSNumber *page = request.arguments[@"page"];
399
+ NSNumber *usage = request.arguments[@"usage"];
400
+ NSNumber *duration = request.arguments[@"duration"];
401
+ NSError *error;
402
+ if (![XCUIDevice.sharedDevice fb_performIOHIDEventWithPage:page.unsignedIntValue
403
+ usage:usage.unsignedIntValue
404
+ duration:duration.doubleValue
405
+ error:&error]) {
406
+ return FBResponseWithStatus([FBCommandStatus unknownErrorWithMessage:error.description
407
+ traceback:nil]);
408
+ }
409
+ return FBResponseWithOK();
410
+ }
411
+
412
+ + (id <FBResponsePayload>)handleLaunchUnattachedApp:(FBRouteRequest *)request
413
+ {
414
+ NSString *bundle = (NSString *)request.arguments[@"bundleId"];
415
+ if ([FBUnattachedAppLauncher launchAppWithBundleId:bundle]) {
416
+ return FBResponseWithOK();
417
+ }
418
+ return FBResponseWithStatus([FBCommandStatus unknownErrorWithMessage:@"LSApplicationWorkspace failed to launch app" traceback:nil]);
419
+ }
420
+
421
+ + (id <FBResponsePayload>)handleResetAppAuth:(FBRouteRequest *)request
422
+ {
423
+ NSNumber *resource = request.arguments[@"resource"];
424
+ if (nil == resource) {
425
+ NSString *errMsg = @"The 'resource' argument must be set to a valid resource identifier (numeric value). See https://developer.apple.com/documentation/xctest/xcuiprotectedresource?language=objc";
426
+ return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:errMsg traceback:nil]);
427
+ }
428
+ [request.session.activeApplication resetAuthorizationStatusForResource:(XCUIProtectedResource)resource.longLongValue];
429
+ return FBResponseWithOK();
430
+ }
431
+
432
+ /**
433
+ Returns device location data.
434
+ It requires to configure location access permission by manual.
435
+ The response of 'latitude', 'longitude' and 'altitude' are always zero (0) without authorization.
436
+ 'authorizationStatus' indicates current authorization status. '3' is 'Always'.
437
+ https://developer.apple.com/documentation/corelocation/clauthorizationstatus
438
+
439
+ Settings -> Privacy -> Location Service -> WebDriverAgent-Runner -> Always
440
+
441
+ The return value could be zero even if the permission is set to 'Always'
442
+ since the location service needs some time to update the location data.
443
+ */
444
+ + (id<FBResponsePayload>)handleGetLocation:(FBRouteRequest *)request
445
+ {
446
+ #if TARGET_OS_TV
447
+ return FBResponseWithStatus([FBCommandStatus unsupportedOperationErrorWithMessage:@"unsupported"
448
+ traceback:nil]);
449
+ #else
450
+ CLLocationManager *locationManager = [[CLLocationManager alloc] init];
451
+ [locationManager setDistanceFilter:kCLHeadingFilterNone];
452
+ // Always return the best acurate location data
453
+ [locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
454
+ #if !TARGET_OS_WATCH
455
+ [locationManager setPausesLocationUpdatesAutomatically:NO];
456
+ #endif
457
+ [locationManager startUpdatingLocation];
458
+
459
+ CLAuthorizationStatus authStatus;
460
+ if ([locationManager respondsToSelector:@selector(authorizationStatus)]) {
461
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[locationManager class]
462
+ instanceMethodSignatureForSelector:@selector(authorizationStatus)]];
463
+ [invocation setSelector:@selector(authorizationStatus)];
464
+ [invocation setTarget:locationManager];
465
+ [invocation invoke];
466
+ [invocation getReturnValue:&authStatus];
467
+ } else {
468
+ authStatus = [CLLocationManager authorizationStatus];
469
+ }
470
+
471
+ return FBResponseWithObject(@{
472
+ @"authorizationStatus": @(authStatus),
473
+ @"latitude": @(locationManager.location.coordinate.latitude),
474
+ @"longitude": @(locationManager.location.coordinate.longitude),
475
+ @"altitude": @(locationManager.location.altitude),
476
+ });
477
+ #endif
478
+ }
479
+
480
+ + (id<FBResponsePayload>)handleExpectNotification:(FBRouteRequest *)request
481
+ {
482
+ NSString *name = request.arguments[@"name"];
483
+ if (nil == name) {
484
+ NSString *message = @"Notification name argument must be provided";
485
+ return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:message traceback:nil]);
486
+ }
487
+ NSNumber *timeout = request.arguments[@"timeout"] ?: @60;
488
+ NSString *type = request.arguments[@"type"] ?: @"plain";
489
+
490
+ XCTWaiterResult result;
491
+ if ([type isEqualToString:@"plain"]) {
492
+ result = [FBNotificationsHelper waitForNotificationWithName:name timeout:timeout.doubleValue];
493
+ } else if ([type isEqualToString:@"darwin"]) {
494
+ result = [FBNotificationsHelper waitForDarwinNotificationWithName:name timeout:timeout.doubleValue];
495
+ } else {
496
+ NSString *message = [NSString stringWithFormat:@"Notification type could only be 'plain' or 'darwin'. Got '%@' instead", type];
497
+ return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:message traceback:nil]);
498
+ }
499
+ if (result != XCTWaiterResultCompleted) {
500
+ NSString *message = [NSString stringWithFormat:@"Did not receive any expected %@ notifications within %@s",
501
+ name, timeout];
502
+ return FBResponseWithStatus([FBCommandStatus timeoutErrorWithMessage:message traceback:nil]);
503
+ }
504
+ return FBResponseWithOK();
505
+ }
506
+
507
+ + (id<FBResponsePayload>)handleSetDeviceAppearance:(FBRouteRequest *)request
508
+ {
509
+ NSString *name = [request.arguments[@"name"] lowercaseString];
510
+ if (nil == name || !([name isEqualToString:@"light"] || [name isEqualToString:@"dark"])) {
511
+ NSString *message = @"The appearance name must be either 'light' or 'dark'";
512
+ return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:message traceback:nil]);
513
+ }
514
+
515
+ FBUIInterfaceAppearance appearance = [name isEqualToString:@"light"]
516
+ ? FBUIInterfaceAppearanceLight
517
+ : FBUIInterfaceAppearanceDark;
518
+ NSError *error;
519
+ if (![XCUIDevice.sharedDevice fb_setAppearance:appearance error:&error]) {
520
+ return FBResponseWithStatus([FBCommandStatus unknownErrorWithMessage:error.description
521
+ traceback:nil]);
522
+ }
523
+ return FBResponseWithOK();
524
+ }
525
+
526
+ + (id<FBResponsePayload>)handleGetDeviceInfo:(FBRouteRequest *)request
527
+ {
528
+ // Returns locale like ja_EN and zh-Hant_US. The format depends on OS
529
+ // Developers should use this locale by default
530
+ // https://developer.apple.com/documentation/foundation/nslocale/1414388-autoupdatingcurrentlocale
531
+ NSString *currentLocale = [[NSLocale autoupdatingCurrentLocale] localeIdentifier];
532
+
533
+ NSMutableDictionary *deviceInfo = [NSMutableDictionary dictionaryWithDictionary:
534
+ @{
535
+ @"currentLocale": currentLocale,
536
+ @"timeZone": self.timeZone,
537
+ #if TARGET_OS_WATCH
538
+ @"name": WKInterfaceDevice.currentDevice.name,
539
+ @"model": WKInterfaceDevice.currentDevice.model,
540
+ @"uuid": @"unknown",
541
+ #else
542
+ @"name": UIDevice.currentDevice.name,
543
+ @"model": UIDevice.currentDevice.model,
544
+ @"uuid": [UIDevice.currentDevice.identifierForVendor UUIDString] ?: @"unknown",
545
+ // https://developer.apple.com/documentation/uikit/uiuserinterfaceidiom?language=objc
546
+ @"userInterfaceIdiom": @(UIDevice.currentDevice.userInterfaceIdiom),
547
+ #endif
548
+ @"userInterfaceStyle": self.userInterfaceStyle,
549
+ #if TARGET_OS_SIMULATOR
550
+ @"isSimulator": @(YES),
551
+ #else
552
+ @"isSimulator": @(NO),
553
+ #endif
554
+ }];
555
+
556
+ // https://developer.apple.com/documentation/foundation/nsprocessinfothermalstate
557
+ deviceInfo[@"thermalState"] = @(NSProcessInfo.processInfo.thermalState);
558
+
559
+ return FBResponseWithObject(deviceInfo);
560
+ }
561
+
562
+ /**
563
+ * @return Current user interface style as a string
564
+ */
565
+ + (NSString *)userInterfaceStyle
566
+ {
567
+
568
+ if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"15.0")) {
569
+ // Only iOS 15+ simulators/devices return correct data while
570
+ // the api itself works in iOS 13 and 14 that has style preference.
571
+ NSNumber *appearance = [XCUIDevice.sharedDevice fb_getAppearance];
572
+ if (appearance != nil) {
573
+ return [self getAppearanceName:appearance];
574
+ }
575
+ }
576
+
577
+ static id userInterfaceStyle = nil;
578
+ #if !TARGET_OS_WATCH
579
+ static dispatch_once_t styleOnceToken;
580
+ dispatch_once(&styleOnceToken, ^{
581
+ if ([UITraitCollection respondsToSelector:NSSelectorFromString(@"currentTraitCollection")]) {
582
+ id currentTraitCollection = [UITraitCollection performSelector:NSSelectorFromString(@"currentTraitCollection")];
583
+ if (nil != currentTraitCollection) {
584
+ userInterfaceStyle = [currentTraitCollection valueForKey:@"userInterfaceStyle"];
585
+ }
586
+ }
587
+ });
588
+ #endif
589
+
590
+ if (nil == userInterfaceStyle) {
591
+ return @"unsupported";
592
+ }
593
+
594
+ return [self getAppearanceName:userInterfaceStyle];
595
+ }
596
+
597
+ + (NSString *)getAppearanceName:(NSNumber *)appearance
598
+ {
599
+ switch ([appearance longLongValue]) {
600
+ case FBUIInterfaceAppearanceUnspecified:
601
+ return @"automatic";
602
+ case FBUIInterfaceAppearanceLight:
603
+ return @"light";
604
+ case FBUIInterfaceAppearanceDark:
605
+ return @"dark";
606
+ default:
607
+ return @"unknown";
608
+ }
609
+ }
610
+
611
+ /**
612
+ * @return The string of TimeZone. Returns TZ timezone id by default. Returns TimeZone name by Apple if TZ timezone id is not available.
613
+ */
614
+ + (NSString *)timeZone
615
+ {
616
+ NSTimeZone *localTimeZone = [NSTimeZone localTimeZone];
617
+ // Apple timezone name like "US/New_York"
618
+ NSString *timeZoneAbb = [localTimeZone abbreviation];
619
+ if (timeZoneAbb == nil) {
620
+ return [localTimeZone name];
621
+ }
622
+
623
+ // Convert timezone name to ids like "America/New_York" as TZ database Time Zones format
624
+ // https://developer.apple.com/documentation/foundation/nstimezone
625
+ NSString *timeZoneId = [[NSTimeZone timeZoneWithAbbreviation:timeZoneAbb] name];
626
+ if (timeZoneId != nil) {
627
+ return timeZoneId;
628
+ }
629
+
630
+ return [localTimeZone name];
631
+ }
632
+
633
+ #if !TARGET_OS_TV // tvOS does not provide relevant APIs
634
+ + (id<FBResponsePayload>)handleGetSimulatedLocation:(FBRouteRequest *)request
635
+ {
636
+ NSError *error;
637
+ CLLocation *location = [XCUIDevice.sharedDevice fb_getSimulatedLocation:&error];
638
+ if (nil != error) {
639
+ return FBResponseWithStatus([FBCommandStatus unknownErrorWithMessage:error.description
640
+ traceback:nil]);
641
+ }
642
+ return FBResponseWithObject(@{
643
+ @"latitude": location ? @(location.coordinate.latitude) : NSNull.null,
644
+ @"longitude": location ? @(location.coordinate.longitude) : NSNull.null,
645
+ @"altitude": location ? @(location.altitude) : NSNull.null,
646
+ });
647
+ }
648
+
649
+ + (id<FBResponsePayload>)handleSetSimulatedLocation:(FBRouteRequest *)request
650
+ {
651
+ NSNumber *longitude = request.arguments[@"longitude"];
652
+ NSNumber *latitude = request.arguments[@"latitude"];
653
+
654
+ if (nil == longitude || nil == latitude) {
655
+ return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:@"Both latitude and longitude must be provided"
656
+ traceback:nil]);
657
+ }
658
+ NSError *error;
659
+ CLLocation *location = [[CLLocation alloc] initWithLatitude:latitude.doubleValue
660
+ longitude:longitude.doubleValue];
661
+ if (![XCUIDevice.sharedDevice fb_setSimulatedLocation:location error:&error]) {
662
+ return FBResponseWithStatus([FBCommandStatus unknownErrorWithMessage:error.description
663
+ traceback:nil]);
664
+ }
665
+ return FBResponseWithOK();
666
+ }
667
+
668
+ + (id<FBResponsePayload>)handleClearSimulatedLocation:(FBRouteRequest *)request
669
+ {
670
+ NSError *error;
671
+ if (![XCUIDevice.sharedDevice fb_clearSimulatedLocation:&error]) {
672
+ return FBResponseWithStatus([FBCommandStatus unknownErrorWithMessage:error.description
673
+ traceback:nil]);
674
+ }
675
+ return FBResponseWithOK();
676
+ }
677
+
678
+ #if __clang_major__ >= 15 && !TARGET_OS_WATCH
679
+ + (id<FBResponsePayload>)handleKeyboardInput:(FBRouteRequest *)request
680
+ {
681
+ FBElementCache *elementCache = request.session.elementCache;
682
+ BOOL hasElement = ![request.parameters[@"uuid"] isEqual:@"0"];
683
+ XCUIElement *destination = hasElement
684
+ ? [elementCache elementForUUID:(NSString *)request.parameters[@"uuid"]
685
+ checkStaleness:YES]
686
+ : request.session.activeApplication;
687
+ id keys = request.arguments[@"keys"];
688
+
689
+ if (![destination respondsToSelector:@selector(typeKey:modifierFlags:)]) {
690
+ NSString *message = @"typeKey API is only supported since Xcode15 and iPadOS 17";
691
+ return FBResponseWithStatus([FBCommandStatus unsupportedOperationErrorWithMessage:message
692
+ traceback:nil]);
693
+ }
694
+
695
+ if (![keys isKindOfClass:NSArray.class]) {
696
+ NSString *message = @"The 'keys' argument must be an array";
697
+ return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:message
698
+ traceback:nil]);
699
+ }
700
+ for (id item in (NSArray *)keys) {
701
+ if ([item isKindOfClass:NSString.class]) {
702
+ NSString *keyValue = [FBKeyboard keyValueForName:item] ?: item;
703
+ [destination typeKey:keyValue modifierFlags:XCUIKeyModifierNone];
704
+ } else if ([item isKindOfClass:NSDictionary.class]) {
705
+ id key = [(NSDictionary *)item objectForKey:@"key"];
706
+ if (![key isKindOfClass:NSString.class]) {
707
+ NSString *message = [NSString stringWithFormat:@"All dictionaries of 'keys' array must have the 'key' item of type string. Got '%@' instead in the item %@", key, item];
708
+ return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:message
709
+ traceback:nil]);
710
+ }
711
+ id modifiers = [(NSDictionary *)item objectForKey:@"modifierFlags"];
712
+ NSUInteger modifierFlags = XCUIKeyModifierNone;
713
+ if ([modifiers isKindOfClass:NSNumber.class]) {
714
+ modifierFlags = [(NSNumber *)modifiers unsignedIntValue];
715
+ }
716
+ NSString *keyValue = [FBKeyboard keyValueForName:key] ?: key;
717
+ [destination typeKey:keyValue modifierFlags:(XCUIKeyModifierFlags)modifierFlags];
718
+ } else {
719
+ NSString *message = @"All items of the 'keys' array must be either dictionaries or strings";
720
+ return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:message
721
+ traceback:nil]);
722
+ }
723
+ }
724
+ return FBResponseWithOK();
725
+ }
726
+ #endif
727
+ #endif
728
+
729
+ + (id<FBResponsePayload>)fb_handleVoiceOverSpeechResponse:(nullable NSString *)utterance
730
+ error:(NSError *)error
731
+ {
732
+ if (nil != error) {
733
+ return FBResponseWithStatus([FBCommandStatus unknownErrorWithMessage:error.description
734
+ traceback:nil]);
735
+ }
736
+ return FBResponseWithObject(@{
737
+ @"utterance": utterance ?: NSNull.null,
738
+ });
739
+ }
740
+
741
+ + (id<FBResponsePayload>)handleVoiceOverEnable:(FBRouteRequest *)request
742
+ {
743
+ NSError *error;
744
+ if (![XCUIDevice.sharedDevice fb_enableVoiceOver:&error]) {
745
+ return FBResponseWithStatus([FBCommandStatus unknownErrorWithMessage:error.description
746
+ traceback:nil]);
747
+ }
748
+ return FBResponseWithOK();
749
+ }
750
+
751
+ + (id<FBResponsePayload>)handleVoiceOverDisable:(FBRouteRequest *)request
752
+ {
753
+ NSError *error;
754
+ if (![XCUIDevice.sharedDevice fb_disableVoiceOver:&error]) {
755
+ return FBResponseWithStatus([FBCommandStatus unknownErrorWithMessage:error.description
756
+ traceback:nil]);
757
+ }
758
+ return FBResponseWithOK();
759
+ }
760
+
761
+ + (id<FBResponsePayload>)handleVoiceOverEnabled:(FBRouteRequest *)request
762
+ {
763
+ NSError *error;
764
+ BOOL isEnabled = [XCUIDevice.sharedDevice fb_isVoiceOverEnabled:&error];
765
+ if (nil != error) {
766
+ return FBResponseWithStatus([FBCommandStatus unknownErrorWithMessage:error.description
767
+ traceback:nil]);
768
+ }
769
+ return FBResponseWithObject(@{@"enabled": @(isEnabled)});
770
+ }
771
+
772
+ + (id<FBResponsePayload>)handleVoiceOverMove:(FBRouteRequest *)request
773
+ {
774
+ NSString *direction = request.arguments[@"direction"];
775
+ if (nil == direction) {
776
+ return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:@"The 'direction' argument must be provided"
777
+ traceback:nil]);
778
+ }
779
+
780
+ NSError *error;
781
+ NSString *utterance = [XCUIDevice.sharedDevice fb_voiceOverMove:direction error:&error];
782
+ if (nil != error) {
783
+ FBCommandStatus *status = [error.localizedDescription containsString:@"Unsupported VoiceOver move direction"]
784
+ ? [FBCommandStatus invalidArgumentErrorWithMessage:error.description traceback:nil]
785
+ : [FBCommandStatus unknownErrorWithMessage:error.description traceback:nil];
786
+ return FBResponseWithStatus(status);
787
+ }
788
+ return [self fb_handleVoiceOverSpeechResponse:utterance error:nil];
789
+ }
790
+
791
+ + (id<FBResponsePayload>)handleVoiceOverCurrentSpeech:(FBRouteRequest *)request
792
+ {
793
+ NSError *error;
794
+ NSString *utterance = [XCUIDevice.sharedDevice fb_voiceOverCurrentSpeech:&error];
795
+ return [self fb_handleVoiceOverSpeechResponse:utterance error:error];
796
+ }
797
+
798
+ + (id<FBResponsePayload>)handlePerformAccessibilityAudit:(FBRouteRequest *)request
799
+ {
800
+ NSError *error;
801
+ NSArray *requestedTypes = request.arguments[@"auditTypes"];
802
+ NSMutableSet *typesSet = [NSMutableSet set];
803
+ if (nil == requestedTypes || 0 == [requestedTypes count]) {
804
+ [typesSet addObject:@"XCUIAccessibilityAuditTypeAll"];
805
+ } else {
806
+ [typesSet addObjectsFromArray:requestedTypes];
807
+ }
808
+ NSArray *result = [request.session.activeApplication fb_performAccessibilityAuditWithAuditTypesSet:typesSet.copy
809
+ error:&error];
810
+ if (nil == result) {
811
+ return FBResponseWithStatus([FBCommandStatus unknownErrorWithMessage:error.description
812
+ traceback:nil]);
813
+ }
814
+ return FBResponseWithObject(result);
815
+ }
816
+
817
+ + (id<FBResponsePayload>)handleGetSimulatedHingeAngle:(FBRouteRequest *)request
818
+ {
819
+ if (!XCUIDevice.sharedDevice.fb_supportsHingeAngleReading) {
820
+ return FBResponseWithStatus([FBCommandStatus unsupportedOperationErrorWithMessage:
821
+ @"Hinge angle reading is unavailable on this device" traceback:nil]);
822
+ }
823
+ NSError *error;
824
+ NSNumber *angle = [XCUIDevice.sharedDevice fb_getSimulatedHingeAngle:&error];
825
+ return nil == angle ? FBResponseWithUnknownError(error) : FBResponseWithObject(angle);
826
+ }
827
+
828
+ + (id<FBResponsePayload>)handleSetSimulatedHingeAngle:(FBRouteRequest *)request
829
+ {
830
+ id angle = request.arguments[@"angle"];
831
+ if (![angle isKindOfClass:NSNumber.class]
832
+ || CFGetTypeID((__bridge CFTypeRef)angle) == CFBooleanGetTypeID()
833
+ || !isfinite([angle doubleValue]) || [angle doubleValue] < 0 || [angle doubleValue] > 180) {
834
+ return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:
835
+ @"'angle' must be a finite number between 0 and 180 degrees" traceback:nil]);
836
+ }
837
+ if (!XCUIDevice.sharedDevice.fb_canAttemptSimulatedHingeAngleInjection) {
838
+ return FBResponseWithStatus([FBCommandStatus unsupportedOperationErrorWithMessage:
839
+ @"Setting a simulated hinge angle requires a compatible foldable device" traceback:nil]);
840
+ }
841
+ NSError *error;
842
+ if (![XCUIDevice.sharedDevice fb_setSimulatedHingeAngle:[angle doubleValue] error:&error]) {
843
+ return FBResponseWithUnknownError(error);
844
+ }
845
+ return FBResponseWithOK();
846
+ }
847
+
848
+ @end