@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.
- package/Configurations/IOSSettings.xcconfig +31 -0
- package/Configurations/IOSTestSettings.xcconfig +1 -0
- package/Configurations/TVOSSettings.xcconfig +31 -0
- package/Configurations/TVOSTestSettings.xcconfig +1 -0
- package/LICENSE +66 -0
- package/LICENSE-3RD-PARTY.md +70 -0
- package/MySwiftFramework/JSONHelper.swift +31 -0
- package/MySwiftFramework/MySwiftFramework.h +18 -0
- package/PrivateHeaders/AccessibilityUtilities/AXSettings.h +15 -0
- package/PrivateHeaders/MobileCoreServices/LSApplicationWorkspace.h +127 -0
- package/PrivateHeaders/TextInput/TIPreferencesController.h +45 -0
- package/PrivateHeaders/UIKitCore/UIKeyboardImpl.h +27 -0
- package/PrivateHeaders/XCTest/CDStructures.h +7 -0
- package/PrivateHeaders/XCTest/NSFastEnumeration-Protocol.h +23 -0
- package/PrivateHeaders/XCTest/XCAXClient_iOS.h +91 -0
- package/PrivateHeaders/XCTest/XCApplicationQuery.h +30 -0
- package/PrivateHeaders/XCTest/XCDebugLogDelegate-Protocol.h +23 -0
- package/PrivateHeaders/XCTest/XCPointerEvent.h +63 -0
- package/PrivateHeaders/XCTest/XCPointerEventPath.h +65 -0
- package/PrivateHeaders/XCTest/XCSynthesizedEventRecord.h +55 -0
- package/PrivateHeaders/XCTest/XCTAggregateSuiteRunStatistics.h +38 -0
- package/PrivateHeaders/XCTest/XCTAttachmentManager.h +33 -0
- package/PrivateHeaders/XCTest/XCTCapabilities.h +35 -0
- package/PrivateHeaders/XCTest/XCTCapabilitiesProviding-Protocol.h +23 -0
- package/PrivateHeaders/XCTest/XCTElementSetTransformer-Protocol.h +35 -0
- package/PrivateHeaders/XCTest/XCTElementSnapshotAttributeDataSource-Protocol.h +33 -0
- package/PrivateHeaders/XCTest/XCTElementSnapshotProvider-Protocol.h +23 -0
- package/PrivateHeaders/XCTest/XCTExpectedFailureContextManager.h +35 -0
- package/PrivateHeaders/XCTest/XCTFuture.h +45 -0
- package/PrivateHeaders/XCTest/XCTHarnessEventReporting-Protocol.h +29 -0
- package/PrivateHeaders/XCTest/XCTIssue.h +49 -0
- package/PrivateHeaders/XCTest/XCTIssueHandling-Protocol.h +26 -0
- package/PrivateHeaders/XCTest/XCTMacCatalystStatusProviding-Protocol.h +23 -0
- package/PrivateHeaders/XCTest/XCTMeasureOptions.h +48 -0
- package/PrivateHeaders/XCTest/XCTMemoryChecker.h +50 -0
- package/PrivateHeaders/XCTest/XCTMemoryCheckerDelegate-Protocol.h +26 -0
- package/PrivateHeaders/XCTest/XCTMessagingChannel_IDEToRunner-Protocol.h +27 -0
- package/PrivateHeaders/XCTest/XCTMessagingChannel_RunnerToDaemon-Protocol.h +39 -0
- package/PrivateHeaders/XCTest/XCTMessagingChannel_RunnerToIDE-Protocol.h +32 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_ActivityReporting-Protocol.h +24 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_AttachmentFutureResultStatusUpdating-Protocol.h +23 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_BundleRequesting-Protocol.h +24 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_CapabilityExchange-Protocol.h +56 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_DebugLogging-Protocol.h +23 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_EventSynthesis-Protocol.h +34 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_ForcePressureSupportQuerying-Protocol.h +25 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_HIDEventRecording-Protocol.h +25 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_MemoryTesting-Protocol.h +23 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_PerformanceMeasurementReporting-Protocol.h +23 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_ProcessMonitoring-Protocol.h +25 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_ProtectedResourceAuthorization-Protocol.h +22 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_ScreenRecording-Protocol.h +24 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_SelfDiagnosisIssueReporting-Protocol.h +23 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_SignpostRequesting-Protocol.h +24 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_SiriAutomation-Protocol.h +27 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_SystemConfiguration-Protocol.h +27 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_TelemetrySending-Protocol.h +23 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_TestExecution-Protocol.h +28 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_TestReporting-Protocol.h +40 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_UIAutomation-Protocol.h +29 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_UIAutomationRunnerEventReporting-Protocol.h +27 -0
- package/PrivateHeaders/XCTest/XCTMessagingRole_UserPresence-Protocol.h +24 -0
- package/PrivateHeaders/XCTest/XCTMetricDiagnosticHelper.h +49 -0
- package/PrivateHeaders/XCTest/XCTNSPredicateExpectationObject-Protocol.h +23 -0
- package/PrivateHeaders/XCTest/XCTPromise.h +30 -0
- package/PrivateHeaders/XCTest/XCTRemoteSignpostListenerProxy-Protocol.h +29 -0
- package/PrivateHeaders/XCTest/XCTRepetitionPolicy.h +43 -0
- package/PrivateHeaders/XCTest/XCTReportingSession.h +50 -0
- package/PrivateHeaders/XCTest/XCTReportingSessionConfiguration-Protocol.h +27 -0
- package/PrivateHeaders/XCTest/XCTReportingSessionIssueReporter-Protocol.h +23 -0
- package/PrivateHeaders/XCTest/XCTReportingSessionTestContainer-Protocol.h +26 -0
- package/PrivateHeaders/XCTest/XCTReportingSessionTestReporter.h +51 -0
- package/PrivateHeaders/XCTest/XCTRunnerAutomationSession-Protocol.h +38 -0
- package/PrivateHeaders/XCTest/XCTRunnerDaemonSession.h +96 -0
- package/PrivateHeaders/XCTest/XCTRunnerDaemonSessionUIAutomationDelegate-Protocol.h +33 -0
- package/PrivateHeaders/XCTest/XCTRunnerIDESession.h +99 -0
- package/PrivateHeaders/XCTest/XCTRunnerIDESessionDelegate-Protocol.h +24 -0
- package/PrivateHeaders/XCTest/XCTRuntimeDiagnosticsPolicy.h +36 -0
- package/PrivateHeaders/XCTest/XCTRuntimeIssueDetectionPolicy.h +39 -0
- package/PrivateHeaders/XCTest/XCTScreenCapturePolicy.h +35 -0
- package/PrivateHeaders/XCTest/XCTSignpostListener-Protocol.h +25 -0
- package/PrivateHeaders/XCTest/XCTSkippedTestContext.h +37 -0
- package/PrivateHeaders/XCTest/XCTSourceCodeContext.h +39 -0
- package/PrivateHeaders/XCTest/XCTSourceCodeLocation.h +31 -0
- package/PrivateHeaders/XCTest/XCTTagSelection.h +41 -0
- package/PrivateHeaders/XCTest/XCTTestIdentifier.h +81 -0
- package/PrivateHeaders/XCTest/XCTTestIdentifierSet.h +54 -0
- package/PrivateHeaders/XCTest/XCTTestSelection.h +35 -0
- package/PrivateHeaders/XCTest/XCTWaiter.h +54 -0
- package/PrivateHeaders/XCTest/XCTWaiterManagement-Protocol.h +24 -0
- package/PrivateHeaders/XCTest/XCTWaiterManager-Protocol.h +25 -0
- package/PrivateHeaders/XCTest/XCTWaiterWait.h +40 -0
- package/PrivateHeaders/XCTest/XCTest.h +53 -0
- package/PrivateHeaders/XCTest/XCTestCase.h +180 -0
- package/PrivateHeaders/XCTest/XCTestCaseDiscoveryUIAutomationDelegate-Protocol.h +20 -0
- package/PrivateHeaders/XCTest/XCTestCaseRun.h +28 -0
- package/PrivateHeaders/XCTest/XCTestCaseUIAutomationDelegate-Protocol.h +25 -0
- package/PrivateHeaders/XCTest/XCTestCastMethodNamesUIAutomationDelegate-Protocol.h +24 -0
- package/PrivateHeaders/XCTest/XCTestConfiguration.h +94 -0
- package/PrivateHeaders/XCTest/XCTestDriver.h +64 -0
- package/PrivateHeaders/XCTest/XCTestExpectation.h +50 -0
- package/PrivateHeaders/XCTest/XCTestExpectationDelegate-Protocol.h +23 -0
- package/PrivateHeaders/XCTest/XCTestObservationCenter.h +60 -0
- package/PrivateHeaders/XCTest/XCTestRun.h +44 -0
- package/PrivateHeaders/XCTest/XCUIAXNotificationHandling-Protocol.h +25 -0
- package/PrivateHeaders/XCTest/XCUIAccessibilityInterface-Protocol.h +58 -0
- package/PrivateHeaders/XCTest/XCUIAlertMonitoring-Protocol.h +27 -0
- package/PrivateHeaders/XCTest/XCUIApplication.h +98 -0
- package/PrivateHeaders/XCTest/XCUIApplicationAutomationSessionProviding-Protocol.h +26 -0
- package/PrivateHeaders/XCTest/XCUIApplicationImpl.h +90 -0
- package/PrivateHeaders/XCTest/XCUIApplicationImplReporter-Protocol.h +26 -0
- package/PrivateHeaders/XCTest/XCUIApplicationManaging-Protocol.h +23 -0
- package/PrivateHeaders/XCTest/XCUIApplicationMonitor-Protocol.h +43 -0
- package/PrivateHeaders/XCTest/XCUIApplicationOpenRequest.h +34 -0
- package/PrivateHeaders/XCTest/XCUIApplicationPlatformServicesProviderDelegate-Protocol.h +25 -0
- package/PrivateHeaders/XCTest/XCUIApplicationProcess.h +105 -0
- package/PrivateHeaders/XCTest/XCUIApplicationProcessDelegate-Protocol.h +25 -0
- package/PrivateHeaders/XCTest/XCUIApplicationProcessManaging-Protocol.h +26 -0
- package/PrivateHeaders/XCTest/XCUIApplicationProcessTracker-Protocol.h +28 -0
- package/PrivateHeaders/XCTest/XCUIApplicationRegistry.h +32 -0
- package/PrivateHeaders/XCTest/XCUIButtonConsole.h +26 -0
- package/PrivateHeaders/XCTest/XCUICoordinate.h +49 -0
- package/PrivateHeaders/XCTest/XCUIDevice.h +134 -0
- package/PrivateHeaders/XCTest/XCUIDeviceAutomationModeInterface-Protocol.h +25 -0
- package/PrivateHeaders/XCTest/XCUIDeviceDelayedAttachmentTransferSupportInterface-Protocol.h +22 -0
- package/PrivateHeaders/XCTest/XCUIDeviceEventAndStateInterface-Protocol.h +40 -0
- package/PrivateHeaders/XCTest/XCUIElement.h +207 -0
- package/PrivateHeaders/XCTest/XCUIElementAttributesPrivate-Protocol.h +26 -0
- package/PrivateHeaders/XCTest/XCUIElementEventTarget-Protocol.h +38 -0
- package/PrivateHeaders/XCTest/XCUIElementQuery.h +166 -0
- package/PrivateHeaders/XCTest/XCUIElementTypeQueryProvider_Private-Protocol.h +24 -0
- package/PrivateHeaders/XCTest/XCUIEventRecording-Protocol.h +37 -0
- package/PrivateHeaders/XCTest/XCUIHitPointResult.h +25 -0
- package/PrivateHeaders/XCTest/XCUIInterruptionMonitoring-Protocol.h +27 -0
- package/PrivateHeaders/XCTest/XCUIIssueDiagnosticsProviding-Protocol.h +23 -0
- package/PrivateHeaders/XCTest/XCUIKnobControl.h +26 -0
- package/PrivateHeaders/XCTest/XCUILocation.h +24 -0
- package/PrivateHeaders/XCTest/XCUIPlatformApplicationServicesProviding-Protocol.h +33 -0
- package/PrivateHeaders/XCTest/XCUIRemoteAccessibilityInterface-Protocol.h +45 -0
- package/PrivateHeaders/XCTest/XCUIRemoteDeviceRunner-Protocol.h +24 -0
- package/PrivateHeaders/XCTest/XCUIRemoteSiriInterface-Protocol.h +30 -0
- package/PrivateHeaders/XCTest/XCUIResetAuthorizationStatusOfProtectedResourcesInterface-Protocol.h +22 -0
- package/PrivateHeaders/XCTest/XCUIScreen.h +53 -0
- package/PrivateHeaders/XCTest/XCUIScreenDataSource-Protocol.h +35 -0
- package/PrivateHeaders/XCTest/XCUISiriService.h +39 -0
- package/PrivateHeaders/XCTest/XCUISystem.h +26 -0
- package/PrivateHeaders/XCTest/XCUIXcodeApplicationManaging-Protocol.h +27 -0
- package/PrivateHeaders/XCTest/_TtC10XCTestCore19XCTReportingContext.h +26 -0
- package/PrivateHeaders/XCTest/_XCTMessaging_VoidProtocol-Protocol.h +20 -0
- package/PrivateHeaders/XCTest/_XCTestObservationInternal-Protocol.h +26 -0
- package/PrivateHeaders/XCTest/_XCTestObservationPrivate-Protocol.h +27 -0
- package/README.md +57 -2
- package/Scripts/build-webdriveragent.mjs +93 -0
- package/Scripts/build.sh +137 -0
- package/Scripts/bundle-mobile-assets.sh +35 -0
- package/Scripts/embed-runner-icon.sh +118 -0
- package/Scripts/fetch-prebuilt-wda.mjs +81 -0
- package/Scripts/update-wda-version.mjs +44 -0
- package/WebDriverAgent.xcodeproj/project.pbxproj +8522 -0
- package/WebDriverAgent.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/WebDriverAgent.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/WebDriverAgent.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +5 -0
- package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/IntegrationApp.xcscheme +87 -0
- package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/IntegrationApp_tvOS.xcscheme +78 -0
- package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/IntegrationApp_watchOS.xcscheme +78 -0
- package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/IntegrationTests_1.xcscheme +93 -0
- package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/IntegrationTests_2.xcscheme +93 -0
- package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/IntegrationTests_3.xcscheme +93 -0
- package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/IntegrationTests_tvOS.xcscheme +93 -0
- package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/IntegrationTests_watchOS.xcscheme +93 -0
- package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentLib.xcscheme +125 -0
- package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentLib_tvOS.xcscheme +95 -0
- package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentLib_watchOS.xcscheme +85 -0
- package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentRunner-nodebug.xcscheme +87 -0
- package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentRunner.xcscheme +132 -0
- package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentRunner_noauth.xcscheme +70 -0
- package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentRunner_tvOS.xcscheme +123 -0
- package/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentRunner_watchOS.xcscheme +128 -0
- package/WebDriverAgentLib/Categories/FBXCElementSnapshotWrapper+Helpers.h +100 -0
- package/WebDriverAgentLib/Categories/FBXCElementSnapshotWrapper+Helpers.m +192 -0
- package/WebDriverAgentLib/Categories/NSDictionary+FBUtf8SafeDictionary.h +39 -0
- package/WebDriverAgentLib/Categories/NSDictionary+FBUtf8SafeDictionary.m +105 -0
- package/WebDriverAgentLib/Categories/NSExpression+FBFormat.h +29 -0
- package/WebDriverAgentLib/Categories/NSExpression+FBFormat.m +34 -0
- package/WebDriverAgentLib/Categories/NSString+FBVisualLength.h +18 -0
- package/WebDriverAgentLib/Categories/NSString+FBVisualLength.m +18 -0
- package/WebDriverAgentLib/Categories/NSString+FBXMLSafeString.h +27 -0
- package/WebDriverAgentLib/Categories/NSString+FBXMLSafeString.m +30 -0
- package/WebDriverAgentLib/Categories/XCAXClient_iOS+FBSnapshotReqParams.h +26 -0
- package/WebDriverAgentLib/Categories/XCAXClient_iOS+FBSnapshotReqParams.m +181 -0
- package/WebDriverAgentLib/Categories/XCTIssue+FBPatcher.h +17 -0
- package/WebDriverAgentLib/Categories/XCTIssue+FBPatcher.m +35 -0
- package/WebDriverAgentLib/Categories/XCUIApplication+FBAlert.h +47 -0
- package/WebDriverAgentLib/Categories/XCUIApplication+FBAlert.m +179 -0
- package/WebDriverAgentLib/Categories/XCUIApplication+FBFocused.h +23 -0
- package/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.h +186 -0
- package/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m +674 -0
- package/WebDriverAgentLib/Categories/XCUIApplication+FBQuiescence.h +24 -0
- package/WebDriverAgentLib/Categories/XCUIApplication+FBQuiescence.m +28 -0
- package/WebDriverAgentLib/Categories/XCUIApplication+FBTouchAction.h +82 -0
- package/WebDriverAgentLib/Categories/XCUIApplication+FBTouchAction.m +198 -0
- package/WebDriverAgentLib/Categories/XCUIApplication+FBUIInterruptions.h +22 -0
- package/WebDriverAgentLib/Categories/XCUIApplication+FBUIInterruptions.m +31 -0
- package/WebDriverAgentLib/Categories/XCUIApplicationProcess+FBQuiescence.h +27 -0
- package/WebDriverAgentLib/Categories/XCUIApplicationProcess+FBQuiescence.m +111 -0
- package/WebDriverAgentLib/Categories/XCUIDevice+FBHealthCheck.h +30 -0
- package/WebDriverAgentLib/Categories/XCUIDevice+FBHealthCheck.m +47 -0
- package/WebDriverAgentLib/Categories/XCUIDevice+FBHelpers.h +236 -0
- package/WebDriverAgentLib/Categories/XCUIDevice+FBHelpers.m +478 -0
- package/WebDriverAgentLib/Categories/XCUIDevice+FBHinge.h +41 -0
- package/WebDriverAgentLib/Categories/XCUIDevice+FBHinge.m +215 -0
- package/WebDriverAgentLib/Categories/XCUIDevice+FBRotation.h +46 -0
- package/WebDriverAgentLib/Categories/XCUIDevice+FBRotation.m +108 -0
- package/WebDriverAgentLib/Categories/XCUIDevice+FBVoiceOver.h +66 -0
- package/WebDriverAgentLib/Categories/XCUIDevice+FBVoiceOver.m +218 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBAccessibility.h +29 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBAccessibility.m +50 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBCaching.h +19 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBCaching.m +36 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBClassChain.h +57 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBClassChain.m +239 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBCustomActions.h +27 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBCustomActions.m +127 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBFind.h +75 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBFind.m +146 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBForceTouch.h +38 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBForceTouch.m +55 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBIsVisible.h +28 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBIsVisible.m +78 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBMinMax.h +33 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBMinMax.m +75 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBPickerWheel.h +45 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBPickerWheel.m +59 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBResolve.h +37 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBResolve.m +51 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBScrolling.h +98 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBScrolling.m +465 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBSwiping.h +38 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBSwiping.m +56 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.h +35 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m +71 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBTyping.h +97 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBTyping.m +233 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBUID.h +42 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBUID.m +85 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.h +108 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.m +175 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBVisibleFrame.h +35 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBVisibleFrame.m +61 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.h +32 -0
- package/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.m +299 -0
- package/WebDriverAgentLib/Categories/XCUIElementQuery+FBHelpers.h +28 -0
- package/WebDriverAgentLib/Categories/XCUIElementQuery+FBHelpers.m +47 -0
- package/WebDriverAgentLib/Commands/AxeAuthCommands.h +30 -0
- package/WebDriverAgentLib/Commands/AxeAuthCommands.m +175 -0
- package/WebDriverAgentLib/Commands/AxeAutoScanCommands.h +19 -0
- package/WebDriverAgentLib/Commands/AxeAutoScanCommands.m +143 -0
- package/WebDriverAgentLib/Commands/AxeProductDeclaration.h +21 -0
- package/WebDriverAgentLib/Commands/AxeProductDeclaration.m +40 -0
- package/WebDriverAgentLib/Commands/AxeReportCommands.h +20 -0
- package/WebDriverAgentLib/Commands/AxeReportCommands.m +62 -0
- package/WebDriverAgentLib/Commands/AxeScanCommands.h +20 -0
- package/WebDriverAgentLib/Commands/AxeScanCommands.m +386 -0
- package/WebDriverAgentLib/Commands/AxeUsageCommands.h +27 -0
- package/WebDriverAgentLib/Commands/AxeUsageCommands.m +90 -0
- package/WebDriverAgentLib/Commands/FBAlertViewCommands.h +19 -0
- package/WebDriverAgentLib/Commands/FBAlertViewCommands.m +104 -0
- package/WebDriverAgentLib/Commands/FBCustomCommands.h +19 -0
- package/WebDriverAgentLib/Commands/FBCustomCommands.m +848 -0
- package/WebDriverAgentLib/Commands/FBDebugCommands.h +19 -0
- package/WebDriverAgentLib/Commands/FBDebugCommands.m +81 -0
- package/WebDriverAgentLib/Commands/FBElementCommands.h +19 -0
- package/WebDriverAgentLib/Commands/FBElementCommands.m +775 -0
- package/WebDriverAgentLib/Commands/FBFindElementCommands.h +18 -0
- package/WebDriverAgentLib/Commands/FBFindElementCommands.m +186 -0
- package/WebDriverAgentLib/Commands/FBOrientationCommands.h +19 -0
- package/WebDriverAgentLib/Commands/FBOrientationCommands.m +192 -0
- package/WebDriverAgentLib/Commands/FBScreenshotCommands.h +19 -0
- package/WebDriverAgentLib/Commands/FBScreenshotCommands.m +40 -0
- package/WebDriverAgentLib/Commands/FBSessionCommands.h +19 -0
- package/WebDriverAgentLib/Commands/FBSessionCommands.m +519 -0
- package/WebDriverAgentLib/Commands/FBTouchActionCommands.h +19 -0
- package/WebDriverAgentLib/Commands/FBTouchActionCommands.m +41 -0
- package/WebDriverAgentLib/Commands/FBTouchIDCommands.h +19 -0
- package/WebDriverAgentLib/Commands/FBTouchIDCommands.m +30 -0
- package/WebDriverAgentLib/Commands/FBUnknownCommands.h +19 -0
- package/WebDriverAgentLib/Commands/FBUnknownCommands.m +39 -0
- package/WebDriverAgentLib/Commands/FBVideoCommands.h +19 -0
- package/WebDriverAgentLib/Commands/FBVideoCommands.m +84 -0
- package/WebDriverAgentLib/FBAlert.h +104 -0
- package/WebDriverAgentLib/FBAlert.m +454 -0
- package/WebDriverAgentLib/Info.plist +26 -0
- package/WebDriverAgentLib/Routing/FBCommandHandler.h +38 -0
- package/WebDriverAgentLib/Routing/FBCommandStatus.h +80 -0
- package/WebDriverAgentLib/Routing/FBCommandStatus.m +279 -0
- package/WebDriverAgentLib/Routing/FBElement.h +98 -0
- package/WebDriverAgentLib/Routing/FBElementCache.h +61 -0
- package/WebDriverAgentLib/Routing/FBElementCache.m +100 -0
- package/WebDriverAgentLib/Routing/FBElementUtils.h +76 -0
- package/WebDriverAgentLib/Routing/FBElementUtils.m +153 -0
- package/WebDriverAgentLib/Routing/FBExceptionHandler.h +29 -0
- package/WebDriverAgentLib/Routing/FBExceptionHandler.m +65 -0
- package/WebDriverAgentLib/Routing/FBExceptions.h +69 -0
- package/WebDriverAgentLib/Routing/FBExceptions.m +27 -0
- package/WebDriverAgentLib/Routing/FBHTTPServer.h +97 -0
- package/WebDriverAgentLib/Routing/FBHTTPServer.m +955 -0
- package/WebDriverAgentLib/Routing/FBHTTPStatusCodes.h +581 -0
- package/WebDriverAgentLib/Routing/FBResponseJSONPayload.h +29 -0
- package/WebDriverAgentLib/Routing/FBResponseJSONPayload.m +58 -0
- package/WebDriverAgentLib/Routing/FBResponsePayload.h +74 -0
- package/WebDriverAgentLib/Routing/FBResponsePayload.m +148 -0
- package/WebDriverAgentLib/Routing/FBRoute.h +86 -0
- package/WebDriverAgentLib/Routing/FBRoute.m +183 -0
- package/WebDriverAgentLib/Routing/FBRouteRequest-Private.h +20 -0
- package/WebDriverAgentLib/Routing/FBRouteRequest.h +39 -0
- package/WebDriverAgentLib/Routing/FBRouteRequest.m +32 -0
- package/WebDriverAgentLib/Routing/FBScreenRecordingContainer.h +65 -0
- package/WebDriverAgentLib/Routing/FBScreenRecordingContainer.m +88 -0
- package/WebDriverAgentLib/Routing/FBScreenRecordingPromise.h +29 -0
- package/WebDriverAgentLib/Routing/FBScreenRecordingPromise.m +31 -0
- package/WebDriverAgentLib/Routing/FBScreenRecordingRequest.h +39 -0
- package/WebDriverAgentLib/Routing/FBScreenRecordingRequest.m +99 -0
- package/WebDriverAgentLib/Routing/FBSession-Private.h +26 -0
- package/WebDriverAgentLib/Routing/FBSession.h +179 -0
- package/WebDriverAgentLib/Routing/FBSession.m +575 -0
- package/WebDriverAgentLib/Routing/FBTCPSocket.h +117 -0
- package/WebDriverAgentLib/Routing/FBTCPSocket.m +244 -0
- package/WebDriverAgentLib/Routing/FBWebServer.h +68 -0
- package/WebDriverAgentLib/Routing/FBWebServer.m +306 -0
- package/WebDriverAgentLib/Routing/FBXCAccessibilityElement.h +34 -0
- package/WebDriverAgentLib/Routing/FBXCAccessibilityElement.m +17 -0
- package/WebDriverAgentLib/Routing/FBXCDeviceEvent.h +34 -0
- package/WebDriverAgentLib/Routing/FBXCDeviceEvent.m +42 -0
- package/WebDriverAgentLib/Routing/FBXCElementSnapshot.h +82 -0
- package/WebDriverAgentLib/Routing/FBXCElementSnapshot.m +9 -0
- package/WebDriverAgentLib/Routing/FBXCElementSnapshotWrapper.h +29 -0
- package/WebDriverAgentLib/Routing/FBXCElementSnapshotWrapper.m +114 -0
- package/WebDriverAgentLib/Routing/RouteRequest.h +28 -0
- package/WebDriverAgentLib/Routing/RouteRequest.m +25 -0
- package/WebDriverAgentLib/Routing/RouteResponse.h +30 -0
- package/WebDriverAgentLib/Routing/RouteResponse.m +54 -0
- package/WebDriverAgentLib/Utilities/FBAccessibilityTraits.h +20 -0
- package/WebDriverAgentLib/Utilities/FBAccessibilityTraits.m +61 -0
- package/WebDriverAgentLib/Utilities/FBActiveAppDetectionPoint.h +56 -0
- package/WebDriverAgentLib/Utilities/FBActiveAppDetectionPoint.m +115 -0
- package/WebDriverAgentLib/Utilities/FBAlertsMonitor.h +51 -0
- package/WebDriverAgentLib/Utilities/FBAlertsMonitor.m +110 -0
- package/WebDriverAgentLib/Utilities/FBBaseActionsSynthesizer.h +132 -0
- package/WebDriverAgentLib/Utilities/FBBaseActionsSynthesizer.m +165 -0
- package/WebDriverAgentLib/Utilities/FBCapabilities.h +43 -0
- package/WebDriverAgentLib/Utilities/FBCapabilities.m +24 -0
- package/WebDriverAgentLib/Utilities/FBClassChainQueryParser.h +99 -0
- package/WebDriverAgentLib/Utilities/FBClassChainQueryParser.m +666 -0
- package/WebDriverAgentLib/Utilities/FBConfiguration.h +379 -0
- package/WebDriverAgentLib/Utilities/FBConfiguration.m +476 -0
- package/WebDriverAgentLib/Utilities/FBDebugLogDelegateDecorator.h +26 -0
- package/WebDriverAgentLib/Utilities/FBDebugLogDelegateDecorator.m +49 -0
- package/WebDriverAgentLib/Utilities/FBElementHelpers.h +29 -0
- package/WebDriverAgentLib/Utilities/FBElementHelpers.m +21 -0
- package/WebDriverAgentLib/Utilities/FBElementTypeTransformer.h +45 -0
- package/WebDriverAgentLib/Utilities/FBElementTypeTransformer.m +149 -0
- package/WebDriverAgentLib/Utilities/FBErrorBuilder.h +64 -0
- package/WebDriverAgentLib/Utilities/FBErrorBuilder.m +75 -0
- package/WebDriverAgentLib/Utilities/FBFailureProofTestCase.h +19 -0
- package/WebDriverAgentLib/Utilities/FBFailureProofTestCase.m +74 -0
- package/WebDriverAgentLib/Utilities/FBImageProcessor.h +55 -0
- package/WebDriverAgentLib/Utilities/FBImageProcessor.m +197 -0
- package/WebDriverAgentLib/Utilities/FBImageUtils.h +25 -0
- package/WebDriverAgentLib/Utilities/FBImageUtils.m +80 -0
- package/WebDriverAgentLib/Utilities/FBKeyboard.h +37 -0
- package/WebDriverAgentLib/Utilities/FBKeyboard.m +123 -0
- package/WebDriverAgentLib/Utilities/FBLogger.h +32 -0
- package/WebDriverAgentLib/Utilities/FBLogger.m +47 -0
- package/WebDriverAgentLib/Utilities/FBMacros.h +66 -0
- package/WebDriverAgentLib/Utilities/FBMathUtils.h +100 -0
- package/WebDriverAgentLib/Utilities/FBMathUtils.m +147 -0
- package/WebDriverAgentLib/Utilities/FBMjpegServer.h +36 -0
- package/WebDriverAgentLib/Utilities/FBMjpegServer.m +248 -0
- package/WebDriverAgentLib/Utilities/FBNotificationsHelper.h +37 -0
- package/WebDriverAgentLib/Utilities/FBNotificationsHelper.m +29 -0
- package/WebDriverAgentLib/Utilities/FBPasteboard.h +40 -0
- package/WebDriverAgentLib/Utilities/FBPasteboard.m +176 -0
- package/WebDriverAgentLib/Utilities/FBProtocolHelpers.h +46 -0
- package/WebDriverAgentLib/Utilities/FBProtocolHelpers.m +144 -0
- package/WebDriverAgentLib/Utilities/FBReflectionUtils.h +23 -0
- package/WebDriverAgentLib/Utilities/FBReflectionUtils.m +31 -0
- package/WebDriverAgentLib/Utilities/FBRunLoopSpinner.h +77 -0
- package/WebDriverAgentLib/Utilities/FBRunLoopSpinner.m +94 -0
- package/WebDriverAgentLib/Utilities/FBRuntimeUtils.h +79 -0
- package/WebDriverAgentLib/Utilities/FBRuntimeUtils.m +112 -0
- package/WebDriverAgentLib/Utilities/FBScreen.h +49 -0
- package/WebDriverAgentLib/Utilities/FBScreen.m +128 -0
- package/WebDriverAgentLib/Utilities/FBScreenshot.h +44 -0
- package/WebDriverAgentLib/Utilities/FBScreenshot.m +231 -0
- package/WebDriverAgentLib/Utilities/FBSettings.h +51 -0
- package/WebDriverAgentLib/Utilities/FBSettings.m +45 -0
- package/WebDriverAgentLib/Utilities/FBSettingsHandler.h +35 -0
- package/WebDriverAgentLib/Utilities/FBSettingsHandler.m +398 -0
- package/WebDriverAgentLib/Utilities/FBTVNavigationTracker-Private.h +37 -0
- package/WebDriverAgentLib/Utilities/FBTVNavigationTracker.h +77 -0
- package/WebDriverAgentLib/Utilities/FBTVNavigationTracker.m +177 -0
- package/WebDriverAgentLib/Utilities/FBUnattachedAppLauncher.h +26 -0
- package/WebDriverAgentLib/Utilities/FBUnattachedAppLauncher.m +21 -0
- package/WebDriverAgentLib/Utilities/FBW3CActionsHelpers.h +42 -0
- package/WebDriverAgentLib/Utilities/FBW3CActionsHelpers.m +119 -0
- package/WebDriverAgentLib/Utilities/FBW3CActionsSynthesizer.h +19 -0
- package/WebDriverAgentLib/Utilities/FBW3CActionsSynthesizer.m +1011 -0
- package/WebDriverAgentLib/Utilities/FBWebServerParams.h +22 -0
- package/WebDriverAgentLib/Utilities/FBWebServerParams.m +23 -0
- package/WebDriverAgentLib/Utilities/FBXCAXClientProxy.h +171 -0
- package/WebDriverAgentLib/Utilities/FBXCAXClientProxy.m +240 -0
- package/WebDriverAgentLib/Utilities/FBXCTestDaemonsProxy.h +45 -0
- package/WebDriverAgentLib/Utilities/FBXCTestDaemonsProxy.m +362 -0
- package/WebDriverAgentLib/Utilities/FBXCodeCompatibility.h +73 -0
- package/WebDriverAgentLib/Utilities/FBXCodeCompatibility.m +129 -0
- package/WebDriverAgentLib/Utilities/FBXMLGenerationOptions.h +45 -0
- package/WebDriverAgentLib/Utilities/FBXMLGenerationOptions.m +25 -0
- package/WebDriverAgentLib/Utilities/FBXPath-Private.h +61 -0
- package/WebDriverAgentLib/Utilities/FBXPath.h +59 -0
- package/WebDriverAgentLib/Utilities/FBXPath.m +1087 -0
- package/WebDriverAgentLib/Utilities/FBXPathExtensions.h +40 -0
- package/WebDriverAgentLib/Utilities/FBXPathExtensions.m +418 -0
- package/WebDriverAgentLib/Utilities/LRUCache/LRUCache.h +66 -0
- package/WebDriverAgentLib/Utilities/LRUCache/LRUCache.m +149 -0
- package/WebDriverAgentLib/Utilities/LRUCache/LRUCacheNode.h +43 -0
- package/WebDriverAgentLib/Utilities/LRUCache/LRUCacheNode.m +51 -0
- package/WebDriverAgentLib/Utilities/NSPredicate+FBFormat.h +42 -0
- package/WebDriverAgentLib/Utilities/NSPredicate+FBFormat.m +69 -0
- package/WebDriverAgentLib/Utilities/XCTestPrivateSymbols.h +78 -0
- package/WebDriverAgentLib/Utilities/XCTestPrivateSymbols.m +127 -0
- package/WebDriverAgentLib/Utilities/XCUIApplicationProcessDelay.h +37 -0
- package/WebDriverAgentLib/Utilities/XCUIApplicationProcessDelay.m +83 -0
- package/WebDriverAgentLib/WebDriverAgentLib.h +61 -0
- package/WebDriverAgentRunner/Assets.xcassets/AppIcon.appiconset/Contents.json +14 -0
- package/WebDriverAgentRunner/Assets.xcassets/AppIcon.appiconset/icon-1024.png +0 -0
- package/WebDriverAgentRunner/Assets.xcassets/Contents.json +6 -0
- package/WebDriverAgentRunner/Info.plist +30 -0
- package/WebDriverAgentRunner/UITestingUITests.m +58 -0
- package/WebDriverAgentTests/IntegrationApp/COORDINATE_PROBE.md +52 -0
- package/WebDriverAgentTests/IntegrationApp/Classes/AppDelegate.h +14 -0
- package/WebDriverAgentTests/IntegrationApp/Classes/AppDelegate.m +38 -0
- package/WebDriverAgentTests/IntegrationApp/Classes/FBAlertViewController.h +14 -0
- package/WebDriverAgentTests/IntegrationApp/Classes/FBAlertViewController.m +82 -0
- package/WebDriverAgentTests/IntegrationApp/Classes/FBCoordinateProbeViewController.h +4 -0
- package/WebDriverAgentTests/IntegrationApp/Classes/FBCoordinateProbeViewController.m +194 -0
- package/WebDriverAgentTests/IntegrationApp/Classes/FBNavigationController.h +12 -0
- package/WebDriverAgentTests/IntegrationApp/Classes/FBNavigationController.m +25 -0
- package/WebDriverAgentTests/IntegrationApp/Classes/FBScrollViewController.h +13 -0
- package/WebDriverAgentTests/IntegrationApp/Classes/FBScrollViewController.m +52 -0
- package/WebDriverAgentTests/IntegrationApp/Classes/FBTableDataSource.h +16 -0
- package/WebDriverAgentTests/IntegrationApp/Classes/FBTableDataSource.m +35 -0
- package/WebDriverAgentTests/IntegrationApp/Classes/SceneDelegate.h +20 -0
- package/WebDriverAgentTests/IntegrationApp/Classes/SceneDelegate.m +81 -0
- package/WebDriverAgentTests/IntegrationApp/Classes/TouchSpotView.h +17 -0
- package/WebDriverAgentTests/IntegrationApp/Classes/TouchSpotView.m +28 -0
- package/WebDriverAgentTests/IntegrationApp/Classes/TouchViewController.h +23 -0
- package/WebDriverAgentTests/IntegrationApp/Classes/TouchViewController.m +29 -0
- package/WebDriverAgentTests/IntegrationApp/Classes/TouchableView.h +30 -0
- package/WebDriverAgentTests/IntegrationApp/Classes/TouchableView.m +119 -0
- package/WebDriverAgentTests/IntegrationApp/Classes/ViewController.h +12 -0
- package/WebDriverAgentTests/IntegrationApp/Classes/ViewController.m +144 -0
- package/WebDriverAgentTests/IntegrationApp/Info.plist +71 -0
- package/WebDriverAgentTests/IntegrationApp/Resources/Base.lproj/Main.storyboard +650 -0
- package/WebDriverAgentTests/IntegrationApp/main.m +15 -0
- package/WebDriverAgentTests/IntegrationApp_tvOS/AppDelegate.h +13 -0
- package/WebDriverAgentTests/IntegrationApp_tvOS/AppDelegate.m +26 -0
- package/WebDriverAgentTests/IntegrationApp_tvOS/Info.plist +41 -0
- package/WebDriverAgentTests/IntegrationApp_tvOS/SceneDelegate.h +15 -0
- package/WebDriverAgentTests/IntegrationApp_tvOS/SceneDelegate.m +22 -0
- package/WebDriverAgentTests/IntegrationApp_tvOS/ViewController.h +13 -0
- package/WebDriverAgentTests/IntegrationApp_tvOS/ViewController.m +79 -0
- package/WebDriverAgentTests/IntegrationApp_tvOS/main.m +17 -0
- package/WebDriverAgentTests/IntegrationApp_watchOS/ContentView.swift +31 -0
- package/WebDriverAgentTests/IntegrationApp_watchOS/WatchSpikeApp.swift +18 -0
- package/WebDriverAgentTests/IntegrationTests/FBAlertTests.m +175 -0
- package/WebDriverAgentTests/IntegrationTests/FBAutoAlertsHandlerTests.m +79 -0
- package/WebDriverAgentTests/IntegrationTests/FBConfigurationTests.m +123 -0
- package/WebDriverAgentTests/IntegrationTests/FBDisplayGestureTests.m +541 -0
- package/WebDriverAgentTests/IntegrationTests/FBElementAttributeTests.m +273 -0
- package/WebDriverAgentTests/IntegrationTests/FBElementSwipingTests.m +222 -0
- package/WebDriverAgentTests/IntegrationTests/FBElementVisibilityTests.m +68 -0
- package/WebDriverAgentTests/IntegrationTests/FBFailureProofTestCaseTests.m +41 -0
- package/WebDriverAgentTests/IntegrationTests/FBForceTouchTests.m +88 -0
- package/WebDriverAgentTests/IntegrationTests/FBImageProcessorTests.m +116 -0
- package/WebDriverAgentTests/IntegrationTests/FBIntegrationAppTests.m +87 -0
- package/WebDriverAgentTests/IntegrationTests/FBIntegrationTestCase.h +101 -0
- package/WebDriverAgentTests/IntegrationTests/FBIntegrationTestCase.m +176 -0
- package/WebDriverAgentTests/IntegrationTests/FBKeyboardTests.m +61 -0
- package/WebDriverAgentTests/IntegrationTests/FBPasteboardTests.m +92 -0
- package/WebDriverAgentTests/IntegrationTests/FBPickerWheelSelectTests.m +55 -0
- package/WebDriverAgentTests/IntegrationTests/FBSafariAlertTests.m +77 -0
- package/WebDriverAgentTests/IntegrationTests/FBScreenTests.m +450 -0
- package/WebDriverAgentTests/IntegrationTests/FBScrollingTests.m +123 -0
- package/WebDriverAgentTests/IntegrationTests/FBSessionIntegrationTests.m +228 -0
- package/WebDriverAgentTests/IntegrationTests/FBTapTest.m +186 -0
- package/WebDriverAgentTests/IntegrationTests/FBTestMacros.h +33 -0
- package/WebDriverAgentTests/IntegrationTests/FBTypingTest.m +68 -0
- package/WebDriverAgentTests/IntegrationTests/FBVideoRecordingTests.m +63 -0
- package/WebDriverAgentTests/IntegrationTests/FBVoiceOverTests.m +103 -0
- package/WebDriverAgentTests/IntegrationTests/FBW3CMultiTouchActionsIntegrationTests.m +159 -0
- package/WebDriverAgentTests/IntegrationTests/FBW3CTouchActionsIntegrationTests.m +700 -0
- package/WebDriverAgentTests/IntegrationTests/FBW3CTypeActionsTests.m +184 -0
- package/WebDriverAgentTests/IntegrationTests/FBXPathIntegrationTests.m +260 -0
- package/WebDriverAgentTests/IntegrationTests/Info.plist +24 -0
- package/WebDriverAgentTests/IntegrationTests/XCElementSnapshotHelperTests.m +205 -0
- package/WebDriverAgentTests/IntegrationTests/XCElementSnapshotHitPointTests.m +30 -0
- package/WebDriverAgentTests/IntegrationTests/XCUIApplicationHelperTests.m +162 -0
- package/WebDriverAgentTests/IntegrationTests/XCUIDeviceHealthCheckTests.m +27 -0
- package/WebDriverAgentTests/IntegrationTests/XCUIDeviceHelperTests.m +236 -0
- package/WebDriverAgentTests/IntegrationTests/XCUIDeviceRotationTests.m +105 -0
- package/WebDriverAgentTests/IntegrationTests/XCUIElementAttributesTests.m +248 -0
- package/WebDriverAgentTests/IntegrationTests/XCUIElementFBFindTests.m +673 -0
- package/WebDriverAgentTests/IntegrationTests/XCUIElementHelperIntegrationTests.m +51 -0
- package/WebDriverAgentTests/IntegrationTests_tvOS/FBTVFocusIntegrationTests.m +84 -0
- package/WebDriverAgentTests/IntegrationTests_tvOS/Info.plist +24 -0
- package/WebDriverAgentTests/IntegrationTests_watchOS/IntegrationTests_watchOS-Bridging-Header.h +23 -0
- package/WebDriverAgentTests/IntegrationTests_watchOS/WDAAlertIntegrationTests.swift +25 -0
- package/WebDriverAgentTests/IntegrationTests_watchOS/WDAAppLifecycleIntegrationTests.swift +37 -0
- package/WebDriverAgentTests/IntegrationTests_watchOS/WDAClickIntegrationTests.swift +25 -0
- package/WebDriverAgentTests/IntegrationTests_watchOS/WDADeviceIntegrationTests.swift +92 -0
- package/WebDriverAgentTests/IntegrationTests_watchOS/WDAElementAttributeIntegrationTests.swift +39 -0
- package/WebDriverAgentTests/IntegrationTests_watchOS/WDAFindIntegrationTests.swift +101 -0
- package/WebDriverAgentTests/IntegrationTests_watchOS/WDAMjpegStreamingIntegrationTests.swift +81 -0
- package/WebDriverAgentTests/IntegrationTests_watchOS/WDAScreenshotAndSourceIntegrationTests.swift +54 -0
- package/WebDriverAgentTests/IntegrationTests_watchOS/WDATypingIntegrationTests.swift +73 -0
- package/WebDriverAgentTests/IntegrationTests_watchOS/WDAWatchInProcessTestCase.swift +51 -0
- package/WebDriverAgentTests/UnitTests/Doubles/XCElementSnapshotDouble.h +16 -0
- package/WebDriverAgentTests/UnitTests/Doubles/XCElementSnapshotDouble.m +110 -0
- package/WebDriverAgentTests/UnitTests/Doubles/XCUIApplicationDouble.h +17 -0
- package/WebDriverAgentTests/UnitTests/Doubles/XCUIApplicationDouble.m +66 -0
- package/WebDriverAgentTests/UnitTests/Doubles/XCUIElementDouble.h +55 -0
- package/WebDriverAgentTests/UnitTests/Doubles/XCUIElementDouble.m +114 -0
- package/WebDriverAgentTests/UnitTests/FBClassChainTests.m +313 -0
- package/WebDriverAgentTests/UnitTests/FBConfigurationTests.m +72 -0
- package/WebDriverAgentTests/UnitTests/FBCustomCommandsTests.m +144 -0
- package/WebDriverAgentTests/UnitTests/FBElementCacheTests.m +124 -0
- package/WebDriverAgentTests/UnitTests/FBElementTypeTransformerTests.m +45 -0
- package/WebDriverAgentTests/UnitTests/FBElementUtilitiesTests.m +76 -0
- package/WebDriverAgentTests/UnitTests/FBErrorBuilderTests.m +61 -0
- package/WebDriverAgentTests/UnitTests/FBExceptionHandlerTests.m +59 -0
- package/WebDriverAgentTests/UnitTests/FBHTTPServerSessionTests.m +151 -0
- package/WebDriverAgentTests/UnitTests/FBHTTPServerTests.m +458 -0
- package/WebDriverAgentTests/UnitTests/FBLRUCacheTests.m +161 -0
- package/WebDriverAgentTests/UnitTests/FBMathUtilsTests.m +196 -0
- package/WebDriverAgentTests/UnitTests/FBProtocolHelpersTests.m +81 -0
- package/WebDriverAgentTests/UnitTests/FBResponseJSONPayloadTests.m +76 -0
- package/WebDriverAgentTests/UnitTests/FBRouteTests.m +129 -0
- package/WebDriverAgentTests/UnitTests/FBRunLoopSpinnerTests.m +98 -0
- package/WebDriverAgentTests/UnitTests/FBRuntimeUtilsTests.m +45 -0
- package/WebDriverAgentTests/UnitTests/FBSDKVersionTests.m +66 -0
- package/WebDriverAgentTests/UnitTests/FBSessionTests.m +268 -0
- package/WebDriverAgentTests/UnitTests/FBTouchableViewTests.m +121 -0
- package/WebDriverAgentTests/UnitTests/FBXCAXClientProxyTests.m +90 -0
- package/WebDriverAgentTests/UnitTests/FBXMLSafeStringTests.m +35 -0
- package/WebDriverAgentTests/UnitTests/FBXPathTests.m +381 -0
- package/WebDriverAgentTests/UnitTests/Info.plist +24 -0
- package/WebDriverAgentTests/UnitTests/NSDictionaryFBUtf8SafeTests.m +77 -0
- package/WebDriverAgentTests/UnitTests/NSExpressionFBFormatTests.m +60 -0
- package/WebDriverAgentTests/UnitTests/NSPredicateFBFormatTests.m +72 -0
- package/WebDriverAgentTests/UnitTests/XCUIElementHelpersTests.m +50 -0
- package/WebDriverAgentTests/UnitTests_tvOS/Doubles/FBXCAccessibilityElementDouble.h +27 -0
- package/WebDriverAgentTests/UnitTests_tvOS/Doubles/FBXCAccessibilityElementDouble.m +23 -0
- package/WebDriverAgentTests/UnitTests_tvOS/Doubles/FBXCElementSnapshotDouble.h +43 -0
- package/WebDriverAgentTests/UnitTests_tvOS/Doubles/FBXCElementSnapshotDouble.m +24 -0
- package/WebDriverAgentTests/UnitTests_tvOS/Doubles/XCUIElementDouble.h +47 -0
- package/WebDriverAgentTests/UnitTests_tvOS/Doubles/XCUIElementDouble.m +81 -0
- package/WebDriverAgentTests/UnitTests_tvOS/FBTVNavigationTrackerTests.m +134 -0
- package/WebDriverAgentTests/UnitTests_tvOS/Info.plist +24 -0
- package/axeDevToolsXCUI.xcframework/Info.plist +50 -0
- package/axeDevToolsXCUI.xcframework/LICENSE-3RD-PARTY-axe-devtools-ios.md +29 -0
- package/axeDevToolsXCUI.xcframework/axe-devtools-ios-4.3.1.cdx.json +75 -0
- package/axeDevToolsXCUI.xcframework/axe-devtools-ios-4.3.1.spdx.json +67 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/HTMLReportTemplate.html +1912 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Headers/AxeTestBundleObserver.h +55 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Headers/axeDevToolsXCUI-Swift.h +1546 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Headers/axeDevToolsXCUI.h +17 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Info.plist +57 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/LICENSE.md +7 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios.abi.json +34308 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios.private.swiftinterface +927 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios.swiftinterface +927 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/Modules/module.modulemap +10 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64/axeDevToolsXCUI.framework/axeDevToolsXCUI +0 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/HTMLReportTemplate.html +1912 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Headers/AxeTestBundleObserver.h +55 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Headers/axeDevToolsXCUI-Swift.h +3088 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Headers/axeDevToolsXCUI.h +17 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Info.plist +53 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/LICENSE.md +7 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios-simulator.abi.json +34308 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +927 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +927 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/x86_64-apple-ios-simulator.abi.json +34308 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +927 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/axeDevToolsXCUI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +927 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/Modules/module.modulemap +10 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/_CodeSignature/CodeResources +278 -0
- package/axeDevToolsXCUI.xcframework/ios-arm64_x86_64-simulator/axeDevToolsXCUI.framework/axeDevToolsXCUI +0 -0
- package/build/lib/check-dependencies.d.ts +6 -0
- package/build/lib/check-dependencies.d.ts.map +1 -0
- package/build/lib/check-dependencies.js +50 -0
- package/build/lib/check-dependencies.js.map +1 -0
- package/build/lib/constants.d.ts +25 -0
- package/build/lib/constants.d.ts.map +1 -0
- package/build/lib/constants.js +28 -0
- package/build/lib/constants.js.map +1 -0
- package/build/lib/index.d.ts +7 -0
- package/build/lib/index.d.ts.map +1 -0
- package/build/lib/index.js +7 -0
- package/build/lib/index.js.map +1 -0
- package/build/lib/logger.d.ts +2 -0
- package/build/lib/logger.d.ts.map +1 -0
- package/build/lib/logger.js +3 -0
- package/build/lib/logger.js.map +1 -0
- package/build/lib/no-session-proxy.d.ts +7 -0
- package/build/lib/no-session-proxy.d.ts.map +1 -0
- package/build/lib/no-session-proxy.js +17 -0
- package/build/lib/no-session-proxy.js.map +1 -0
- package/build/lib/types.d.ts +206 -0
- package/build/lib/types.d.ts.map +1 -0
- package/build/lib/types.js +2 -0
- package/build/lib/types.js.map +1 -0
- package/build/lib/utils/index.d.ts +11 -0
- package/build/lib/utils/index.d.ts.map +1 -0
- package/build/lib/utils/index.js +13 -0
- package/build/lib/utils/index.js.map +1 -0
- package/build/lib/utils/module.d.ts +25 -0
- package/build/lib/utils/module.d.ts.map +1 -0
- package/build/lib/utils/module.js +47 -0
- package/build/lib/utils/module.js.map +1 -0
- package/build/lib/utils/platform.d.ts +19 -0
- package/build/lib/utils/platform.d.ts.map +1 -0
- package/build/lib/utils/platform.js +32 -0
- package/build/lib/utils/platform.js.map +1 -0
- package/build/lib/utils/processes.d.ts +34 -0
- package/build/lib/utils/processes.d.ts.map +1 -0
- package/build/lib/utils/processes.js +151 -0
- package/build/lib/utils/processes.js.map +1 -0
- package/build/lib/utils/security.d.ts +5 -0
- package/build/lib/utils/security.d.ts.map +1 -0
- package/build/lib/utils/security.js +12 -0
- package/build/lib/utils/security.js.map +1 -0
- package/build/lib/utils/xctestrun.d.ts +51 -0
- package/build/lib/utils/xctestrun.d.ts.map +1 -0
- package/build/lib/utils/xctestrun.js +135 -0
- package/build/lib/utils/xctestrun.js.map +1 -0
- package/build/lib/wda-strategies.d.ts +69 -0
- package/build/lib/wda-strategies.d.ts.map +1 -0
- package/build/lib/wda-strategies.js +247 -0
- package/build/lib/wda-strategies.js.map +1 -0
- package/build/lib/webdriveragent.d.ts +175 -0
- package/build/lib/webdriveragent.d.ts.map +1 -0
- package/build/lib/webdriveragent.js +540 -0
- package/build/lib/webdriveragent.js.map +1 -0
- package/build/lib/xcodebuild.d.ts +98 -0
- package/build/lib/xcodebuild.d.ts.map +1 -0
- package/build/lib/xcodebuild.js +562 -0
- package/build/lib/xcodebuild.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -0
- package/lib/check-dependencies.ts +64 -0
- package/lib/constants.ts +33 -0
- package/lib/index.ts +7 -0
- package/lib/logger.ts +3 -0
- package/lib/no-session-proxy.ts +19 -0
- package/lib/types.ts +238 -0
- package/lib/utils/index.ts +20 -0
- package/lib/utils/module.ts +66 -0
- package/lib/utils/platform.ts +34 -0
- package/lib/utils/processes.ts +174 -0
- package/lib/utils/security.ts +16 -0
- package/lib/utils/xctestrun.ts +188 -0
- package/lib/wda-strategies.ts +343 -0
- package/lib/webdriveragent.ts +642 -0
- package/lib/xcodebuild.ts +678 -0
- package/package.json +114 -3
|
@@ -0,0 +1,244 @@
|
|
|
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 "FBTCPSocket.h"
|
|
10
|
+
|
|
11
|
+
@interface FBTCPSocket()
|
|
12
|
+
@property (readonly, nonatomic) dispatch_queue_t socketQueue;
|
|
13
|
+
@property (nullable, nonatomic) nw_listener_t listener;
|
|
14
|
+
@property (readonly, nonatomic) NSMutableArray<nw_connection_t> *connectedClients;
|
|
15
|
+
@end
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@implementation FBTCPSocket
|
|
19
|
+
|
|
20
|
+
- (instancetype)initWithPort:(uint16_t)port
|
|
21
|
+
{
|
|
22
|
+
if ((self = [super init])) {
|
|
23
|
+
_socketQueue = dispatch_queue_create("socketQueue", NULL);
|
|
24
|
+
_connectedClients = [[NSMutableArray alloc] initWithCapacity:1];
|
|
25
|
+
_port = port;
|
|
26
|
+
_delegate = nil;
|
|
27
|
+
}
|
|
28
|
+
return self;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
- (BOOL)startWithError:(NSError **)error
|
|
32
|
+
{
|
|
33
|
+
nw_parameters_t parameters = nw_parameters_create_secure_tcp(NW_PARAMETERS_DISABLE_PROTOCOL,
|
|
34
|
+
NW_PARAMETERS_DEFAULT_CONFIGURATION);
|
|
35
|
+
NSString *portString = [NSString stringWithFormat:@"%u", (unsigned int)self.port];
|
|
36
|
+
// portString is always valid UTF8; -UTF8String is just declared nullable in general.
|
|
37
|
+
const char * _Nonnull portCString = (const char * _Nonnull)portString.UTF8String;
|
|
38
|
+
|
|
39
|
+
nw_listener_t listener;
|
|
40
|
+
if (nil != self.interface) {
|
|
41
|
+
const char * _Nonnull interfaceCString = (const char * _Nonnull)((NSString * _Nonnull)self.interface).UTF8String;
|
|
42
|
+
nw_endpoint_t localEndpoint = nw_endpoint_create_host(interfaceCString, portCString);
|
|
43
|
+
nw_parameters_set_local_endpoint(parameters, localEndpoint);
|
|
44
|
+
// The port is already encoded in localEndpoint above - do not also pass it to
|
|
45
|
+
// nw_listener_create_with_port, which would be ambiguous.
|
|
46
|
+
listener = nw_listener_create(parameters);
|
|
47
|
+
} else {
|
|
48
|
+
listener = nw_listener_create_with_port(portCString, parameters);
|
|
49
|
+
}
|
|
50
|
+
if (nil == listener) {
|
|
51
|
+
if (error) {
|
|
52
|
+
*error = [NSError errorWithDomain:@"FBTCPSocket"
|
|
53
|
+
code:1
|
|
54
|
+
userInfo:@{NSLocalizedDescriptionKey: @"Failed to create the TCP listener"}];
|
|
55
|
+
}
|
|
56
|
+
return NO;
|
|
57
|
+
}
|
|
58
|
+
self.listener = listener;
|
|
59
|
+
|
|
60
|
+
__weak typeof(self) weakSelf = self;
|
|
61
|
+
nw_listener_set_queue(listener, self.socketQueue);
|
|
62
|
+
nw_listener_set_new_connection_handler(listener, ^(nw_connection_t connection) {
|
|
63
|
+
[weakSelf acceptConnection:connection];
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
dispatch_semaphore_t startupSemaphore = dispatch_semaphore_create(0);
|
|
67
|
+
__block NSError *startupError = nil;
|
|
68
|
+
nw_listener_set_state_changed_handler(listener, ^(nw_listener_state_t state, nw_error_t nwError) {
|
|
69
|
+
// if/else, not switch: -Wswitch-enum, -Wswitch-default, and -Wcovered-switch-default can't
|
|
70
|
+
// all be satisfied by one switch statement at once.
|
|
71
|
+
if (nw_listener_state_ready == state) {
|
|
72
|
+
__strong typeof(weakSelf) strongSelf = weakSelf;
|
|
73
|
+
if (strongSelf) {
|
|
74
|
+
strongSelf->_port = nw_listener_get_port(listener);
|
|
75
|
+
}
|
|
76
|
+
dispatch_semaphore_signal(startupSemaphore);
|
|
77
|
+
} else if (nw_listener_state_failed == state || nw_listener_state_cancelled == state) {
|
|
78
|
+
// NSLocalizedDescriptionKey must be a string, not the underlying NSError itself, or
|
|
79
|
+
// -[NSError localizedDescription] crashes trying to treat it as one.
|
|
80
|
+
NSError *underlyingError = nwError ? (NSError *)CFBridgingRelease(nw_error_copy_cf_error(nwError)) : nil;
|
|
81
|
+
if ([underlyingError.domain isEqualToString:NSPOSIXErrorDomain]) {
|
|
82
|
+
// Surface POSIX errors (e.g. EADDRINUSE) directly, since callers like FBWebServer check
|
|
83
|
+
// for them by domain/code on the top-level error to decide whether to retry another port.
|
|
84
|
+
startupError = underlyingError;
|
|
85
|
+
} else {
|
|
86
|
+
NSMutableDictionary<NSString *, id> *userInfo = [NSMutableDictionary dictionary];
|
|
87
|
+
userInfo[NSLocalizedDescriptionKey] = underlyingError.localizedDescription ?: @"The TCP listener failed to start";
|
|
88
|
+
if (underlyingError) {
|
|
89
|
+
userInfo[NSUnderlyingErrorKey] = underlyingError;
|
|
90
|
+
}
|
|
91
|
+
startupError = [NSError errorWithDomain:@"FBTCPSocket" code:2 userInfo:userInfo];
|
|
92
|
+
}
|
|
93
|
+
dispatch_semaphore_signal(startupSemaphore);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
nw_listener_start(listener);
|
|
97
|
+
BOOL didStartInTime = 0 == dispatch_semaphore_wait(startupSemaphore, dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)));
|
|
98
|
+
if (!didStartInTime) {
|
|
99
|
+
startupError = [NSError errorWithDomain:@"FBTCPSocket"
|
|
100
|
+
code:3
|
|
101
|
+
userInfo:@{NSLocalizedDescriptionKey: @"Timed out while starting the TCP listener"}];
|
|
102
|
+
}
|
|
103
|
+
if (nil != startupError) {
|
|
104
|
+
if (error) {
|
|
105
|
+
*error = startupError;
|
|
106
|
+
}
|
|
107
|
+
// Cancel rather than just dropping our reference - otherwise a late ready/failed callback
|
|
108
|
+
// can still fire and the port stays bound at the OS level even though the caller was told
|
|
109
|
+
// startup failed.
|
|
110
|
+
nw_listener_cancel(listener);
|
|
111
|
+
self.listener = nil;
|
|
112
|
+
return NO;
|
|
113
|
+
}
|
|
114
|
+
return YES;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
- (void)acceptConnection:(nw_connection_t)connection
|
|
118
|
+
{
|
|
119
|
+
@synchronized (self.connectedClients) {
|
|
120
|
+
[self.connectedClients addObject:connection];
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
__weak typeof(self) weakSelf = self;
|
|
124
|
+
nw_connection_set_queue(connection, self.socketQueue);
|
|
125
|
+
nw_connection_set_state_changed_handler(connection, ^(nw_connection_state_t state, nw_error_t connectionError) {
|
|
126
|
+
// Same reasoning as the listener state handler above.
|
|
127
|
+
if (nw_connection_state_ready == state) {
|
|
128
|
+
__strong typeof(weakSelf) strongSelf = weakSelf;
|
|
129
|
+
if (nil == strongSelf) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
id<FBTCPSocketDelegate> delegate = strongSelf.delegate;
|
|
133
|
+
if (nil != delegate) {
|
|
134
|
+
[delegate didClientConnect:connection];
|
|
135
|
+
}
|
|
136
|
+
[strongSelf scheduleReceiveForConnection:connection];
|
|
137
|
+
} else if (nw_connection_state_failed == state || nw_connection_state_cancelled == state) {
|
|
138
|
+
__strong typeof(weakSelf) strongSelf = weakSelf;
|
|
139
|
+
[strongSelf handleDisconnectForConnection:connection];
|
|
140
|
+
// A failed connection keeps its socket until cancelled (a no-op once cancelled).
|
|
141
|
+
nw_connection_cancel(connection);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
nw_connection_start(connection);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
- (void)scheduleReceiveForConnection:(nw_connection_t)connection
|
|
148
|
+
{
|
|
149
|
+
__weak typeof(self) weakSelf = self;
|
|
150
|
+
nw_connection_receive(connection, 1, UINT32_MAX, ^(dispatch_data_t _Nullable content,
|
|
151
|
+
nw_content_context_t _Nullable context,
|
|
152
|
+
bool isComplete,
|
|
153
|
+
nw_error_t _Nullable receiveError) {
|
|
154
|
+
__strong typeof(weakSelf) strongSelf = weakSelf;
|
|
155
|
+
if (nil == strongSelf) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (nil != content) {
|
|
159
|
+
dispatch_data_t nonnullContent = (dispatch_data_t _Nonnull)content;
|
|
160
|
+
NSMutableData *data = [NSMutableData data];
|
|
161
|
+
dispatch_data_apply(nonnullContent, ^bool(dispatch_data_t _Nonnull region, size_t offset, const void * _Nonnull buffer, size_t size) {
|
|
162
|
+
[data appendBytes:buffer length:size];
|
|
163
|
+
return true;
|
|
164
|
+
});
|
|
165
|
+
if (data.length > 0) {
|
|
166
|
+
id<FBTCPSocketDelegate> delegate = strongSelf.delegate;
|
|
167
|
+
if (nil != delegate) {
|
|
168
|
+
[delegate client:connection didReceiveData:data];
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
if (nil != receiveError) {
|
|
173
|
+
[strongSelf handleDisconnectForConnection:connection];
|
|
174
|
+
nw_connection_cancel(connection);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (isComplete && nil == content) {
|
|
178
|
+
// The peer is done sending but may still be reading - a half-closed client awaits its
|
|
179
|
+
// response - so the delegate cancels the connection once it has nothing left to send.
|
|
180
|
+
[strongSelf handleDisconnectForConnection:connection];
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
[strongSelf scheduleReceiveForConnection:connection];
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
- (void)handleDisconnectForConnection:(nw_connection_t)connection
|
|
188
|
+
{
|
|
189
|
+
BOOL wasConnected;
|
|
190
|
+
@synchronized (self.connectedClients) {
|
|
191
|
+
wasConnected = [self.connectedClients containsObject:connection];
|
|
192
|
+
[self.connectedClients removeObject:connection];
|
|
193
|
+
}
|
|
194
|
+
if (wasConnected) {
|
|
195
|
+
id<FBTCPSocketDelegate> delegate = self.delegate;
|
|
196
|
+
if (nil != delegate) {
|
|
197
|
+
[delegate didClientDisconnect:connection];
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
- (void)writeData:(NSData *)data toClient:(nw_connection_t)client
|
|
203
|
+
{
|
|
204
|
+
[self writeData:data toClient:client completion:nil];
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
- (void)writeData:(NSData *)data toClient:(nw_connection_t)client completion:(nullable void (^)(BOOL didSucceed))completion
|
|
208
|
+
{
|
|
209
|
+
dispatch_data_t dispatchData = dispatch_data_create(data.bytes, data.length, self.socketQueue, DISPATCH_DATA_DESTRUCTOR_DEFAULT);
|
|
210
|
+
nw_connection_send(client, dispatchData, NW_CONNECTION_DEFAULT_STREAM_CONTEXT, false, ^(nw_error_t _Nullable sendError) {
|
|
211
|
+
if (completion) {
|
|
212
|
+
// The send error must reach the caller: a failed write means the response never reached
|
|
213
|
+
// the peer, and treating that as success would e.g. let the next pipelined request run
|
|
214
|
+
// against a connection that can no longer answer it.
|
|
215
|
+
completion(nil == sendError);
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
- (void)stop
|
|
221
|
+
{
|
|
222
|
+
NSArray<nw_connection_t> *clients;
|
|
223
|
+
@synchronized (self.connectedClients) {
|
|
224
|
+
clients = self.connectedClients.copy;
|
|
225
|
+
[self.connectedClients removeAllObjects];
|
|
226
|
+
}
|
|
227
|
+
// Cancel on socketQueue, the same queue every connection's send/receive is bound to (see
|
|
228
|
+
// -acceptConnection:), so a write already issued just before -stop (e.g. a shutdown route's
|
|
229
|
+
// response) is processed before the cancellation rather than racing it.
|
|
230
|
+
dispatch_async(self.socketQueue, ^{
|
|
231
|
+
for (nw_connection_t client in clients) {
|
|
232
|
+
nw_connection_cancel(client);
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
self.delegate = nil;
|
|
237
|
+
nw_listener_t listener = self.listener;
|
|
238
|
+
if (nil != listener) {
|
|
239
|
+
nw_listener_cancel((nw_listener_t _Nonnull)listener);
|
|
240
|
+
self.listener = nil;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
@end
|
|
@@ -0,0 +1,68 @@
|
|
|
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 <Foundation/Foundation.h>
|
|
10
|
+
|
|
11
|
+
@class RouteResponse, FBExceptionHandler;
|
|
12
|
+
@protocol FBWebServerDelegate;
|
|
13
|
+
|
|
14
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
HTTP and USB service wrapper, handling requests and responses
|
|
18
|
+
*/
|
|
19
|
+
@interface FBWebServer : NSObject
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
Server delegate.
|
|
23
|
+
*/
|
|
24
|
+
@property (weak, nonatomic) id<FBWebServerDelegate> delegate;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
Starts WebDriverAgent service by booting HTTP and USB server.
|
|
28
|
+
If the HTTP server fails to bind (for example the whole configured port range
|
|
29
|
+
is already occupied), the failure is reported to the delegate via
|
|
30
|
+
`webServer:didFailToStartWithError:`. If the delegate does not implement that
|
|
31
|
+
method the process is aborted, as before.
|
|
32
|
+
*/
|
|
33
|
+
- (void)startServing;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
Stops WebDriverAgent service, shutting down HTTP and USB servers.
|
|
37
|
+
*/
|
|
38
|
+
- (void)stopServing;
|
|
39
|
+
|
|
40
|
+
@end
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
The protocol allowing the server delegate to handle messages from the server.
|
|
44
|
+
*/
|
|
45
|
+
@protocol FBWebServerDelegate <NSObject>
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
The server requested WebDriverAgent service shutdown.
|
|
49
|
+
|
|
50
|
+
@param webServer Server instance.
|
|
51
|
+
*/
|
|
52
|
+
- (void)webServerDidRequestShutdown:(FBWebServer *)webServer;
|
|
53
|
+
|
|
54
|
+
@optional
|
|
55
|
+
/**
|
|
56
|
+
Called when the server failed to start the HTTP listener, for example because
|
|
57
|
+
none of the ports in the configured binding range could be bound.
|
|
58
|
+
If this method is not implemented by the delegate then the process is aborted,
|
|
59
|
+
preserving the previous behavior.
|
|
60
|
+
|
|
61
|
+
@param webServer Server instance.
|
|
62
|
+
@param error The actual error, that caused the server startup to fail.
|
|
63
|
+
*/
|
|
64
|
+
- (void)webServer:(FBWebServer *)webServer didFailToStartWithError:(NSError *)error;
|
|
65
|
+
|
|
66
|
+
@end
|
|
67
|
+
|
|
68
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,306 @@
|
|
|
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 "FBWebServer.h"
|
|
10
|
+
|
|
11
|
+
#import "FBHTTPServer.h"
|
|
12
|
+
#import "FBMjpegServer.h"
|
|
13
|
+
#import "FBTCPSocket.h"
|
|
14
|
+
|
|
15
|
+
#import "FBCommandHandler.h"
|
|
16
|
+
#import "FBCommandStatus.h"
|
|
17
|
+
#import "FBErrorBuilder.h"
|
|
18
|
+
#import "FBExceptionHandler.h"
|
|
19
|
+
#import "FBResponsePayload.h"
|
|
20
|
+
#import "FBRouteRequest.h"
|
|
21
|
+
#import "FBRuntimeUtils.h"
|
|
22
|
+
#import "FBSession.h"
|
|
23
|
+
#import "FBUnknownCommands.h"
|
|
24
|
+
#import "FBConfiguration.h"
|
|
25
|
+
#import "FBLogger.h"
|
|
26
|
+
|
|
27
|
+
#import "XCUIDevice+FBHelpers.h"
|
|
28
|
+
|
|
29
|
+
static NSString *const FBServerURLBeginMarker = @"ServerURLHere->";
|
|
30
|
+
static NSString *const FBServerURLEndMarker = @"<-ServerURLHere";
|
|
31
|
+
|
|
32
|
+
@interface FBWebServer ()
|
|
33
|
+
@property (nonatomic, strong) FBExceptionHandler *exceptionHandler;
|
|
34
|
+
@property (nonatomic, strong) FBHTTPServer *server;
|
|
35
|
+
@property (nonatomic, nullable) FBTCPSocket *screenshotsBroadcaster;
|
|
36
|
+
@property (nonatomic, nullable, strong) FBMjpegServer *mjpegServer;
|
|
37
|
+
@property (atomic, assign) BOOL keepAlive;
|
|
38
|
+
@end
|
|
39
|
+
|
|
40
|
+
@implementation FBWebServer
|
|
41
|
+
|
|
42
|
+
- (void)dealloc
|
|
43
|
+
{
|
|
44
|
+
[self stopScreenshotsBroadcaster];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
+ (NSArray<Class<FBCommandHandler>> *)collectCommandHandlerClasses
|
|
48
|
+
{
|
|
49
|
+
NSArray *handlersClasses = FBClassesThatConformsToProtocol(@protocol(FBCommandHandler));
|
|
50
|
+
NSMutableArray *handlers = [NSMutableArray array];
|
|
51
|
+
for (Class aClass in handlersClasses) {
|
|
52
|
+
if ([aClass respondsToSelector:@selector(shouldRegisterAutomatically)]) {
|
|
53
|
+
if (![aClass shouldRegisterAutomatically]) {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
[handlers addObject:aClass];
|
|
58
|
+
}
|
|
59
|
+
return handlers.copy;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
- (void)startServing
|
|
63
|
+
{
|
|
64
|
+
[FBLogger logFmt:@"Built at %s %s", __DATE__, __TIME__];
|
|
65
|
+
self.exceptionHandler = [FBExceptionHandler new];
|
|
66
|
+
if (![self startHTTPServer]) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
[self initScreenshotsBroadcaster];
|
|
70
|
+
|
|
71
|
+
self.keepAlive = YES;
|
|
72
|
+
NSRunLoop *runLoop = [NSRunLoop mainRunLoop];
|
|
73
|
+
while (self.keepAlive &&
|
|
74
|
+
[runLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
- (BOOL)startHTTPServer
|
|
78
|
+
{
|
|
79
|
+
self.server = [[FBHTTPServer alloc] init];
|
|
80
|
+
[self.server setRouteQueue:dispatch_get_main_queue()];
|
|
81
|
+
[self.server setDefaultHeader:@"Server" value:@"WebDriverAgent/1.0"];
|
|
82
|
+
[self.server setDefaultHeader:@"Access-Control-Allow-Origin" value:@"*"];
|
|
83
|
+
[self.server setDefaultHeader:@"Access-Control-Allow-Headers" value:@"Content-Type, X-Requested-With"];
|
|
84
|
+
|
|
85
|
+
[NSNotificationCenter.defaultCenter addObserver:self
|
|
86
|
+
selector:@selector(sessionWasKilled:)
|
|
87
|
+
name:FBSessionWasKilledNotification
|
|
88
|
+
object:nil];
|
|
89
|
+
|
|
90
|
+
[self registerRouteHandlers:[self.class collectCommandHandlerClasses]];
|
|
91
|
+
[self registerServerKeyRouteHandlers];
|
|
92
|
+
|
|
93
|
+
NSRange serverPortRange = FBConfiguration.sharedInstance.bindingPortRange;
|
|
94
|
+
NSString *bindingIP = FBConfiguration.sharedInstance.bindingIPAddress;
|
|
95
|
+
if (bindingIP != nil) {
|
|
96
|
+
[self.server setInterface:bindingIP];
|
|
97
|
+
[FBLogger logFmt:@"Using custom binding IP address: %@", bindingIP];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
NSError *error;
|
|
101
|
+
BOOL serverStarted = NO;
|
|
102
|
+
|
|
103
|
+
for (NSUInteger index = 0; index < serverPortRange.length; index++) {
|
|
104
|
+
NSInteger port = serverPortRange.location + index;
|
|
105
|
+
[self.server setPort:(UInt16)port];
|
|
106
|
+
|
|
107
|
+
serverStarted = [self attemptToStartServer:self.server onPort:port withError:&error];
|
|
108
|
+
if (serverStarted) {
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
[FBLogger logFmt:@"Failed to start web server on port %ld with error %@", (long)port, [error description]];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (!serverStarted) {
|
|
116
|
+
[FBLogger logFmt:@"Last attempt to start web server failed with error %@", [error description]];
|
|
117
|
+
id<FBWebServerDelegate> delegate = self.delegate;
|
|
118
|
+
if ([delegate respondsToSelector:@selector(webServer:didFailToStartWithError:)]) {
|
|
119
|
+
[delegate webServer:self didFailToStartWithError:(NSError * _Nonnull)error];
|
|
120
|
+
return NO;
|
|
121
|
+
}
|
|
122
|
+
abort();
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
NSString *serverHost = bindingIP ?: ([XCUIDevice sharedDevice].fb_wifiIPAddress ?: @"127.0.0.1");
|
|
126
|
+
[FBLogger logFmt:@"%@http://%@:%d%@", FBServerURLBeginMarker, serverHost, [self.server port], FBServerURLEndMarker];
|
|
127
|
+
return YES;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
- (void)initScreenshotsBroadcaster
|
|
131
|
+
{
|
|
132
|
+
[self readMjpegSettingsFromEnv];
|
|
133
|
+
self.mjpegServer = [[FBMjpegServer alloc] init];
|
|
134
|
+
self.screenshotsBroadcaster = [[FBTCPSocket alloc]
|
|
135
|
+
initWithPort:(uint16_t)FBConfiguration.sharedInstance.mjpegServerPort];
|
|
136
|
+
// Bind to the same address as the HTTP server when USE_IP is set.
|
|
137
|
+
// nil (the default) keeps listening on all interfaces.
|
|
138
|
+
self.screenshotsBroadcaster.interface = FBConfiguration.sharedInstance.bindingIPAddress;
|
|
139
|
+
self.mjpegServer.socket = self.screenshotsBroadcaster;
|
|
140
|
+
self.screenshotsBroadcaster.delegate = self.mjpegServer;
|
|
141
|
+
NSError *error;
|
|
142
|
+
if (![self.screenshotsBroadcaster startWithError:&error]) {
|
|
143
|
+
[FBLogger logFmt:@"Cannot init screenshots broadcaster service on port %@. Original error: %@", @(FBConfiguration.sharedInstance.mjpegServerPort), error.description];
|
|
144
|
+
[self.mjpegServer stopStreaming];
|
|
145
|
+
self.mjpegServer = nil;
|
|
146
|
+
self.screenshotsBroadcaster = nil;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
- (void)stopScreenshotsBroadcaster
|
|
151
|
+
{
|
|
152
|
+
if (nil == self.screenshotsBroadcaster) {
|
|
153
|
+
self.mjpegServer = nil;
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
id<FBTCPSocketDelegate> delegate = self.screenshotsBroadcaster.delegate;
|
|
158
|
+
if ([(NSObject *)delegate respondsToSelector:@selector(stopStreaming)]) {
|
|
159
|
+
[(FBMjpegServer *)delegate stopStreaming];
|
|
160
|
+
}
|
|
161
|
+
self.screenshotsBroadcaster.delegate = nil;
|
|
162
|
+
[self.screenshotsBroadcaster stop];
|
|
163
|
+
self.screenshotsBroadcaster = nil;
|
|
164
|
+
self.mjpegServer = nil;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
- (void)readMjpegSettingsFromEnv
|
|
168
|
+
{
|
|
169
|
+
NSDictionary *env = NSProcessInfo.processInfo.environment;
|
|
170
|
+
NSString *scalingFactor = [env objectForKey:@"MJPEG_SCALING_FACTOR"];
|
|
171
|
+
if (scalingFactor != nil && [scalingFactor length] > 0) {
|
|
172
|
+
FBConfiguration.sharedInstance.mjpegScalingFactor = [scalingFactor floatValue];
|
|
173
|
+
}
|
|
174
|
+
NSString *screenshotQuality = [env objectForKey:@"MJPEG_SERVER_SCREENSHOT_QUALITY"];
|
|
175
|
+
if (screenshotQuality != nil && [screenshotQuality length] > 0) {
|
|
176
|
+
FBConfiguration.sharedInstance.mjpegServerScreenshotQuality = [screenshotQuality integerValue];
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
- (void)sessionWasKilled:(NSNotification *)notification
|
|
181
|
+
{
|
|
182
|
+
FBSession *session = notification.object;
|
|
183
|
+
if (![session isKindOfClass:FBSession.class]) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
// Same "invalid session id" shape a still-queued request would eventually get anyway, once
|
|
187
|
+
// -routeQueue drains and FBRoute.decorateRequest: finds the session gone - just delivered now
|
|
188
|
+
// instead of after however long the request would otherwise have been stuck waiting.
|
|
189
|
+
NSString *message = [NSString stringWithFormat:@"Session %@ was deleted while this request was still pending", session.identifier];
|
|
190
|
+
id<FBResponsePayload> payload = FBResponseWithStatus([FBCommandStatus noSuchDriverErrorWithMessage:message
|
|
191
|
+
traceback:nil]);
|
|
192
|
+
RouteResponse *response = [RouteResponse new];
|
|
193
|
+
[payload dispatchWithResponse:response];
|
|
194
|
+
[self.server abandonPendingRequestsForSessionID:session.identifier withResponse:response];
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
- (void)stopServing
|
|
198
|
+
{
|
|
199
|
+
[NSNotificationCenter.defaultCenter removeObserver:self name:FBSessionWasKilledNotification object:nil];
|
|
200
|
+
[FBSession.activeSession kill];
|
|
201
|
+
[self stopScreenshotsBroadcaster];
|
|
202
|
+
if (self.server.isRunning) {
|
|
203
|
+
[self.server stop:NO];
|
|
204
|
+
}
|
|
205
|
+
self.server = nil;
|
|
206
|
+
self.exceptionHandler = nil;
|
|
207
|
+
self.keepAlive = NO;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
- (BOOL)attemptToStartServer:(FBHTTPServer *)server onPort:(NSInteger)port withError:(NSError **)error
|
|
211
|
+
{
|
|
212
|
+
server.port = (UInt16)port;
|
|
213
|
+
NSError *innerError = nil;
|
|
214
|
+
BOOL started = [server start:&innerError];
|
|
215
|
+
if (!started) {
|
|
216
|
+
if (!error) {
|
|
217
|
+
return NO;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
NSString *description = @"Unknown Error when Starting server";
|
|
221
|
+
if ([innerError.domain isEqualToString:NSPOSIXErrorDomain] && innerError.code == EADDRINUSE) {
|
|
222
|
+
description = [NSString stringWithFormat:@"Unable to start web server on port %ld", (long)port];
|
|
223
|
+
}
|
|
224
|
+
return
|
|
225
|
+
[[[[FBErrorBuilder builder]
|
|
226
|
+
withDescription:description]
|
|
227
|
+
withInnerError:innerError]
|
|
228
|
+
buildError:error];
|
|
229
|
+
}
|
|
230
|
+
return YES;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
- (void)registerRouteHandlers:(NSArray *)commandHandlerClasses
|
|
234
|
+
{
|
|
235
|
+
__weak typeof(self) weakSelf = self;
|
|
236
|
+
for (Class<FBCommandHandler> commandHandler in commandHandlerClasses) {
|
|
237
|
+
NSArray *routes = [commandHandler routes];
|
|
238
|
+
for (FBRoute *route in routes) {
|
|
239
|
+
[self.server handleMethod:route.verb withPath:route.path standalone:route.isStandalone block:^(RouteRequest *request, RouteResponse *response) {
|
|
240
|
+
__strong typeof(weakSelf) strongSelf = weakSelf;
|
|
241
|
+
if (nil == strongSelf) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
NSDictionary *arguments = [NSJSONSerialization JSONObjectWithData:request.body options:NSJSONReadingMutableContainers error:NULL];
|
|
245
|
+
FBRouteRequest *routeParams = [FBRouteRequest
|
|
246
|
+
routeRequestWithURL:request.url
|
|
247
|
+
parameters:request.params
|
|
248
|
+
arguments:arguments ?: @{}
|
|
249
|
+
];
|
|
250
|
+
|
|
251
|
+
[FBLogger verboseLog:routeParams.description];
|
|
252
|
+
|
|
253
|
+
@try {
|
|
254
|
+
[route mountRequest:routeParams intoResponse:response];
|
|
255
|
+
}
|
|
256
|
+
@catch (NSException *exception) {
|
|
257
|
+
[strongSelf handleException:exception forResponse:response];
|
|
258
|
+
}
|
|
259
|
+
}];
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
- (void)handleException:(NSException *)exception forResponse:(RouteResponse *)response
|
|
265
|
+
{
|
|
266
|
+
[self.exceptionHandler handleException:exception forResponse:response];
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
- (void)registerServerKeyRouteHandlers
|
|
270
|
+
{
|
|
271
|
+
[self.server handleMethod:@"GET" withPath:@"/health" standalone:YES block:^(RouteRequest *request, RouteResponse *response) {
|
|
272
|
+
[response respondWithString:@"<!DOCTYPE html><html><title>Health Check</title><body><p>I-AM-ALIVE</p></body></html>"];
|
|
273
|
+
}];
|
|
274
|
+
|
|
275
|
+
// Deprecated: no longer needed since appium-xcuitest-driver handles calibration
|
|
276
|
+
// itself (https://github.com/appium/appium-xcuitest-driver/pull/2948). Kept for
|
|
277
|
+
// backward compatibility; will be removed in a future major release.
|
|
278
|
+
NSString *calibrationPage = @"<html>"
|
|
279
|
+
"<title>{\"x\":null,\"y\":null}</title>"
|
|
280
|
+
"<header>"
|
|
281
|
+
"<script>document.addEventListener(\"click\",function(e){document.title=JSON.stringify({x:e.clientX,y:e.clientY})})</script>"
|
|
282
|
+
"</header>"
|
|
283
|
+
"</html>";
|
|
284
|
+
[self.server get:@"/calibrate" withBlock:^(RouteRequest *request, RouteResponse *response) {
|
|
285
|
+
[FBLogger logFmt:@"The /calibrate endpoint is deprecated and will be removed in a future release"];
|
|
286
|
+
[response respondWithString:calibrationPage];
|
|
287
|
+
}];
|
|
288
|
+
|
|
289
|
+
__weak typeof(self) weakSelf = self;
|
|
290
|
+
[self.server get:@"/wda/shutdown" withBlock:^(RouteRequest *request, RouteResponse *response) {
|
|
291
|
+
__strong typeof(weakSelf) strongSelf = weakSelf;
|
|
292
|
+
if (nil == strongSelf) {
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
[response respondWithString:@"Shutting down"];
|
|
296
|
+
// Deferred so the "Shutting down" response is written to the client before
|
|
297
|
+
// webServerDidRequestShutdown: tears down the server's socket out from under it.
|
|
298
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
299
|
+
[strongSelf.delegate webServerDidRequestShutdown:strongSelf];
|
|
300
|
+
});
|
|
301
|
+
}];
|
|
302
|
+
|
|
303
|
+
[self registerRouteHandlers:@[FBUnknownCommands.class]];
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
@end
|
|
@@ -0,0 +1,34 @@
|
|
|
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 <XCTest/XCTest.h>
|
|
10
|
+
|
|
11
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
12
|
+
|
|
13
|
+
@protocol FBXCAccessibilityElement <NSObject>
|
|
14
|
+
|
|
15
|
+
@property(readonly) id payload; // @synthesize payload=_payload;
|
|
16
|
+
@property(readonly) int processIdentifier; // @synthesize processIdentifier=_processIdentifier;
|
|
17
|
+
@property(readonly) const struct __AXUIElement *AXUIElement; // @synthesize AXUIElement=_axElement;
|
|
18
|
+
@property(readonly, getter=isNative) BOOL native;
|
|
19
|
+
|
|
20
|
+
+ (id)elementWithAXUIElement:(struct __AXUIElement *)arg1;
|
|
21
|
+
+ (id)elementWithProcessIdentifier:(int)arg1;
|
|
22
|
+
+ (id)deviceElement;
|
|
23
|
+
+ (id)mockElementWithProcessIdentifier:(int)arg1 payload:(id)arg2;
|
|
24
|
+
+ (id)mockElementWithProcessIdentifier:(int)arg1;
|
|
25
|
+
|
|
26
|
+
- (id)initWithMockProcessIdentifier:(int)arg1 payload:(id)arg2;
|
|
27
|
+
- (id)initWithAXUIElement:(struct __AXUIElement *)arg1;
|
|
28
|
+
- (id)init;
|
|
29
|
+
|
|
30
|
+
@end
|
|
31
|
+
|
|
32
|
+
BOOL FBIsAXElementEqualToOther(id<FBXCAccessibilityElement> first, id<FBXCAccessibilityElement> second);
|
|
33
|
+
|
|
34
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,17 @@
|
|
|
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 "FBXCAccessibilityElement.h"
|
|
10
|
+
|
|
11
|
+
#import "FBElementUtils.h"
|
|
12
|
+
|
|
13
|
+
BOOL FBIsAXElementEqualToOther(id<FBXCAccessibilityElement> first, id<FBXCAccessibilityElement> second)
|
|
14
|
+
{
|
|
15
|
+
return nil != second && [[FBElementUtils uidWithAccessibilityElement:first]
|
|
16
|
+
isEqualToString:([FBElementUtils uidWithAccessibilityElement:second] ?: @"")];
|
|
17
|
+
}
|