@deque/axe-appium3-webdriveragent 0.0.0-stage → 1.7.0
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,398 @@
|
|
|
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 "FBSettingsHandler.h"
|
|
10
|
+
|
|
11
|
+
#import "FBActiveAppDetectionPoint.h"
|
|
12
|
+
#import "FBClassChainQueryParser.h"
|
|
13
|
+
#import "FBCommandStatus.h"
|
|
14
|
+
#import "FBConfiguration.h"
|
|
15
|
+
#import "FBScreen.h"
|
|
16
|
+
#import "FBSession.h"
|
|
17
|
+
#import "FBSettings.h"
|
|
18
|
+
|
|
19
|
+
typedef FBCommandStatus * _Nullable (^FBSettingApplyBlock)(FBSession *session, id value);
|
|
20
|
+
typedef id _Nonnull (^FBSettingGetBlock)(FBSession *session);
|
|
21
|
+
|
|
22
|
+
static id FBNormalizedSettingValue(id value)
|
|
23
|
+
{
|
|
24
|
+
return value == NSNull.null ? nil : value;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
static NSSet<NSString *> *FBNilClearableSettingKeys(void)
|
|
28
|
+
{
|
|
29
|
+
static NSSet<NSString *> *keys;
|
|
30
|
+
static dispatch_once_t onceToken;
|
|
31
|
+
dispatch_once(&onceToken, ^{
|
|
32
|
+
keys = [NSSet setWithObjects:
|
|
33
|
+
FB_SETTING_DEFAULT_ALERT_ACTION,
|
|
34
|
+
FB_SETTING_ACCEPT_ALERT_BUTTON_SELECTOR,
|
|
35
|
+
FB_SETTING_DISMISS_ALERT_BUTTON_SELECTOR,
|
|
36
|
+
FB_SETTING_AUTO_CLICK_ALERT_SELECTOR,
|
|
37
|
+
FB_SETTING_CURRENT_DISPLAY_ID,
|
|
38
|
+
nil];
|
|
39
|
+
});
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@implementation FBSettingsHandler
|
|
44
|
+
|
|
45
|
+
+ (NSDictionary<NSString *, FBSettingApplyBlock> *)settersMap
|
|
46
|
+
{
|
|
47
|
+
static NSDictionary<NSString *, FBSettingApplyBlock> *settersMap;
|
|
48
|
+
static dispatch_once_t onceToken;
|
|
49
|
+
dispatch_once(&onceToken, ^{
|
|
50
|
+
NSMutableDictionary<NSString *, FBSettingApplyBlock> *map = [NSMutableDictionary dictionary];
|
|
51
|
+
map[FB_SETTING_USE_COMPACT_RESPONSES] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
52
|
+
FBConfiguration.sharedInstance.shouldUseCompactResponses = [value boolValue];
|
|
53
|
+
return nil;
|
|
54
|
+
};
|
|
55
|
+
map[FB_SETTING_ELEMENT_RESPONSE_ATTRIBUTES] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
56
|
+
FBConfiguration.sharedInstance.elementResponseAttributes = (NSString *)value;
|
|
57
|
+
return nil;
|
|
58
|
+
};
|
|
59
|
+
map[FB_SETTING_MJPEG_SERVER_SCREENSHOT_QUALITY] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
60
|
+
FBConfiguration.sharedInstance.mjpegServerScreenshotQuality = [value unsignedIntegerValue];
|
|
61
|
+
return nil;
|
|
62
|
+
};
|
|
63
|
+
map[FB_SETTING_MJPEG_SERVER_FRAMERATE] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
64
|
+
FBConfiguration.sharedInstance.mjpegServerFramerate = [value unsignedIntegerValue];
|
|
65
|
+
return nil;
|
|
66
|
+
};
|
|
67
|
+
map[FB_SETTING_SCREENSHOT_QUALITY] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
68
|
+
FBConfiguration.sharedInstance.screenshotQuality = [value unsignedIntegerValue];
|
|
69
|
+
return nil;
|
|
70
|
+
};
|
|
71
|
+
map[FB_SETTING_MJPEG_SCALING_FACTOR] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
72
|
+
FBConfiguration.sharedInstance.mjpegScalingFactor = [value floatValue];
|
|
73
|
+
return nil;
|
|
74
|
+
};
|
|
75
|
+
map[FB_SETTING_MJPEG_FIX_ORIENTATION] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
76
|
+
FBConfiguration.sharedInstance.mjpegShouldFixOrientation = [value boolValue];
|
|
77
|
+
return nil;
|
|
78
|
+
};
|
|
79
|
+
map[FB_SETTING_KEYBOARD_AUTOCORRECTION] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
80
|
+
FBConfiguration.sharedInstance.keyboardAutocorrection = [value boolValue]
|
|
81
|
+
? FBConfigurationKeyboardPreferenceEnabled
|
|
82
|
+
: FBConfigurationKeyboardPreferenceDisabled;
|
|
83
|
+
return nil;
|
|
84
|
+
};
|
|
85
|
+
map[FB_SETTING_KEYBOARD_PREDICTION] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
86
|
+
FBConfiguration.sharedInstance.keyboardPrediction = [value boolValue]
|
|
87
|
+
? FBConfigurationKeyboardPreferenceEnabled
|
|
88
|
+
: FBConfigurationKeyboardPreferenceDisabled;
|
|
89
|
+
return nil;
|
|
90
|
+
};
|
|
91
|
+
map[FB_SETTING_RESPECT_SYSTEM_ALERTS] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
92
|
+
FBConfiguration.sharedInstance.shouldRespectSystemAlerts = [value boolValue];
|
|
93
|
+
return nil;
|
|
94
|
+
};
|
|
95
|
+
map[FB_SETTING_SNAPSHOT_MAX_DEPTH] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
96
|
+
FBConfiguration.sharedInstance.snapshotMaxDepth = [value intValue];
|
|
97
|
+
return nil;
|
|
98
|
+
};
|
|
99
|
+
map[FB_SETTING_SNAPSHOT_MAX_CHILDREN] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
100
|
+
FBConfiguration.sharedInstance.snapshotMaxChildren = [value intValue];
|
|
101
|
+
return nil;
|
|
102
|
+
};
|
|
103
|
+
map[FB_SETTING_USE_FIRST_MATCH] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
104
|
+
FBConfiguration.sharedInstance.useFirstMatch = [value boolValue];
|
|
105
|
+
return nil;
|
|
106
|
+
};
|
|
107
|
+
map[FB_SETTING_BOUND_ELEMENTS_BY_INDEX] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
108
|
+
FBConfiguration.sharedInstance.boundElementsByIndex = [value boolValue];
|
|
109
|
+
return nil;
|
|
110
|
+
};
|
|
111
|
+
map[FB_SETTING_REDUCE_MOTION] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
112
|
+
FBConfiguration.sharedInstance.reduceMotionEnabled = [value boolValue];
|
|
113
|
+
return nil;
|
|
114
|
+
};
|
|
115
|
+
map[FB_SETTING_DEFAULT_ACTIVE_APPLICATION] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
116
|
+
session.defaultActiveApplication = (NSString *)value;
|
|
117
|
+
return nil;
|
|
118
|
+
};
|
|
119
|
+
map[FB_SETTING_ACTIVE_APP_DETECTION_POINT] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
120
|
+
NSError *error;
|
|
121
|
+
if (![FBActiveAppDetectionPoint.sharedInstance setCoordinatesWithString:(NSString *)value
|
|
122
|
+
error:&error]) {
|
|
123
|
+
return [FBCommandStatus invalidArgumentErrorWithMessage:error.localizedDescription
|
|
124
|
+
traceback:nil];
|
|
125
|
+
}
|
|
126
|
+
return nil;
|
|
127
|
+
};
|
|
128
|
+
map[FB_SETTING_ACCEPT_ALERT_BUTTON_SELECTOR] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
129
|
+
FBConfiguration.sharedInstance.acceptAlertButtonSelector = (NSString *)value;
|
|
130
|
+
return nil;
|
|
131
|
+
};
|
|
132
|
+
map[FB_SETTING_DISMISS_ALERT_BUTTON_SELECTOR] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
133
|
+
FBConfiguration.sharedInstance.dismissAlertButtonSelector = (NSString *)value;
|
|
134
|
+
return nil;
|
|
135
|
+
};
|
|
136
|
+
map[FB_SETTING_AUTO_CLICK_ALERT_SELECTOR] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
137
|
+
return [self configureAutoClickAlertWithSelector:(NSString *)value forSession:session];
|
|
138
|
+
};
|
|
139
|
+
map[FB_SETTING_WAIT_FOR_IDLE_TIMEOUT] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
140
|
+
FBConfiguration.sharedInstance.waitForIdleTimeout = [value doubleValue];
|
|
141
|
+
return nil;
|
|
142
|
+
};
|
|
143
|
+
map[FB_SETTING_ANIMATION_COOL_OFF_TIMEOUT] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
144
|
+
FBConfiguration.sharedInstance.animationCoolOffTimeout = [value doubleValue];
|
|
145
|
+
return nil;
|
|
146
|
+
};
|
|
147
|
+
map[FB_SETTING_ACCESSIBILITY_DEADLINE] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
148
|
+
FBConfiguration.sharedInstance.accessibilityDeadline = [value doubleValue];
|
|
149
|
+
return nil;
|
|
150
|
+
};
|
|
151
|
+
map[FB_SETTING_DEFAULT_ALERT_ACTION] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
152
|
+
if (nil == value) {
|
|
153
|
+
session.defaultAlertAction = nil;
|
|
154
|
+
} else if ([value isKindOfClass:NSString.class]) {
|
|
155
|
+
session.defaultAlertAction = [(NSString *)value lowercaseString];
|
|
156
|
+
}
|
|
157
|
+
return nil;
|
|
158
|
+
};
|
|
159
|
+
map[FB_SETTING_MAX_TYPING_FREQUENCY] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
160
|
+
FBConfiguration.sharedInstance.maxTypingFrequency = [value unsignedIntegerValue];
|
|
161
|
+
return nil;
|
|
162
|
+
};
|
|
163
|
+
map[FB_SETTING_USE_CLEAR_TEXT_SHORTCUT] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
164
|
+
FBConfiguration.sharedInstance.useClearTextShortcut = [value boolValue];
|
|
165
|
+
return nil;
|
|
166
|
+
};
|
|
167
|
+
map[FB_SETTING_INCLUDE_HITTABLE_IN_PAGE_SOURCE] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
168
|
+
FBConfiguration.sharedInstance.includeHittableInPageSource = [value boolValue];
|
|
169
|
+
return nil;
|
|
170
|
+
};
|
|
171
|
+
map[FB_SETTING_INCLUDE_NATIVE_FRAME_IN_PAGE_SOURCE] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
172
|
+
FBConfiguration.sharedInstance.includeNativeFrameInPageSource = [value boolValue];
|
|
173
|
+
return nil;
|
|
174
|
+
};
|
|
175
|
+
map[FB_SETTING_INCLUDE_NATIVE_ACCESSIBILITY_ELEMENT_IN_PAGE_SOURCE] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
176
|
+
FBConfiguration.sharedInstance.includeNativeAccessibilityElementInPageSource = [value boolValue];
|
|
177
|
+
return nil;
|
|
178
|
+
};
|
|
179
|
+
map[FB_SETTING_INCLUDE_MIN_MAX_VALUE_IN_PAGE_SOURCE] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
180
|
+
FBConfiguration.sharedInstance.includeMinMaxValueInPageSource = [value boolValue];
|
|
181
|
+
return nil;
|
|
182
|
+
};
|
|
183
|
+
map[FB_SETTING_INCLUDE_CUSTOM_ACTIONS_IN_PAGE_SOURCE] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
184
|
+
FBConfiguration.sharedInstance.includeCustomActionsInPageSource = [value boolValue];
|
|
185
|
+
return nil;
|
|
186
|
+
};
|
|
187
|
+
map[FB_SETTING_ENFORCE_CUSTOM_SNAPSHOTS] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
188
|
+
FBConfiguration.sharedInstance.enforceCustomSnapshots = [value boolValue];
|
|
189
|
+
return nil;
|
|
190
|
+
};
|
|
191
|
+
map[FB_SETTING_LIMIT_XPATH_CONTEXT_SCOPE] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
192
|
+
FBConfiguration.sharedInstance.limitXpathContextScope = [value boolValue];
|
|
193
|
+
return nil;
|
|
194
|
+
};
|
|
195
|
+
map[FB_SETTING_CURRENT_DISPLAY_ID] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
196
|
+
if (nil == value) {
|
|
197
|
+
FBConfiguration.sharedInstance.currentDisplayId = nil;
|
|
198
|
+
return nil;
|
|
199
|
+
}
|
|
200
|
+
if (![value isKindOfClass:NSNumber.class]
|
|
201
|
+
|| CFGetTypeID((__bridge CFTypeRef)value) == CFBooleanGetTypeID()
|
|
202
|
+
|| [value compare:@([value longLongValue])] != NSOrderedSame) {
|
|
203
|
+
return [FBCommandStatus invalidArgumentErrorWithMessage:@"currentDisplayId must be an integer display id returned by /wda/screens"
|
|
204
|
+
traceback:nil];
|
|
205
|
+
}
|
|
206
|
+
NSError *error;
|
|
207
|
+
if (nil == [FBScreen screenWithDisplayID:[value longLongValue] error:&error]) {
|
|
208
|
+
return [FBCommandStatus invalidArgumentErrorWithMessage:error.localizedDescription
|
|
209
|
+
traceback:nil];
|
|
210
|
+
}
|
|
211
|
+
FBConfiguration.sharedInstance.currentDisplayId = @([value longLongValue]);
|
|
212
|
+
return nil;
|
|
213
|
+
};
|
|
214
|
+
#if !TARGET_OS_TV && !TARGET_OS_WATCH
|
|
215
|
+
map[FB_SETTING_SCREENSHOT_ORIENTATION] = ^FBCommandStatus *(FBSession *session, id value) {
|
|
216
|
+
NSError *error;
|
|
217
|
+
if (![FBConfiguration.sharedInstance setScreenshotOrientation:(NSString *)value error:&error]) {
|
|
218
|
+
return [FBCommandStatus invalidArgumentErrorWithMessage:error.localizedDescription
|
|
219
|
+
traceback:nil];
|
|
220
|
+
}
|
|
221
|
+
return nil;
|
|
222
|
+
};
|
|
223
|
+
#endif
|
|
224
|
+
settersMap = map.copy;
|
|
225
|
+
});
|
|
226
|
+
return settersMap;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
+ (NSDictionary<NSString *, FBSettingGetBlock> *)gettersMap
|
|
230
|
+
{
|
|
231
|
+
static NSDictionary<NSString *, FBSettingGetBlock> *gettersMap;
|
|
232
|
+
static dispatch_once_t onceToken;
|
|
233
|
+
dispatch_once(&onceToken, ^{
|
|
234
|
+
NSMutableDictionary<NSString *, FBSettingGetBlock> *map = [NSMutableDictionary dictionary];
|
|
235
|
+
map[FB_SETTING_USE_COMPACT_RESPONSES] = ^id(FBSession *session) {
|
|
236
|
+
return @(FBConfiguration.sharedInstance.shouldUseCompactResponses);
|
|
237
|
+
};
|
|
238
|
+
map[FB_SETTING_ELEMENT_RESPONSE_ATTRIBUTES] = ^id(FBSession *session) {
|
|
239
|
+
return FBConfiguration.sharedInstance.elementResponseAttributes;
|
|
240
|
+
};
|
|
241
|
+
map[FB_SETTING_MJPEG_SERVER_SCREENSHOT_QUALITY] = ^id(FBSession *session) {
|
|
242
|
+
return @(FBConfiguration.sharedInstance.mjpegServerScreenshotQuality);
|
|
243
|
+
};
|
|
244
|
+
map[FB_SETTING_MJPEG_SERVER_FRAMERATE] = ^id(FBSession *session) {
|
|
245
|
+
return @(FBConfiguration.sharedInstance.mjpegServerFramerate);
|
|
246
|
+
};
|
|
247
|
+
map[FB_SETTING_MJPEG_SCALING_FACTOR] = ^id(FBSession *session) {
|
|
248
|
+
return @(FBConfiguration.sharedInstance.mjpegScalingFactor);
|
|
249
|
+
};
|
|
250
|
+
map[FB_SETTING_MJPEG_FIX_ORIENTATION] = ^id(FBSession *session) {
|
|
251
|
+
return @(FBConfiguration.sharedInstance.mjpegShouldFixOrientation);
|
|
252
|
+
};
|
|
253
|
+
map[FB_SETTING_SCREENSHOT_QUALITY] = ^id(FBSession *session) {
|
|
254
|
+
return @(FBConfiguration.sharedInstance.screenshotQuality);
|
|
255
|
+
};
|
|
256
|
+
map[FB_SETTING_KEYBOARD_AUTOCORRECTION] = ^id(FBSession *session) {
|
|
257
|
+
return @(FBConfiguration.sharedInstance.keyboardAutocorrection);
|
|
258
|
+
};
|
|
259
|
+
map[FB_SETTING_KEYBOARD_PREDICTION] = ^id(FBSession *session) {
|
|
260
|
+
return @(FBConfiguration.sharedInstance.keyboardPrediction);
|
|
261
|
+
};
|
|
262
|
+
map[FB_SETTING_SNAPSHOT_MAX_DEPTH] = ^id(FBSession *session) {
|
|
263
|
+
return @(FBConfiguration.sharedInstance.snapshotMaxDepth);
|
|
264
|
+
};
|
|
265
|
+
map[FB_SETTING_SNAPSHOT_MAX_CHILDREN] = ^id(FBSession *session) {
|
|
266
|
+
return @(FBConfiguration.sharedInstance.snapshotMaxChildren);
|
|
267
|
+
};
|
|
268
|
+
map[FB_SETTING_USE_FIRST_MATCH] = ^id(FBSession *session) {
|
|
269
|
+
return @(FBConfiguration.sharedInstance.useFirstMatch);
|
|
270
|
+
};
|
|
271
|
+
map[FB_SETTING_WAIT_FOR_IDLE_TIMEOUT] = ^id(FBSession *session) {
|
|
272
|
+
return @(FBConfiguration.sharedInstance.waitForIdleTimeout);
|
|
273
|
+
};
|
|
274
|
+
map[FB_SETTING_ANIMATION_COOL_OFF_TIMEOUT] = ^id(FBSession *session) {
|
|
275
|
+
return @(FBConfiguration.sharedInstance.animationCoolOffTimeout);
|
|
276
|
+
};
|
|
277
|
+
map[FB_SETTING_ACCESSIBILITY_DEADLINE] = ^id(FBSession *session) {
|
|
278
|
+
return @(FBConfiguration.sharedInstance.accessibilityDeadline);
|
|
279
|
+
};
|
|
280
|
+
map[FB_SETTING_BOUND_ELEMENTS_BY_INDEX] = ^id(FBSession *session) {
|
|
281
|
+
return @(FBConfiguration.sharedInstance.boundElementsByIndex);
|
|
282
|
+
};
|
|
283
|
+
map[FB_SETTING_REDUCE_MOTION] = ^id(FBSession *session) {
|
|
284
|
+
return @(FBConfiguration.sharedInstance.reduceMotionEnabled);
|
|
285
|
+
};
|
|
286
|
+
map[FB_SETTING_DEFAULT_ACTIVE_APPLICATION] = ^id(FBSession *session) {
|
|
287
|
+
return session.defaultActiveApplication;
|
|
288
|
+
};
|
|
289
|
+
map[FB_SETTING_ACTIVE_APP_DETECTION_POINT] = ^id(FBSession *session) {
|
|
290
|
+
return FBActiveAppDetectionPoint.sharedInstance.stringCoordinates;
|
|
291
|
+
};
|
|
292
|
+
map[FB_SETTING_ACCEPT_ALERT_BUTTON_SELECTOR] = ^id(FBSession *session) {
|
|
293
|
+
return FBConfiguration.sharedInstance.acceptAlertButtonSelector;
|
|
294
|
+
};
|
|
295
|
+
map[FB_SETTING_DISMISS_ALERT_BUTTON_SELECTOR] = ^id(FBSession *session) {
|
|
296
|
+
return FBConfiguration.sharedInstance.dismissAlertButtonSelector;
|
|
297
|
+
};
|
|
298
|
+
map[FB_SETTING_AUTO_CLICK_ALERT_SELECTOR] = ^id(FBSession *session) {
|
|
299
|
+
return FBConfiguration.sharedInstance.autoClickAlertSelector;
|
|
300
|
+
};
|
|
301
|
+
map[FB_SETTING_DEFAULT_ALERT_ACTION] = ^id(FBSession *session) {
|
|
302
|
+
return session.defaultAlertAction ?: @"";
|
|
303
|
+
};
|
|
304
|
+
map[FB_SETTING_MAX_TYPING_FREQUENCY] = ^id(FBSession *session) {
|
|
305
|
+
return @(FBConfiguration.sharedInstance.maxTypingFrequency);
|
|
306
|
+
};
|
|
307
|
+
map[FB_SETTING_RESPECT_SYSTEM_ALERTS] = ^id(FBSession *session) {
|
|
308
|
+
return @(FBConfiguration.sharedInstance.shouldRespectSystemAlerts);
|
|
309
|
+
};
|
|
310
|
+
map[FB_SETTING_USE_CLEAR_TEXT_SHORTCUT] = ^id(FBSession *session) {
|
|
311
|
+
return @(FBConfiguration.sharedInstance.useClearTextShortcut);
|
|
312
|
+
};
|
|
313
|
+
map[FB_SETTING_INCLUDE_HITTABLE_IN_PAGE_SOURCE] = ^id(FBSession *session) {
|
|
314
|
+
return @(FBConfiguration.sharedInstance.includeHittableInPageSource);
|
|
315
|
+
};
|
|
316
|
+
map[FB_SETTING_INCLUDE_NATIVE_FRAME_IN_PAGE_SOURCE] = ^id(FBSession *session) {
|
|
317
|
+
return @(FBConfiguration.sharedInstance.includeNativeFrameInPageSource);
|
|
318
|
+
};
|
|
319
|
+
map[FB_SETTING_INCLUDE_NATIVE_ACCESSIBILITY_ELEMENT_IN_PAGE_SOURCE] = ^id(FBSession *session) {
|
|
320
|
+
return @(FBConfiguration.sharedInstance.includeNativeAccessibilityElementInPageSource);
|
|
321
|
+
};
|
|
322
|
+
map[FB_SETTING_INCLUDE_MIN_MAX_VALUE_IN_PAGE_SOURCE] = ^id(FBSession *session) {
|
|
323
|
+
return @(FBConfiguration.sharedInstance.includeMinMaxValueInPageSource);
|
|
324
|
+
};
|
|
325
|
+
map[FB_SETTING_INCLUDE_CUSTOM_ACTIONS_IN_PAGE_SOURCE] = ^id(FBSession *session) {
|
|
326
|
+
return @(FBConfiguration.sharedInstance.includeCustomActionsInPageSource);
|
|
327
|
+
};
|
|
328
|
+
map[FB_SETTING_ENFORCE_CUSTOM_SNAPSHOTS] = ^id(FBSession *session) {
|
|
329
|
+
return @(FBConfiguration.sharedInstance.enforceCustomSnapshots);
|
|
330
|
+
};
|
|
331
|
+
map[FB_SETTING_LIMIT_XPATH_CONTEXT_SCOPE] = ^id(FBSession *session) {
|
|
332
|
+
return @(FBConfiguration.sharedInstance.limitXpathContextScope);
|
|
333
|
+
};
|
|
334
|
+
map[FB_SETTING_CURRENT_DISPLAY_ID] = ^id(FBSession *session) {
|
|
335
|
+
return FBConfiguration.sharedInstance.currentDisplayId ?: @([FBScreen displayID]);
|
|
336
|
+
};
|
|
337
|
+
#if !TARGET_OS_TV && !TARGET_OS_WATCH
|
|
338
|
+
map[FB_SETTING_SCREENSHOT_ORIENTATION] = ^id(FBSession *session) {
|
|
339
|
+
return FBConfiguration.sharedInstance.humanReadableScreenshotOrientation;
|
|
340
|
+
};
|
|
341
|
+
#endif
|
|
342
|
+
gettersMap = map.copy;
|
|
343
|
+
});
|
|
344
|
+
return gettersMap;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
+ (NSDictionary *)currentSettingsForSession:(FBSession *)session
|
|
348
|
+
{
|
|
349
|
+
NSDictionary<NSString *, FBSettingGetBlock> *gettersMap = [self gettersMap];
|
|
350
|
+
NSMutableDictionary *settings = [NSMutableDictionary dictionaryWithCapacity:gettersMap.count];
|
|
351
|
+
for (NSString *key in gettersMap) {
|
|
352
|
+
settings[key] = gettersMap[key](session);
|
|
353
|
+
}
|
|
354
|
+
return settings.copy;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
+ (nullable FBCommandStatus *)applySettings:(NSDictionary *)settings toSession:(FBSession *)session
|
|
358
|
+
{
|
|
359
|
+
NSDictionary<NSString *, FBSettingApplyBlock> *settersMap = [self settersMap];
|
|
360
|
+
NSSet<NSString *> *nilClearableKeys = FBNilClearableSettingKeys();
|
|
361
|
+
for (NSString *key in settings) {
|
|
362
|
+
FBSettingApplyBlock handler = settersMap[key];
|
|
363
|
+
if (nil == handler) {
|
|
364
|
+
continue;
|
|
365
|
+
}
|
|
366
|
+
id value = FBNormalizedSettingValue(settings[key]);
|
|
367
|
+
if (nil == value && ![nilClearableKeys containsObject:key]) {
|
|
368
|
+
continue;
|
|
369
|
+
}
|
|
370
|
+
FBCommandStatus *status = handler(session, value);
|
|
371
|
+
if (status.hasError) {
|
|
372
|
+
return status;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
return nil;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
+ (FBCommandStatus *)configureAutoClickAlertWithSelector:(NSString *)selector
|
|
379
|
+
forSession:(FBSession *)session
|
|
380
|
+
{
|
|
381
|
+
if (0 == [selector length]) {
|
|
382
|
+
FBConfiguration.sharedInstance.autoClickAlertSelector = selector;
|
|
383
|
+
[session disableAlertsMonitor];
|
|
384
|
+
return [FBCommandStatus ok];
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
NSError *error;
|
|
388
|
+
FBClassChain *parsedChain = [FBClassChainQueryParser parseQuery:selector error:&error];
|
|
389
|
+
if (nil == parsedChain) {
|
|
390
|
+
return [FBCommandStatus invalidSelectorErrorWithMessage:error.localizedDescription
|
|
391
|
+
traceback:nil];
|
|
392
|
+
}
|
|
393
|
+
FBConfiguration.sharedInstance.autoClickAlertSelector = selector;
|
|
394
|
+
[session enableAlertsMonitor];
|
|
395
|
+
return [FBCommandStatus ok];
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
@end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2018-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
|
+
#import "FBXCElementSnapshot.h"
|
|
11
|
+
|
|
12
|
+
#if TARGET_OS_TV
|
|
13
|
+
|
|
14
|
+
@interface FBTVNavigationItem ()
|
|
15
|
+
@property (nonatomic, readonly) NSString *uid;
|
|
16
|
+
@property (nonatomic, readonly) NSMutableSet<NSNumber *>* directions;
|
|
17
|
+
|
|
18
|
+
+ (instancetype)itemWithUid:(NSString *) uid;
|
|
19
|
+
@end
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@interface FBTVNavigationTracker ()
|
|
23
|
+
|
|
24
|
+
- (FBTVDirection)horizontalDirectionWithItem:(FBTVNavigationItem *)item andDelta:(CGFloat)delta;
|
|
25
|
+
- (FBTVDirection)verticalDirectionWithItem:(FBTVNavigationItem *)item andDelta:(CGFloat)delta;
|
|
26
|
+
- (FBTVDirection)directionWithItem:(FBTVNavigationItem *)item
|
|
27
|
+
delta:(CGFloat)delta
|
|
28
|
+
positiveDirection:(FBTVDirection)positiveDirection
|
|
29
|
+
negativeDirection:(FBTVDirection)negativeDirection;
|
|
30
|
+
|
|
31
|
+
// Exposed for testing: the pure direction-math core of `-pollFocusState:`,
|
|
32
|
+
// parameterized on the already-resolved focused element's snapshot so tests
|
|
33
|
+
// can supply a fake one instead of a live query result.
|
|
34
|
+
- (FBTVDirection)directionTowardsTargetFromFocusedElementSnapshot:(id<FBXCElementSnapshot>)focusedSnapshot;
|
|
35
|
+
@end
|
|
36
|
+
|
|
37
|
+
#endif
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2018-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
|
+
#import <XCTest/XCUIElement.h>
|
|
11
|
+
|
|
12
|
+
#if TARGET_OS_TV
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
Defines directions to move focuse to.
|
|
16
|
+
*/
|
|
17
|
+
typedef NS_ENUM(NSUInteger, FBTVDirection) {
|
|
18
|
+
FBTVDirectionUp = 0,
|
|
19
|
+
FBTVDirectionDown = 1,
|
|
20
|
+
FBTVDirectionLeft = 2,
|
|
21
|
+
FBTVDirectionRight = 3,
|
|
22
|
+
FBTVDirectionNone = 4
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
Represents where the tracked target element currently stands with respect
|
|
27
|
+
to keyboard/remote focus, as of the last `-pollFocusState:` call.
|
|
28
|
+
*/
|
|
29
|
+
typedef NS_ENUM(NSUInteger, FBTVFocusState) {
|
|
30
|
+
// The target element currently has focus
|
|
31
|
+
FBTVFocusStateFocused,
|
|
32
|
+
// The target element could not be located in the accessibility tree anymore
|
|
33
|
+
FBTVFocusStateGone,
|
|
34
|
+
// The target element exists, but does not have focus yet
|
|
35
|
+
FBTVFocusStatePending,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
39
|
+
|
|
40
|
+
@interface FBTVNavigationItem : NSObject
|
|
41
|
+
@end
|
|
42
|
+
|
|
43
|
+
@interface FBTVNavigationTracker : NSObject
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
Track the target element's point
|
|
47
|
+
|
|
48
|
+
@param targetElement A target element which will track
|
|
49
|
+
@return An instancce of FBTVNavigationTracker
|
|
50
|
+
*/
|
|
51
|
+
+ (instancetype)trackerWithTargetElement: (XCUIElement *) targetElement;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
Determines whether the tracked target element currently has focus, whether
|
|
55
|
+
it still exists, and - if neither - which direction the focus should move
|
|
56
|
+
to get closer to it. Each of these is resolved with the cheapest available
|
|
57
|
+
accessibility round trip for what it's checking: `hasFocus`/`exists` are
|
|
58
|
+
single already-known-element checks, and the currently focused element (if
|
|
59
|
+
any) is found via a targeted `hasFocus == true` query rather than a whole-app
|
|
60
|
+
snapshot walk, whose cost scales with total app size/depth instead of with
|
|
61
|
+
the (typically 0-1) number of matches.
|
|
62
|
+
|
|
63
|
+
@param direction Always reset to `FBTVDirectionNone` first, then set to the
|
|
64
|
+
suggested direction to move the focus to when the return value is
|
|
65
|
+
`FBTVFocusStatePending`. It is left as `FBTVDirectionNone` when the return
|
|
66
|
+
value is `FBTVFocusStateFocused`/`FBTVFocusStateGone`, or when the
|
|
67
|
+
currently focused element could not be determined yet - in the latter
|
|
68
|
+
case the caller should just retry on the next iteration.
|
|
69
|
+
@return The current focus state of the tracked target element
|
|
70
|
+
*/
|
|
71
|
+
- (FBTVFocusState)pollFocusState:(FBTVDirection *)direction;
|
|
72
|
+
|
|
73
|
+
@end
|
|
74
|
+
|
|
75
|
+
NS_ASSUME_NONNULL_END
|
|
76
|
+
|
|
77
|
+
#endif
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2018-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 "FBTVNavigationTracker.h"
|
|
10
|
+
#import "FBTVNavigationTracker-Private.h"
|
|
11
|
+
|
|
12
|
+
#import "FBMathUtils.h"
|
|
13
|
+
#import "FBXCElementSnapshotWrapper.h"
|
|
14
|
+
#import "XCUIElement+FBCaching.h"
|
|
15
|
+
#import "XCUIElement+FBUtilities.h"
|
|
16
|
+
#import "XCUIElement+FBWebDriverAttributes.h"
|
|
17
|
+
#import "XCUIApplication+FBHelpers.h"
|
|
18
|
+
|
|
19
|
+
#if TARGET_OS_TV
|
|
20
|
+
|
|
21
|
+
@implementation FBTVNavigationItem
|
|
22
|
+
|
|
23
|
+
+ (instancetype)itemWithUid:(NSString *) uid
|
|
24
|
+
{
|
|
25
|
+
return [[FBTVNavigationItem alloc] initWithUid:uid];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
- (instancetype)initWithUid:(NSString *) uid
|
|
29
|
+
{
|
|
30
|
+
self = [super init];
|
|
31
|
+
if(self) {
|
|
32
|
+
_uid = uid;
|
|
33
|
+
_directions = [NSMutableSet set];
|
|
34
|
+
}
|
|
35
|
+
return self;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@end
|
|
39
|
+
|
|
40
|
+
@interface FBTVNavigationTracker ()
|
|
41
|
+
@property (nonatomic, strong) XCUIElement *targetElement;
|
|
42
|
+
@property (nonatomic, assign) CGPoint targetCenter;
|
|
43
|
+
@property (nonatomic, strong) NSMutableDictionary<NSString *, FBTVNavigationItem* >* navigationItems;
|
|
44
|
+
@end
|
|
45
|
+
|
|
46
|
+
@implementation FBTVNavigationTracker
|
|
47
|
+
|
|
48
|
+
+ (instancetype)trackerWithTargetElement:(XCUIElement *)targetElement
|
|
49
|
+
{
|
|
50
|
+
FBTVNavigationTracker *tracker = [[FBTVNavigationTracker alloc] initWithTargetElement:targetElement];
|
|
51
|
+
tracker.targetElement = targetElement;
|
|
52
|
+
return tracker;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
- (instancetype)initWithTargetElement:(XCUIElement *)targetElement
|
|
56
|
+
{
|
|
57
|
+
self = [super init];
|
|
58
|
+
if (self) {
|
|
59
|
+
_targetElement = targetElement;
|
|
60
|
+
_targetCenter = FBRectGetCenter(targetElement.wdFrame);
|
|
61
|
+
_navigationItems = [NSMutableDictionary dictionary];
|
|
62
|
+
}
|
|
63
|
+
return self;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
- (FBTVFocusState)pollFocusState:(FBTVDirection *)direction
|
|
67
|
+
{
|
|
68
|
+
*direction = FBTVDirectionNone;
|
|
69
|
+
|
|
70
|
+
// `hasFocus`/`exists` are cheap, single-element live checks - each round
|
|
71
|
+
// trip only has to serialize the state of one already-known element, not
|
|
72
|
+
// an unbounded subtree, so there's no snapshot-walk win to be had here.
|
|
73
|
+
if (self.targetElement.hasFocus) {
|
|
74
|
+
return FBTVFocusStateFocused;
|
|
75
|
+
}
|
|
76
|
+
if (!self.targetElement.exists) {
|
|
77
|
+
return FBTVFocusStateGone;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Likewise, a `hasFocus == true` predicate query only has to serialize its
|
|
81
|
+
// (typically 0-1) matches back over the round trip, unlike a whole-app
|
|
82
|
+
// snapshot walk, whose cost scales with total app size/depth.
|
|
83
|
+
XCUIElement *focusedElement = (XCUIElement *)XCUIApplication.fb_activeApplication.fb_focusedElement;
|
|
84
|
+
if (nil == focusedElement) {
|
|
85
|
+
// Nothing is focused yet (e.g. right after the app became active) - let
|
|
86
|
+
// the caller retry on the next iteration.
|
|
87
|
+
return FBTVFocusStatePending;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// The snapshot was already taken as a side effect of resolving the query
|
|
91
|
+
// above, so grab it for free instead of paying for a new round trip.
|
|
92
|
+
id<FBXCElementSnapshot> focusedSnapshot = focusedElement.lastSnapshot
|
|
93
|
+
?: focusedElement.fb_cachedSnapshot
|
|
94
|
+
?: [focusedElement fb_customSnapshot];
|
|
95
|
+
*direction = [self directionTowardsTargetFromFocusedElementSnapshot:focusedSnapshot];
|
|
96
|
+
|
|
97
|
+
return FBTVFocusStatePending;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
- (FBTVDirection)directionTowardsTargetFromFocusedElementSnapshot:(id<FBXCElementSnapshot>)focusedSnapshot
|
|
101
|
+
{
|
|
102
|
+
FBXCElementSnapshotWrapper *focused = [FBXCElementSnapshotWrapper ensureWrapped:focusedSnapshot];
|
|
103
|
+
CGPoint focusedCenter = FBRectGetCenter(focused.wdFrame);
|
|
104
|
+
FBTVNavigationItem *item = [self navigationItemWithElement:focused];
|
|
105
|
+
CGFloat yDelta = self.targetCenter.y - focusedCenter.y;
|
|
106
|
+
CGFloat xDelta = self.targetCenter.x - focusedCenter.x;
|
|
107
|
+
FBTVDirection direction;
|
|
108
|
+
if (fabs(yDelta) > fabs(xDelta)) {
|
|
109
|
+
direction = [self verticalDirectionWithItem:item andDelta:yDelta];
|
|
110
|
+
if (direction == FBTVDirectionNone) {
|
|
111
|
+
direction = [self horizontalDirectionWithItem:item andDelta:xDelta];
|
|
112
|
+
}
|
|
113
|
+
} else {
|
|
114
|
+
direction = [self horizontalDirectionWithItem:item andDelta:xDelta];
|
|
115
|
+
if (direction == FBTVDirectionNone) {
|
|
116
|
+
direction = [self verticalDirectionWithItem:item andDelta:yDelta];
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return direction;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
#pragma mark - Utilities
|
|
123
|
+
- (FBTVNavigationItem*)navigationItemWithElement:(id<FBElement>)element
|
|
124
|
+
{
|
|
125
|
+
NSString *uid = element.wdUID;
|
|
126
|
+
if (nil == uid) {
|
|
127
|
+
return nil;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
FBTVNavigationItem* item = [self.navigationItems objectForKey:uid];
|
|
131
|
+
if (nil != item) {
|
|
132
|
+
return item;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
item = [FBTVNavigationItem itemWithUid:uid];
|
|
136
|
+
[self.navigationItems setObject:item forKey:uid];
|
|
137
|
+
return item;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
- (FBTVDirection)horizontalDirectionWithItem:(FBTVNavigationItem *)item andDelta:(CGFloat)delta
|
|
141
|
+
{
|
|
142
|
+
return [self directionWithItem:item
|
|
143
|
+
delta:delta
|
|
144
|
+
positiveDirection:FBTVDirectionRight
|
|
145
|
+
negativeDirection:FBTVDirectionLeft];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
- (FBTVDirection)verticalDirectionWithItem:(FBTVNavigationItem *)item andDelta:(CGFloat)delta
|
|
149
|
+
{
|
|
150
|
+
return [self directionWithItem:item
|
|
151
|
+
delta:delta
|
|
152
|
+
positiveDirection:FBTVDirectionDown
|
|
153
|
+
negativeDirection:FBTVDirectionUp];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
- (FBTVDirection)directionWithItem:(FBTVNavigationItem *)item
|
|
157
|
+
delta:(CGFloat)delta
|
|
158
|
+
positiveDirection:(FBTVDirection)positiveDirection
|
|
159
|
+
negativeDirection:(FBTVDirection)negativeDirection
|
|
160
|
+
{
|
|
161
|
+
// CGFloat is double in 64bit. tvOS is only for arm64
|
|
162
|
+
NSNumber *positiveDirectionNumber = [NSNumber numberWithInteger:positiveDirection];
|
|
163
|
+
NSNumber *negativeDirectionNumber = [NSNumber numberWithInteger:negativeDirection];
|
|
164
|
+
if (delta > DBL_EPSILON && ![item.directions containsObject:positiveDirectionNumber]) {
|
|
165
|
+
[item.directions addObject:positiveDirectionNumber];
|
|
166
|
+
return positiveDirection;
|
|
167
|
+
}
|
|
168
|
+
if (delta < -DBL_EPSILON && ![item.directions containsObject:negativeDirectionNumber]) {
|
|
169
|
+
[item.directions addObject:negativeDirectionNumber];
|
|
170
|
+
return negativeDirection;
|
|
171
|
+
}
|
|
172
|
+
return FBTVDirectionNone;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
@end
|
|
176
|
+
|
|
177
|
+
#endif
|