@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,674 @@
|
|
|
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 "XCUIApplication+FBHelpers.h"
|
|
10
|
+
|
|
11
|
+
#import "FBActiveAppDetectionPoint.h"
|
|
12
|
+
#import "FBElementTypeTransformer.h"
|
|
13
|
+
#import "FBKeyboard.h"
|
|
14
|
+
#import "FBLogger.h"
|
|
15
|
+
#import "FBExceptions.h"
|
|
16
|
+
#import "FBMacros.h"
|
|
17
|
+
#import "FBMathUtils.h"
|
|
18
|
+
#import "FBRunLoopSpinner.h"
|
|
19
|
+
#import "FBXCodeCompatibility.h"
|
|
20
|
+
#import "FBXPath.h"
|
|
21
|
+
#import "FBXCAccessibilityElement.h"
|
|
22
|
+
#import "FBXCTestDaemonsProxy.h"
|
|
23
|
+
#import "FBXCElementSnapshotWrapper+Helpers.h"
|
|
24
|
+
#import "FBXCAXClientProxy.h"
|
|
25
|
+
#import "FBXMLGenerationOptions.h"
|
|
26
|
+
#import "XCTMessagingChannel_RunnerToDaemon-Protocol.h"
|
|
27
|
+
#import "XCTestPrivateSymbols.h"
|
|
28
|
+
#import "XCTRunnerDaemonSession.h"
|
|
29
|
+
#import "XCUIApplication.h"
|
|
30
|
+
#import "XCUIApplicationImpl.h"
|
|
31
|
+
#import "XCUIApplicationProcess.h"
|
|
32
|
+
#import "XCUIDevice+FBHelpers.h"
|
|
33
|
+
#import "XCUIElement.h"
|
|
34
|
+
#import "XCUIElement+FBCaching.h"
|
|
35
|
+
#import "XCUIElement+FBIsVisible.h"
|
|
36
|
+
#import "XCUIElement+FBUID.h"
|
|
37
|
+
#import "XCUIElement+FBUtilities.h"
|
|
38
|
+
#import "XCUIElement+FBWebDriverAttributes.h"
|
|
39
|
+
#import "XCUIElementQuery.h"
|
|
40
|
+
#import "FBElementHelpers.h"
|
|
41
|
+
|
|
42
|
+
static NSString* const FBUnknownBundleId = @"unknown";
|
|
43
|
+
|
|
44
|
+
static NSString* const FBExclusionAttributeFrame = @"frame";
|
|
45
|
+
static NSString* const FBExclusionAttributeEnabled = @"enabled";
|
|
46
|
+
static NSString* const FBExclusionAttributeVisible = @"visible";
|
|
47
|
+
static NSString* const FBExclusionAttributeAccessible = @"accessible";
|
|
48
|
+
static NSString* const FBExclusionAttributeNativeAccessibilityElement = @"nativeAccessibilityElement";
|
|
49
|
+
static NSString* const FBExclusionAttributeFocused = @"focused";
|
|
50
|
+
static NSString* const FBExclusionAttributePlaceholderValue = @"placeholderValue";
|
|
51
|
+
static NSString* const FBExclusionAttributeNativeFrame = @"nativeFrame";
|
|
52
|
+
static NSString* const FBExclusionAttributeTraits = @"traits";
|
|
53
|
+
static NSString* const FBExclusionAttributeMinValue = @"minValue";
|
|
54
|
+
static NSString* const FBExclusionAttributeMaxValue = @"maxValue";
|
|
55
|
+
|
|
56
|
+
static NSString *FBJsonPrefixedAttributeKey(NSString *key)
|
|
57
|
+
{
|
|
58
|
+
return [NSString stringWithFormat:@"is%@%@",
|
|
59
|
+
[[key substringToIndex:1] uppercaseString],
|
|
60
|
+
[key substringFromIndex:1]];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
_Nullable id extractIssueProperty(id issue, NSString *propertyName) {
|
|
64
|
+
SEL selector = NSSelectorFromString(propertyName);
|
|
65
|
+
NSMethodSignature *methodSignature = [issue methodSignatureForSelector:selector];
|
|
66
|
+
if (nil == methodSignature) {
|
|
67
|
+
return nil;
|
|
68
|
+
}
|
|
69
|
+
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:methodSignature];
|
|
70
|
+
[invocation setSelector:selector];
|
|
71
|
+
[invocation invokeWithTarget:issue];
|
|
72
|
+
id __unsafe_unretained result;
|
|
73
|
+
[invocation getReturnValue:&result];
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
NSDictionary<NSString *, NSNumber *> *auditTypeNamesToValues(void) {
|
|
78
|
+
static dispatch_once_t onceToken;
|
|
79
|
+
static NSDictionary *result;
|
|
80
|
+
dispatch_once(&onceToken, ^{
|
|
81
|
+
// https://developer.apple.com/documentation/xctest/xcuiaccessibilityaudittype?language=objc
|
|
82
|
+
result = @{
|
|
83
|
+
@"XCUIAccessibilityAuditTypeAction": @(1UL << 32),
|
|
84
|
+
@"XCUIAccessibilityAuditTypeAll": @(~0UL),
|
|
85
|
+
@"XCUIAccessibilityAuditTypeContrast": @(1UL << 0),
|
|
86
|
+
@"XCUIAccessibilityAuditTypeDynamicType": @(1UL << 16),
|
|
87
|
+
@"XCUIAccessibilityAuditTypeElementDetection": @(1UL << 1),
|
|
88
|
+
@"XCUIAccessibilityAuditTypeHitRegion": @(1UL << 2),
|
|
89
|
+
@"XCUIAccessibilityAuditTypeParentChild": @(1UL << 33),
|
|
90
|
+
@"XCUIAccessibilityAuditTypeSufficientElementDescription": @(1UL << 3),
|
|
91
|
+
@"XCUIAccessibilityAuditTypeTextClipped": @(1UL << 17),
|
|
92
|
+
@"XCUIAccessibilityAuditTypeTrait": @(1UL << 18),
|
|
93
|
+
};
|
|
94
|
+
});
|
|
95
|
+
return result;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
NSDictionary<NSNumber *, NSString *> *auditTypeValuesToNames(void) {
|
|
99
|
+
static dispatch_once_t onceToken;
|
|
100
|
+
static NSDictionary *result;
|
|
101
|
+
dispatch_once(&onceToken, ^{
|
|
102
|
+
NSMutableDictionary *inverted = [NSMutableDictionary new];
|
|
103
|
+
[auditTypeNamesToValues() enumerateKeysAndObjectsUsingBlock:^(NSString* key, NSNumber *value, BOOL *stop) {
|
|
104
|
+
inverted[value] = key;
|
|
105
|
+
}];
|
|
106
|
+
result = inverted.copy;
|
|
107
|
+
});
|
|
108
|
+
return result;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
NSDictionary<NSString *, NSString *> *customExclusionAttributesMap(void) {
|
|
112
|
+
static dispatch_once_t onceToken;
|
|
113
|
+
static NSDictionary *result;
|
|
114
|
+
dispatch_once(&onceToken, ^{
|
|
115
|
+
result = @{
|
|
116
|
+
FBExclusionAttributeVisible: FB_XCAXAIsVisibleAttributeName,
|
|
117
|
+
FBExclusionAttributeAccessible: FB_XCAXAIsElementAttributeName,
|
|
118
|
+
};
|
|
119
|
+
});
|
|
120
|
+
return result;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@implementation XCUIApplication (FBHelpers)
|
|
124
|
+
|
|
125
|
+
- (BOOL)fb_waitForAppElement:(NSTimeInterval)timeout
|
|
126
|
+
{
|
|
127
|
+
__block BOOL canDetectAxElement = YES;
|
|
128
|
+
int currentProcessIdentifier = [self.accessibilityElement processIdentifier];
|
|
129
|
+
BOOL result = [[[FBRunLoopSpinner new]
|
|
130
|
+
timeout:timeout]
|
|
131
|
+
spinUntilTrue:^BOOL{
|
|
132
|
+
id<FBXCAccessibilityElement> currentAppElement = FBActiveAppDetectionPoint.sharedInstance.axElement;
|
|
133
|
+
canDetectAxElement = nil != currentAppElement;
|
|
134
|
+
if (!canDetectAxElement) {
|
|
135
|
+
return YES;
|
|
136
|
+
}
|
|
137
|
+
return currentAppElement.processIdentifier == currentProcessIdentifier;
|
|
138
|
+
}];
|
|
139
|
+
return canDetectAxElement
|
|
140
|
+
? result
|
|
141
|
+
: [self waitForExistenceWithTimeout:timeout];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
+ (NSArray<NSDictionary<NSString *, id> *> *)fb_appsInfoWithAxElements:(NSArray<id<FBXCAccessibilityElement>> *)axElements
|
|
145
|
+
{
|
|
146
|
+
NSMutableArray<NSDictionary<NSString *, id> *> *result = [NSMutableArray array];
|
|
147
|
+
id<XCTMessagingChannel_RunnerToDaemon> proxy = [FBXCTestDaemonsProxy testRunnerProxy];
|
|
148
|
+
for (id<FBXCAccessibilityElement> axElement in axElements) {
|
|
149
|
+
NSMutableDictionary<NSString *, id> *appInfo = [NSMutableDictionary dictionary];
|
|
150
|
+
pid_t pid = axElement.processIdentifier;
|
|
151
|
+
appInfo[@"pid"] = @(pid);
|
|
152
|
+
__block NSString *bundleId = nil;
|
|
153
|
+
dispatch_semaphore_t sem = dispatch_semaphore_create(0);
|
|
154
|
+
[proxy _XCT_requestBundleIDForPID:pid
|
|
155
|
+
reply:^(NSString *bundleID, NSError *error) {
|
|
156
|
+
if (nil == error) {
|
|
157
|
+
bundleId = bundleID;
|
|
158
|
+
} else {
|
|
159
|
+
[FBLogger logFmt:@"Cannot request the bundle ID for process ID %@: %@", @(pid), error.description];
|
|
160
|
+
}
|
|
161
|
+
dispatch_semaphore_signal(sem);
|
|
162
|
+
}];
|
|
163
|
+
dispatch_semaphore_wait(sem, dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)));
|
|
164
|
+
appInfo[@"bundleId"] = bundleId ?: FBUnknownBundleId;
|
|
165
|
+
[result addObject:appInfo.copy];
|
|
166
|
+
}
|
|
167
|
+
return result.copy;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
+ (NSArray<NSDictionary<NSString *, id> *> *)fb_activeAppsInfo
|
|
171
|
+
{
|
|
172
|
+
return [self fb_appsInfoWithAxElements:[FBXCAXClientProxy.sharedClient activeApplications]];
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
- (BOOL)fb_deactivateWithDuration:(NSTimeInterval)duration error:(NSError **)error
|
|
176
|
+
{
|
|
177
|
+
if(![[XCUIDevice sharedDevice] fb_goToHomescreenWithError:error]) {
|
|
178
|
+
return NO;
|
|
179
|
+
}
|
|
180
|
+
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:MAX(duration, .0)]];
|
|
181
|
+
[self activate];
|
|
182
|
+
return YES;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
- (NSDictionary *)fb_tree
|
|
186
|
+
{
|
|
187
|
+
return [self fb_tree:nil];
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
- (NSDictionary *)fb_tree:(nullable NSSet<NSString *> *)excludedAttributes
|
|
191
|
+
{
|
|
192
|
+
id<FBXCElementSnapshot> snapshot = [self fb_standardSnapshot];
|
|
193
|
+
return [self.class dictionaryForElement:snapshot
|
|
194
|
+
recursive:YES
|
|
195
|
+
excludedAttributes:excludedAttributes];
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
- (NSDictionary *)fb_accessibilityTree
|
|
199
|
+
{
|
|
200
|
+
id<FBXCElementSnapshot> snapshot = [self fb_standardSnapshot];
|
|
201
|
+
return [self.class accessibilityInfoForElement:snapshot];
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
+ (NSDictionary *)dictionaryForElement:(id<FBXCElementSnapshot>)snapshot
|
|
205
|
+
recursive:(BOOL)recursive
|
|
206
|
+
excludedAttributes:(nullable NSSet<NSString *> *)excludedAttributes
|
|
207
|
+
{
|
|
208
|
+
NSMutableDictionary *info = [[NSMutableDictionary alloc] init];
|
|
209
|
+
info[@"type"] = [FBElementTypeTransformer shortStringWithElementType:snapshot.elementType];
|
|
210
|
+
info[@"rawIdentifier"] = FBValueOrNull([snapshot.identifier isEqual:@""] ? nil : snapshot.identifier);
|
|
211
|
+
FBXCElementSnapshotWrapper *wrappedSnapshot = [FBXCElementSnapshotWrapper ensureWrapped:snapshot];
|
|
212
|
+
info[@"name"] = FBValueOrNull(wrappedSnapshot.wdName);
|
|
213
|
+
info[@"value"] = FBValueOrNull(wrappedSnapshot.wdValue);
|
|
214
|
+
info[@"label"] = FBValueOrNull(wrappedSnapshot.wdLabel);
|
|
215
|
+
info[@"rect"] = wrappedSnapshot.wdRect;
|
|
216
|
+
info[@"customActions"] = FBValueOrNull(wrappedSnapshot.wdCustomActions);
|
|
217
|
+
|
|
218
|
+
NSDictionary<NSString *, NSString *(^)(void)> *attributeBlocks = [self fb_attributeBlockMapForWrappedSnapshot:wrappedSnapshot];
|
|
219
|
+
|
|
220
|
+
NSSet *nonPrefixedKeys = [NSSet setWithObjects:
|
|
221
|
+
FBExclusionAttributeFrame,
|
|
222
|
+
FBExclusionAttributePlaceholderValue,
|
|
223
|
+
FBExclusionAttributeNativeFrame,
|
|
224
|
+
FBExclusionAttributeTraits,
|
|
225
|
+
FBExclusionAttributeMinValue,
|
|
226
|
+
FBExclusionAttributeMaxValue,
|
|
227
|
+
nil];
|
|
228
|
+
|
|
229
|
+
for (NSString *key in attributeBlocks) {
|
|
230
|
+
if (excludedAttributes == nil || ![excludedAttributes containsObject:key]) {
|
|
231
|
+
NSString *value = ((NSString * (^)(void))attributeBlocks[key])();
|
|
232
|
+
if ([nonPrefixedKeys containsObject:key]) {
|
|
233
|
+
info[key] = value;
|
|
234
|
+
} else {
|
|
235
|
+
info[FBJsonPrefixedAttributeKey(key)] = value;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (!recursive) {
|
|
241
|
+
return info.copy;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
NSArray *childElements = snapshot.children;
|
|
245
|
+
if ([childElements count]) {
|
|
246
|
+
info[@"children"] = [[NSMutableArray alloc] init];
|
|
247
|
+
for (id<FBXCElementSnapshot> childSnapshot in childElements) {
|
|
248
|
+
@autoreleasepool {
|
|
249
|
+
[info[@"children"] addObject:[self dictionaryForElement:childSnapshot
|
|
250
|
+
recursive:YES
|
|
251
|
+
excludedAttributes:excludedAttributes]];
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return info;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Helper used by `dictionaryForElement:` to assemble attribute value blocks,
|
|
259
|
+
// including both common attributes and conditionally included ones like placeholderValue.
|
|
260
|
+
+ (NSDictionary<NSString *, NSString *(^)(void)> *)fb_attributeBlockMapForWrappedSnapshot:(FBXCElementSnapshotWrapper *)wrappedSnapshot
|
|
261
|
+
|
|
262
|
+
{
|
|
263
|
+
// Base attributes common to every element
|
|
264
|
+
NSMutableDictionary<NSString *, id(^)(void)> *blocks =
|
|
265
|
+
[@{
|
|
266
|
+
FBExclusionAttributeFrame: ^{
|
|
267
|
+
return NSStringFromCGRect(wrappedSnapshot.wdFrame);
|
|
268
|
+
},
|
|
269
|
+
FBExclusionAttributeNativeFrame: ^{
|
|
270
|
+
return NSStringFromCGRect(wrappedSnapshot.wdNativeFrame);
|
|
271
|
+
},
|
|
272
|
+
FBExclusionAttributeEnabled: ^{
|
|
273
|
+
return [@([wrappedSnapshot isWDEnabled]) stringValue];
|
|
274
|
+
},
|
|
275
|
+
FBExclusionAttributeVisible: ^{
|
|
276
|
+
return [@([wrappedSnapshot isWDVisible]) stringValue];
|
|
277
|
+
},
|
|
278
|
+
FBExclusionAttributeAccessible: ^{
|
|
279
|
+
return [@([wrappedSnapshot isWDAccessible]) stringValue];
|
|
280
|
+
},
|
|
281
|
+
FBExclusionAttributeNativeAccessibilityElement: ^{
|
|
282
|
+
return [@([wrappedSnapshot isWDNativeAccessibilityElement]) stringValue];
|
|
283
|
+
},
|
|
284
|
+
FBExclusionAttributeFocused: ^{
|
|
285
|
+
return [@([wrappedSnapshot isWDFocused]) stringValue];
|
|
286
|
+
},
|
|
287
|
+
FBExclusionAttributeTraits: ^{
|
|
288
|
+
return wrappedSnapshot.wdTraits;
|
|
289
|
+
}
|
|
290
|
+
} mutableCopy];
|
|
291
|
+
|
|
292
|
+
XCUIElementType elementType = wrappedSnapshot.elementType;
|
|
293
|
+
|
|
294
|
+
// Text-input placeholder (only for elements that support inner text)
|
|
295
|
+
if (FBDoesElementSupportInnerText(elementType)) {
|
|
296
|
+
blocks[FBExclusionAttributePlaceholderValue] = ^{
|
|
297
|
+
return (NSString *)FBValueOrNull(wrappedSnapshot.wdPlaceholderValue);
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// Only for elements that support min/max value
|
|
302
|
+
if (FBDoesElementSupportMinMaxValue(elementType)) {
|
|
303
|
+
blocks[FBExclusionAttributeMinValue] = ^{
|
|
304
|
+
return wrappedSnapshot.wdMinValue;
|
|
305
|
+
};
|
|
306
|
+
blocks[FBExclusionAttributeMaxValue] = ^{
|
|
307
|
+
return wrappedSnapshot.wdMaxValue;
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
return [blocks copy];
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
+ (NSDictionary *)accessibilityInfoForElement:(id<FBXCElementSnapshot>)snapshot
|
|
315
|
+
{
|
|
316
|
+
FBXCElementSnapshotWrapper *wrappedSnapshot = [FBXCElementSnapshotWrapper ensureWrapped:snapshot];
|
|
317
|
+
BOOL isAccessible = [wrappedSnapshot isWDAccessible];
|
|
318
|
+
BOOL isVisible = [wrappedSnapshot isWDVisible];
|
|
319
|
+
|
|
320
|
+
NSMutableDictionary *info = [[NSMutableDictionary alloc] init];
|
|
321
|
+
|
|
322
|
+
if (isAccessible) {
|
|
323
|
+
if (isVisible) {
|
|
324
|
+
info[@"value"] = FBValueOrNull(wrappedSnapshot.wdValue);
|
|
325
|
+
info[@"label"] = FBValueOrNull(wrappedSnapshot.wdLabel);
|
|
326
|
+
}
|
|
327
|
+
} else {
|
|
328
|
+
NSMutableArray *children = [[NSMutableArray alloc] init];
|
|
329
|
+
for (id<FBXCElementSnapshot> childSnapshot in snapshot.children) {
|
|
330
|
+
@autoreleasepool {
|
|
331
|
+
NSDictionary *childInfo = [self accessibilityInfoForElement:childSnapshot];
|
|
332
|
+
if ([childInfo count]) {
|
|
333
|
+
[children addObject: childInfo];
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
if ([children count]) {
|
|
338
|
+
info[@"children"] = [children copy];
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
if ([info count]) {
|
|
342
|
+
info[@"type"] = [FBElementTypeTransformer shortStringWithElementType:snapshot.elementType];
|
|
343
|
+
info[@"rawIdentifier"] = FBValueOrNull([snapshot.identifier isEqual:@""] ? nil : snapshot.identifier);
|
|
344
|
+
info[@"name"] = FBValueOrNull(wrappedSnapshot.wdName);
|
|
345
|
+
} else {
|
|
346
|
+
return nil;
|
|
347
|
+
}
|
|
348
|
+
return info;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
- (NSString *)fb_xmlRepresentation
|
|
352
|
+
{
|
|
353
|
+
return [self fb_xmlRepresentationWithOptions:nil];
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
- (NSString *)fb_xmlRepresentationWithOptions:(FBXMLGenerationOptions *)options
|
|
357
|
+
{
|
|
358
|
+
return [FBXPath xmlStringWithRootElement:self options:options];
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
- (NSString *)fb_descriptionRepresentation
|
|
362
|
+
{
|
|
363
|
+
NSMutableArray<NSString *> *childrenDescriptions = [NSMutableArray array];
|
|
364
|
+
for (XCUIElement *child in [self.fb_query childrenMatchingType:XCUIElementTypeAny].allElementsBoundByIndex) {
|
|
365
|
+
[childrenDescriptions addObject:child.debugDescription];
|
|
366
|
+
}
|
|
367
|
+
// debugDescription property of XCUIApplication instance shows descendants addresses in memory
|
|
368
|
+
// instead of the actual information about them, however the representation works properly
|
|
369
|
+
// for all descendant elements
|
|
370
|
+
return (0 == childrenDescriptions.count) ? self.debugDescription : [childrenDescriptions componentsJoinedByString:@"\n\n"];
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
- (XCUIElement *)fb_activeElement
|
|
374
|
+
{
|
|
375
|
+
return [[[self.fb_query descendantsMatchingType:XCUIElementTypeAny]
|
|
376
|
+
matchingPredicate:[NSPredicate predicateWithFormat:@"hasKeyboardFocus == YES"]]
|
|
377
|
+
fb_firstMatch];
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
#if TARGET_OS_TV
|
|
381
|
+
- (XCUIElement *)fb_focusedElement
|
|
382
|
+
{
|
|
383
|
+
return [[[self.fb_query descendantsMatchingType:XCUIElementTypeAny]
|
|
384
|
+
matchingPredicate:[NSPredicate predicateWithFormat:@"hasFocus == true"]]
|
|
385
|
+
fb_firstMatch];
|
|
386
|
+
}
|
|
387
|
+
#endif
|
|
388
|
+
|
|
389
|
+
- (BOOL)fb_dismissKeyboardWithKeyNames:(nullable NSArray<NSString *> *)keyNames
|
|
390
|
+
error:(NSError **)error
|
|
391
|
+
{
|
|
392
|
+
BOOL (^isKeyboardInvisible)(void) = ^BOOL(void) {
|
|
393
|
+
return ![FBKeyboard waitUntilVisibleForApplication:self
|
|
394
|
+
timeout:0
|
|
395
|
+
error:nil];
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
if (isKeyboardInvisible()) {
|
|
399
|
+
// Short circuit if the keyboard is not visible
|
|
400
|
+
return YES;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
#if TARGET_OS_TV
|
|
404
|
+
[[XCUIRemote sharedRemote] pressButton:XCUIRemoteButtonMenu];
|
|
405
|
+
#else
|
|
406
|
+
NSArray<XCUIElement *> *(^findMatchingKeys)(NSPredicate *) = ^NSArray<XCUIElement *> *(NSPredicate * predicate) {
|
|
407
|
+
NSPredicate *keysPredicate = [NSPredicate predicateWithFormat:@"elementType == %@", @(XCUIElementTypeKey)];
|
|
408
|
+
XCUIElementQuery *parentView = [[self.keyboard descendantsMatchingType:XCUIElementTypeOther]
|
|
409
|
+
containingPredicate:keysPredicate];
|
|
410
|
+
return [[parentView childrenMatchingType:XCUIElementTypeAny]
|
|
411
|
+
matchingPredicate:predicate].allElementsBoundByIndex;
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
if (nil != keyNames && keyNames.count > 0) {
|
|
415
|
+
NSPredicate *searchPredicate = [NSPredicate predicateWithBlock:^BOOL(id<FBXCElementSnapshot> snapshot, NSDictionary *bindings) {
|
|
416
|
+
if (snapshot.elementType != XCUIElementTypeKey && snapshot.elementType != XCUIElementTypeButton) {
|
|
417
|
+
return NO;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
return (nil != snapshot.identifier && [keyNames containsObject:snapshot.identifier])
|
|
421
|
+
|| (nil != snapshot.label && [keyNames containsObject:snapshot.label]);
|
|
422
|
+
}];
|
|
423
|
+
NSArray *matchedKeys = findMatchingKeys(searchPredicate);
|
|
424
|
+
if (matchedKeys.count > 0) {
|
|
425
|
+
for (XCUIElement *matchedKey in matchedKeys) {
|
|
426
|
+
if (!matchedKey.exists) {
|
|
427
|
+
continue;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
[matchedKey tap];
|
|
431
|
+
if (isKeyboardInvisible()) {
|
|
432
|
+
return YES;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
#if !TARGET_OS_WATCH
|
|
439
|
+
if ([UIDevice.currentDevice userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
|
440
|
+
NSPredicate *searchPredicate = [NSPredicate predicateWithFormat:@"elementType IN %@",
|
|
441
|
+
@[@(XCUIElementTypeKey), @(XCUIElementTypeButton)]];
|
|
442
|
+
NSArray *matchedKeys = findMatchingKeys(searchPredicate);
|
|
443
|
+
if (matchedKeys.count > 0) {
|
|
444
|
+
[matchedKeys[matchedKeys.count - 1] tap];
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
#endif
|
|
448
|
+
#endif
|
|
449
|
+
NSString *errorDescription = @"Did not know how to dismiss the keyboard. Try to dismiss it in the way supported by your application under test.";
|
|
450
|
+
return [[[[FBRunLoopSpinner new]
|
|
451
|
+
timeout:3]
|
|
452
|
+
timeoutErrorMessage:errorDescription]
|
|
453
|
+
spinUntilTrue:isKeyboardInvisible
|
|
454
|
+
error:error];
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
- (NSArray<NSDictionary<NSString *, NSString*> *> *)fb_performAccessibilityAuditWithAuditTypesSet:(NSSet<NSString *> *)auditTypes
|
|
458
|
+
error:(NSError **)error;
|
|
459
|
+
{
|
|
460
|
+
uint64_t numTypes = 0;
|
|
461
|
+
NSDictionary *namesMap = auditTypeNamesToValues();
|
|
462
|
+
for (NSString *value in auditTypes) {
|
|
463
|
+
NSNumber *typeValue = namesMap[value];
|
|
464
|
+
if (nil == typeValue) {
|
|
465
|
+
NSString *reason = [NSString stringWithFormat:@"Audit type value '%@' is not known. Only the following audit types are supported: %@", value, namesMap.allKeys];
|
|
466
|
+
@throw [NSException exceptionWithName:FBInvalidArgumentException reason:reason userInfo:@{}];
|
|
467
|
+
}
|
|
468
|
+
numTypes |= [typeValue unsignedLongLongValue];
|
|
469
|
+
}
|
|
470
|
+
return [self fb_performAccessibilityAuditWithAuditTypes:numTypes error:error];
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
- (NSArray<NSDictionary<NSString *, NSString*> *> *)fb_performAccessibilityAuditWithAuditTypes:(uint64_t)auditTypes
|
|
474
|
+
error:(NSError **)error;
|
|
475
|
+
{
|
|
476
|
+
SEL selector = NSSelectorFromString(@"performAccessibilityAuditWithAuditTypes:issueHandler:error:");
|
|
477
|
+
if (![self respondsToSelector:selector]) {
|
|
478
|
+
[[[FBErrorBuilder alloc]
|
|
479
|
+
withDescription:@"Accessibility audit is only supported since iOS 17/Xcode 15"]
|
|
480
|
+
buildError:error];
|
|
481
|
+
return nil;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
// These custom attributes could take too long to fetch, thus excluded
|
|
485
|
+
NSSet *customAttributesToExclude = [NSSet setWithArray:[customExclusionAttributesMap() allKeys]];
|
|
486
|
+
NSMutableArray<NSDictionary *> *resultArray = [NSMutableArray array];
|
|
487
|
+
NSMethodSignature *methodSignature = [self methodSignatureForSelector:selector];
|
|
488
|
+
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:methodSignature];
|
|
489
|
+
[invocation setSelector:selector];
|
|
490
|
+
[invocation setArgument:&auditTypes atIndex:2];
|
|
491
|
+
BOOL (^issueHandler)(id) = ^BOOL(id issue) {
|
|
492
|
+
@autoreleasepool {
|
|
493
|
+
NSString *auditType = @"";
|
|
494
|
+
NSDictionary *valuesToNamesMap = auditTypeValuesToNames();
|
|
495
|
+
NSNumber *auditTypeValue = [issue valueForKey:@"auditType"];
|
|
496
|
+
if (nil != auditTypeValue) {
|
|
497
|
+
auditType = valuesToNamesMap[auditTypeValue] ?: [auditTypeValue stringValue];
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
id extractedElement = extractIssueProperty(issue, @"element");
|
|
501
|
+
|
|
502
|
+
id<FBXCElementSnapshot> elementSnapshot = [extractedElement fb_cachedSnapshot] ?: [extractedElement fb_standardSnapshot];
|
|
503
|
+
NSDictionary *elementAttributes = elementSnapshot
|
|
504
|
+
? [self.class dictionaryForElement:elementSnapshot
|
|
505
|
+
recursive:NO
|
|
506
|
+
excludedAttributes:customAttributesToExclude]
|
|
507
|
+
: @{};
|
|
508
|
+
|
|
509
|
+
[resultArray addObject:@{
|
|
510
|
+
@"detailedDescription": extractIssueProperty(issue, @"detailedDescription") ?: @"",
|
|
511
|
+
@"compactDescription": extractIssueProperty(issue, @"compactDescription") ?: @"",
|
|
512
|
+
@"auditType": auditType,
|
|
513
|
+
@"element": [extractedElement description] ?: @"",
|
|
514
|
+
@"elementDescription": [extractedElement debugDescription] ?: @"",
|
|
515
|
+
@"elementAttributes": elementAttributes ?: @{},
|
|
516
|
+
}];
|
|
517
|
+
return YES;
|
|
518
|
+
}
|
|
519
|
+
};
|
|
520
|
+
[invocation setArgument:&issueHandler atIndex:3];
|
|
521
|
+
[invocation setArgument:&error atIndex:4];
|
|
522
|
+
[invocation invokeWithTarget:self];
|
|
523
|
+
BOOL isSuccessful;
|
|
524
|
+
[invocation getReturnValue:&isSuccessful];
|
|
525
|
+
return isSuccessful ? resultArray.copy : nil;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
+ (instancetype)fb_activeApplication
|
|
529
|
+
{
|
|
530
|
+
return [self fb_activeApplicationWithDefaultBundleId:nil];
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
+ (NSArray<XCUIApplication *> *)fb_activeApplications
|
|
534
|
+
{
|
|
535
|
+
NSArray<id<FBXCAccessibilityElement>> *activeApplicationElements = [FBXCAXClientProxy.sharedClient activeApplications];
|
|
536
|
+
NSMutableArray<XCUIApplication *> *result = [NSMutableArray array];
|
|
537
|
+
if (activeApplicationElements.count > 0) {
|
|
538
|
+
for (id<FBXCAccessibilityElement> applicationElement in activeApplicationElements) {
|
|
539
|
+
XCUIApplication *app = [XCUIApplication fb_applicationWithPID:applicationElement.processIdentifier];
|
|
540
|
+
if (nil != app) {
|
|
541
|
+
[result addObject:app];
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
return result.count > 0 ? result.copy : @[self.class.fb_systemApplication];
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
+ (instancetype)fb_activeApplicationWithDefaultBundleId:(nullable NSString *)bundleId
|
|
549
|
+
{
|
|
550
|
+
NSArray<id<FBXCAccessibilityElement>> *activeApplicationElements = [FBXCAXClientProxy.sharedClient activeApplications];
|
|
551
|
+
id<FBXCAccessibilityElement> activeApplicationElement = nil;
|
|
552
|
+
id<FBXCAccessibilityElement> currentElement = nil;
|
|
553
|
+
if (nil != bundleId) {
|
|
554
|
+
currentElement = FBActiveAppDetectionPoint.sharedInstance.axElement;
|
|
555
|
+
if (nil != currentElement) {
|
|
556
|
+
NSArray<NSDictionary *> *appInfos = [self fb_appsInfoWithAxElements:@[currentElement]];
|
|
557
|
+
[FBLogger logFmt:@"Detected on-screen application: %@", appInfos.firstObject[@"bundleId"]];
|
|
558
|
+
if ([[appInfos.firstObject objectForKey:@"bundleId"] isEqualToString:(id)bundleId]) {
|
|
559
|
+
activeApplicationElement = currentElement;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
if (nil == activeApplicationElement && activeApplicationElements.count > 1) {
|
|
564
|
+
if (nil != bundleId) {
|
|
565
|
+
NSArray<NSDictionary *> *appInfos = [self fb_appsInfoWithAxElements:activeApplicationElements];
|
|
566
|
+
NSMutableArray<NSString *> *bundleIds = [NSMutableArray array];
|
|
567
|
+
for (NSDictionary *appInfo in appInfos) {
|
|
568
|
+
[bundleIds addObject:(NSString *)appInfo[@"bundleId"]];
|
|
569
|
+
}
|
|
570
|
+
[FBLogger logFmt:@"Detected system active application(s): %@", bundleIds];
|
|
571
|
+
// Try to select the desired application first
|
|
572
|
+
for (NSUInteger appIdx = 0; appIdx < appInfos.count; appIdx++) {
|
|
573
|
+
if ([[[appInfos objectAtIndex:appIdx] objectForKey:@"bundleId"] isEqualToString:(id)bundleId]) {
|
|
574
|
+
activeApplicationElement = [activeApplicationElements objectAtIndex:appIdx];
|
|
575
|
+
break;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
// Fall back to the "normal" algorithm if the desired application is either
|
|
580
|
+
// not set or is not active
|
|
581
|
+
if (nil == activeApplicationElement) {
|
|
582
|
+
if (nil == currentElement) {
|
|
583
|
+
currentElement = FBActiveAppDetectionPoint.sharedInstance.axElement;
|
|
584
|
+
}
|
|
585
|
+
if (nil == currentElement) {
|
|
586
|
+
[FBLogger log:@"Cannot precisely detect the current application. Will use the system's recently active one"];
|
|
587
|
+
if (nil == bundleId) {
|
|
588
|
+
[FBLogger log:@"Consider changing the 'defaultActiveApplication' setting to the bundle identifier of the desired application under test"];
|
|
589
|
+
}
|
|
590
|
+
} else {
|
|
591
|
+
for (id<FBXCAccessibilityElement> appElement in activeApplicationElements) {
|
|
592
|
+
if (appElement.processIdentifier == currentElement.processIdentifier) {
|
|
593
|
+
activeApplicationElement = appElement;
|
|
594
|
+
break;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
if (nil != activeApplicationElement) {
|
|
602
|
+
XCUIApplication *application = [XCUIApplication fb_applicationWithPID:activeApplicationElement.processIdentifier];
|
|
603
|
+
if (nil != application) {
|
|
604
|
+
return application;
|
|
605
|
+
}
|
|
606
|
+
[FBLogger log:@"Cannot translate the active process identifier into an application object"];
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
if (activeApplicationElements.count > 0) {
|
|
610
|
+
[FBLogger logFmt:@"Getting the most recent active application (out of %@ total items)", @(activeApplicationElements.count)];
|
|
611
|
+
for (id<FBXCAccessibilityElement> appElement in activeApplicationElements) {
|
|
612
|
+
XCUIApplication *application = [XCUIApplication fb_applicationWithPID:appElement.processIdentifier];
|
|
613
|
+
if (nil != application) {
|
|
614
|
+
return application;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
[FBLogger log:@"Cannot retrieve any active applications. Assuming the system application is the active one"];
|
|
620
|
+
return [self fb_systemApplication];
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
+ (instancetype)fb_systemApplication
|
|
624
|
+
{
|
|
625
|
+
return [self fb_applicationWithPID:
|
|
626
|
+
[[FBXCAXClientProxy.sharedClient systemApplication] processIdentifier]];
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
+ (instancetype)fb_applicationWithPID:(pid_t)processID
|
|
630
|
+
{
|
|
631
|
+
return [FBXCAXClientProxy.sharedClient monitoredApplicationWithProcessIdentifier:processID];
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
+ (BOOL)fb_switchToSystemApplicationWithError:(NSError **)error
|
|
635
|
+
{
|
|
636
|
+
XCUIApplication *systemApp = self.fb_systemApplication;
|
|
637
|
+
@try {
|
|
638
|
+
if (systemApp.running) {
|
|
639
|
+
[systemApp activate];
|
|
640
|
+
} else {
|
|
641
|
+
[systemApp launch];
|
|
642
|
+
}
|
|
643
|
+
} @catch (NSException *e) {
|
|
644
|
+
return [[[FBErrorBuilder alloc]
|
|
645
|
+
withDescription:nil == e ? @"Cannot open the home screen" : e.reason]
|
|
646
|
+
buildError:error];
|
|
647
|
+
}
|
|
648
|
+
return YES;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
- (BOOL)fb_isSameAppAs:(nullable XCUIApplication *)otherApp
|
|
652
|
+
{
|
|
653
|
+
if (nil == otherApp) {
|
|
654
|
+
return NO;
|
|
655
|
+
}
|
|
656
|
+
return self == otherApp || [self.bundleID isEqualToString:(NSString *)otherApp.bundleID];
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
+ (nullable XCUIElement *)fb_elementForSnapshot:(id<FBXCElementSnapshot>)snapshot
|
|
660
|
+
underElement:(XCUIElement *)rootElement
|
|
661
|
+
{
|
|
662
|
+
NSString *uid = [FBXCElementSnapshotWrapper wdUIDWithSnapshot:snapshot];
|
|
663
|
+
if (nil == uid) {
|
|
664
|
+
return nil;
|
|
665
|
+
}
|
|
666
|
+
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K = %@",
|
|
667
|
+
FBStringify(FBXCElementSnapshotWrapper, fb_uid), uid];
|
|
668
|
+
// Filtering by the snapshot's own type (instead of XCUIElementTypeAny) lets
|
|
669
|
+
// the query narrow down before the uid predicate is even applied.
|
|
670
|
+
return [[rootElement.fb_query descendantsMatchingType:snapshot.elementType]
|
|
671
|
+
matchingPredicate:predicate].allElementsBoundByIndex.firstObject;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
@end
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
#import "XCUIApplication.h"
|
|
11
|
+
|
|
12
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
13
|
+
|
|
14
|
+
@interface XCUIApplication (FBQuiescence)
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
It allows to turn on/off waiting for application quiescence, while performing queries. Defaults to YES.
|
|
18
|
+
This value mirrors the corresponding property of the connected XCUIApplicationProcess instance.
|
|
19
|
+
*/
|
|
20
|
+
@property (nonatomic, assign) BOOL fb_shouldWaitForQuiescence;
|
|
21
|
+
|
|
22
|
+
@end
|
|
23
|
+
|
|
24
|
+
NS_ASSUME_NONNULL_END
|