@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,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2015-present, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the BSD-style license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
|
|
11
|
+
#import <WebDriverAgentLib/FBCommandHandler.h>
|
|
12
|
+
|
|
13
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
14
|
+
|
|
15
|
+
@interface FBVideoCommands : NSObject <FBCommandHandler>
|
|
16
|
+
|
|
17
|
+
@end
|
|
18
|
+
|
|
19
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,84 @@
|
|
|
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 "FBVideoCommands.h"
|
|
10
|
+
|
|
11
|
+
#import "FBRouteRequest.h"
|
|
12
|
+
#import "FBScreenRecordingContainer.h"
|
|
13
|
+
#import "FBScreenRecordingPromise.h"
|
|
14
|
+
#import "FBScreenRecordingRequest.h"
|
|
15
|
+
#import "FBSession.h"
|
|
16
|
+
#import "FBXCTestDaemonsProxy.h"
|
|
17
|
+
|
|
18
|
+
const NSUInteger DEFAULT_FPS = 24;
|
|
19
|
+
const NSUInteger DEFAULT_CODEC = 0;
|
|
20
|
+
|
|
21
|
+
@implementation FBVideoCommands
|
|
22
|
+
|
|
23
|
+
+ (NSArray *)routes
|
|
24
|
+
{
|
|
25
|
+
return
|
|
26
|
+
@[
|
|
27
|
+
[[FBRoute POST:@"/wda/video/start"] respondWithTarget:self action:@selector(handleStartVideoRecording:)],
|
|
28
|
+
[[FBRoute POST:@"/wda/video/stop"] respondWithTarget:self action:@selector(handleStopVideoRecording:)],
|
|
29
|
+
[[FBRoute GET:@"/wda/video"] respondWithTarget:self action:@selector(handleGetVideoRecording:)],
|
|
30
|
+
|
|
31
|
+
[[FBRoute POST:@"/wda/video/start"].withoutSession respondWithTarget:self action:@selector(handleStartVideoRecording:)],
|
|
32
|
+
[[FBRoute POST:@"/wda/video/stop"].withoutSession respondWithTarget:self action:@selector(handleStopVideoRecording:)],
|
|
33
|
+
[[FBRoute GET:@"/wda/video"].withoutSession respondWithTarget:self action:@selector(handleGetVideoRecording:)],
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
+ (id<FBResponsePayload>)handleStartVideoRecording:(FBRouteRequest *)request
|
|
38
|
+
{
|
|
39
|
+
FBScreenRecordingPromise *activeScreenRecording = FBScreenRecordingContainer.sharedInstance.screenRecordingPromise;
|
|
40
|
+
if (nil != activeScreenRecording) {
|
|
41
|
+
return FBResponseWithObject([FBScreenRecordingContainer.sharedInstance toDictionary] ?: [NSNull null]);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
NSNumber *fps = (NSNumber *)request.arguments[@"fps"] ?: @(DEFAULT_FPS);
|
|
45
|
+
NSNumber *codec = (NSNumber *)request.arguments[@"codec"] ?: @(DEFAULT_CODEC);
|
|
46
|
+
FBScreenRecordingRequest *recordingRequest = [[FBScreenRecordingRequest alloc] initWithFps:fps.integerValue
|
|
47
|
+
codec:codec.longLongValue];
|
|
48
|
+
NSError *error;
|
|
49
|
+
FBScreenRecordingPromise* promise = [FBXCTestDaemonsProxy startScreenRecordingWithRequest:recordingRequest
|
|
50
|
+
error:&error];
|
|
51
|
+
if (nil == promise) {
|
|
52
|
+
[FBScreenRecordingContainer.sharedInstance reset];
|
|
53
|
+
return FBResponseWithUnknownError(error);
|
|
54
|
+
}
|
|
55
|
+
[FBScreenRecordingContainer.sharedInstance storeScreenRecordingPromise:promise
|
|
56
|
+
fps:fps.integerValue
|
|
57
|
+
codec:codec.longLongValue];
|
|
58
|
+
return FBResponseWithObject([FBScreenRecordingContainer.sharedInstance toDictionary]);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
+ (id<FBResponsePayload>)handleStopVideoRecording:(FBRouteRequest *)request
|
|
62
|
+
{
|
|
63
|
+
FBScreenRecordingPromise *activeScreenRecording = FBScreenRecordingContainer.sharedInstance.screenRecordingPromise;
|
|
64
|
+
if (nil == activeScreenRecording) {
|
|
65
|
+
return FBResponseWithOK();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
NSUUID *recordingId = activeScreenRecording.identifier;
|
|
69
|
+
NSDictionary *response = [FBScreenRecordingContainer.sharedInstance toDictionary];
|
|
70
|
+
NSError *error;
|
|
71
|
+
if (![FBXCTestDaemonsProxy stopScreenRecordingWithUUID:recordingId error:&error]) {
|
|
72
|
+
[FBScreenRecordingContainer.sharedInstance reset];
|
|
73
|
+
return FBResponseWithUnknownError(error);
|
|
74
|
+
}
|
|
75
|
+
[FBScreenRecordingContainer.sharedInstance reset];
|
|
76
|
+
return FBResponseWithObject(response);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
+ (id<FBResponsePayload>)handleGetVideoRecording:(FBRouteRequest *)request
|
|
80
|
+
{
|
|
81
|
+
return FBResponseWithObject([FBScreenRecordingContainer.sharedInstance toDictionary] ?: [NSNull null]);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@end
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2015-present, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the BSD-style license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
|
|
11
|
+
@class XCUIApplication;
|
|
12
|
+
|
|
13
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
Alert helper class that abstracts alert handling
|
|
17
|
+
*/
|
|
18
|
+
@interface FBAlert : NSObject
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
Creates alert helper for given application
|
|
22
|
+
|
|
23
|
+
@param application The application that contains the alert
|
|
24
|
+
*/
|
|
25
|
+
+ (instancetype)alertWithApplication:(XCUIApplication *)application;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
Determines whether alert is present.
|
|
29
|
+
|
|
30
|
+
An FBAlert instance resolves the alert (and, if found, its snapshot) at
|
|
31
|
+
most once, lazily, on the first call to isPresent, text, buttonLabels,
|
|
32
|
+
accept, dismiss, clickAlertButton:, clickElementMatchingClassChain:, or
|
|
33
|
+
typeText: - every subsequent call on the same instance reuses that result
|
|
34
|
+
rather than re-querying the live UI. This makes an isPresent check
|
|
35
|
+
immediately followed by an action (e.g. the auto-accept flow) act on the
|
|
36
|
+
exact same alert it just observed. Create a fresh FBAlert instance (via
|
|
37
|
+
alertWithApplication:) to observe the current UI state again.
|
|
38
|
+
*/
|
|
39
|
+
- (BOOL)isPresent;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
Gets the labels of the buttons visible in the alert.
|
|
43
|
+
See isPresent for how presence is resolved.
|
|
44
|
+
*/
|
|
45
|
+
- (nullable NSArray *)buttonLabels;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
Returns alert's title and description separated by new lines.
|
|
49
|
+
See isPresent for how presence is resolved.
|
|
50
|
+
*/
|
|
51
|
+
- (nullable NSString *)text;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
Accepts alert, if present.
|
|
55
|
+
See isPresent for how presence is resolved.
|
|
56
|
+
|
|
57
|
+
@throws FBAlertNotPresentException if no alert is present.
|
|
58
|
+
@throws FBAlertActionFailedException if the accept button could not be found.
|
|
59
|
+
*/
|
|
60
|
+
- (void)accept;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
Dismisses alert, if present.
|
|
64
|
+
See isPresent for how presence is resolved.
|
|
65
|
+
|
|
66
|
+
@throws FBAlertNotPresentException if no alert is present.
|
|
67
|
+
@throws FBAlertActionFailedException if the dismiss button could not be found.
|
|
68
|
+
*/
|
|
69
|
+
- (void)dismiss;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
Clicks on an alert button, if present.
|
|
73
|
+
See isPresent for how presence is resolved.
|
|
74
|
+
|
|
75
|
+
@param label The label of the button on which to click.
|
|
76
|
+
@throws FBAlertNotPresentException if no alert is present.
|
|
77
|
+
@throws FBAlertActionFailedException if no button with the given label could be found.
|
|
78
|
+
*/
|
|
79
|
+
- (void)clickAlertButton:(NSString *)label;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
Taps the first descendant of the alert matching the given class chain
|
|
83
|
+
selector, if present.
|
|
84
|
+
See isPresent for how presence is resolved.
|
|
85
|
+
|
|
86
|
+
@param classChain The class chain selector to match against the alert's descendants.
|
|
87
|
+
@throws FBAlertNotPresentException if no alert is present.
|
|
88
|
+
@throws FBAlertActionFailedException if no matching element could be found.
|
|
89
|
+
*/
|
|
90
|
+
- (void)clickElementMatchingClassChain:(NSString *)classChain;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
Types a text into an input inside the alert container, if it is present.
|
|
94
|
+
See isPresent for how presence is resolved.
|
|
95
|
+
|
|
96
|
+
@param text the text to type
|
|
97
|
+
@throws FBAlertNotPresentException if no alert is present.
|
|
98
|
+
@throws FBAlertSetTextFailedException if there is no single input field to type into, or typing itself fails.
|
|
99
|
+
*/
|
|
100
|
+
- (void)typeText:(NSString *)text;
|
|
101
|
+
|
|
102
|
+
@end
|
|
103
|
+
|
|
104
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,454 @@
|
|
|
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 "FBAlert.h"
|
|
10
|
+
|
|
11
|
+
#import "FBConfiguration.h"
|
|
12
|
+
#import "FBExceptions.h"
|
|
13
|
+
#import "FBLogger.h"
|
|
14
|
+
#import "FBXCElementSnapshotWrapper+Helpers.h"
|
|
15
|
+
#import "FBXCodeCompatibility.h"
|
|
16
|
+
#import "XCUIApplication.h"
|
|
17
|
+
#import "XCUIApplication+FBAlert.h"
|
|
18
|
+
#import "XCUIApplication+FBHelpers.h"
|
|
19
|
+
#import "XCUIElement+FBClassChain.h"
|
|
20
|
+
#import "XCUIElement+FBTyping.h"
|
|
21
|
+
#import "XCUIElement+FBUID.h"
|
|
22
|
+
#import "XCUIElement+FBUtilities.h"
|
|
23
|
+
#import "XCUIElement+FBWebDriverAttributes.h"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@interface FBAlert ()
|
|
27
|
+
@property (nonatomic, strong) XCUIApplication *application;
|
|
28
|
+
@property (nonatomic, nullable) XCUIElement *cachedAlertElement;
|
|
29
|
+
@property (nonatomic) BOOL hasCachedAlertElement;
|
|
30
|
+
@property (nonatomic, nullable) id<FBXCElementSnapshot> cachedAlertSnapshot;
|
|
31
|
+
@property (nonatomic) BOOL hasCachedAlertSnapshot;
|
|
32
|
+
@end
|
|
33
|
+
|
|
34
|
+
@implementation FBAlert
|
|
35
|
+
|
|
36
|
+
+ (instancetype)alertWithApplication:(XCUIApplication *)application
|
|
37
|
+
{
|
|
38
|
+
FBAlert *alert = [FBAlert new];
|
|
39
|
+
alert.application = application;
|
|
40
|
+
return alert;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Resolved (and, if found, snapshotted) at most once per instance and then
|
|
44
|
+
// reused for every subsequent call - see FBAlert.h. This is what makes an
|
|
45
|
+
// isPresent check followed by an action (the FBAlertsMonitor/FBSession
|
|
46
|
+
// auto-accept flow) act on the exact same alert it just observed, instead of
|
|
47
|
+
// re-resolving against a UI that may have changed in between.
|
|
48
|
+
- (nullable XCUIElement *)alertElement
|
|
49
|
+
{
|
|
50
|
+
if (!self.hasCachedAlertElement) {
|
|
51
|
+
id<FBXCElementSnapshot> snapshot = nil;
|
|
52
|
+
self.cachedAlertElement = [self alertElementFromApplication:&snapshot];
|
|
53
|
+
self.hasCachedAlertElement = YES;
|
|
54
|
+
if (nil != snapshot) {
|
|
55
|
+
self.cachedAlertSnapshot = snapshot;
|
|
56
|
+
self.hasCachedAlertSnapshot = YES;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return self.cachedAlertElement;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// The alert element's own subtree snapshot, taken once. All read-only
|
|
63
|
+
// accessors (text, buttonLabels) and all element lookups (buttons, input
|
|
64
|
+
// fields) work off this single snapshot in memory - only tapping/typing into
|
|
65
|
+
// a specific already-located element pays for one more, narrowly targeted
|
|
66
|
+
// accessibility round trip (see XCUIApplication.fb_elementForSnapshot:underElement:).
|
|
67
|
+
// fb_cachedSnapshot is tried before fb_customSnapshot: it can reconstruct
|
|
68
|
+
// the element's snapshot from the detection query's already-fetched
|
|
69
|
+
// rootElementSnapshot without a further round trip (verified empirically -
|
|
70
|
+
// see XCUIApplication+FBAlert.m).
|
|
71
|
+
- (nullable id<FBXCElementSnapshot>)alertSnapshot
|
|
72
|
+
{
|
|
73
|
+
if (!self.hasCachedAlertSnapshot) {
|
|
74
|
+
XCUIElement *alertElement = self.alertElement;
|
|
75
|
+
self.cachedAlertSnapshot = nil == alertElement
|
|
76
|
+
? nil
|
|
77
|
+
: (alertElement.fb_cachedSnapshot ?: [alertElement fb_customSnapshot]);
|
|
78
|
+
self.hasCachedAlertSnapshot = YES;
|
|
79
|
+
}
|
|
80
|
+
return self.cachedAlertSnapshot;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
- (BOOL)isPresent
|
|
84
|
+
{
|
|
85
|
+
return nil != self.alertElement;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
+ (NSArray<id<FBXCElementSnapshot>> *)fb_buttonSnapshotsInSnapshot:(id<FBXCElementSnapshot>)snapshot
|
|
89
|
+
{
|
|
90
|
+
NSMutableArray<id<FBXCElementSnapshot>> *buttons = [NSMutableArray array];
|
|
91
|
+
[snapshot enumerateDescendantsUsingBlock:^(id<FBXCElementSnapshot> descendant) {
|
|
92
|
+
if (descendant.elementType == XCUIElementTypeButton) {
|
|
93
|
+
[buttons addObject:descendant];
|
|
94
|
+
}
|
|
95
|
+
}];
|
|
96
|
+
return buttons.copy;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
- (void)fb_raiseNotPresentException __attribute__((noreturn))
|
|
100
|
+
{
|
|
101
|
+
@throw [NSException exceptionWithName:FBAlertNotPresentException
|
|
102
|
+
reason:@"No alert is open"
|
|
103
|
+
userInfo:nil];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
- (void)fb_raiseActionFailedExceptionWithReason:(NSString *)reason __attribute__((noreturn))
|
|
107
|
+
{
|
|
108
|
+
@throw [NSException exceptionWithName:FBAlertActionFailedException
|
|
109
|
+
reason:reason
|
|
110
|
+
userInfo:nil];
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
- (void)fb_raiseSetTextFailedExceptionWithReason:(NSString *)reason __attribute__((noreturn))
|
|
114
|
+
{
|
|
115
|
+
@throw [NSException exceptionWithName:FBAlertSetTextFailedException
|
|
116
|
+
reason:reason
|
|
117
|
+
userInfo:nil];
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
+ (BOOL)isSafariWebAlertWithSnapshot:(id<FBXCElementSnapshot>)snapshot
|
|
121
|
+
{
|
|
122
|
+
if (snapshot.elementType != XCUIElementTypeOther) {
|
|
123
|
+
return NO;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
FBXCElementSnapshotWrapper *snapshotWrapper = [FBXCElementSnapshotWrapper ensureWrapped:snapshot];
|
|
127
|
+
id<FBXCElementSnapshot> application = [snapshotWrapper fb_parentMatchingType:XCUIElementTypeApplication];
|
|
128
|
+
return nil != application && [application.label isEqualToString:FB_SAFARI_APP_NAME];
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
- (NSString *)text
|
|
132
|
+
{
|
|
133
|
+
id<FBXCElementSnapshot> snapshot = self.alertSnapshot;
|
|
134
|
+
if (nil == snapshot) {
|
|
135
|
+
return nil;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
NSMutableArray<NSString *> *resultText = [NSMutableArray array];
|
|
139
|
+
BOOL isSafariAlert = [self.class isSafariWebAlertWithSnapshot:snapshot];
|
|
140
|
+
[snapshot enumerateDescendantsUsingBlock:^(id<FBXCElementSnapshot> descendant) {
|
|
141
|
+
XCUIElementType elementType = descendant.elementType;
|
|
142
|
+
if (!(elementType == XCUIElementTypeTextView || elementType == XCUIElementTypeStaticText)) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
FBXCElementSnapshotWrapper *descendantWrapper = [FBXCElementSnapshotWrapper ensureWrapped:descendant];
|
|
147
|
+
if (elementType == XCUIElementTypeStaticText
|
|
148
|
+
&& nil != [descendantWrapper fb_parentMatchingType:XCUIElementTypeButton]) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
NSString *text = descendantWrapper.wdLabel ?: descendantWrapper.wdValue;
|
|
153
|
+
if (isSafariAlert && nil != descendant.parent) {
|
|
154
|
+
FBXCElementSnapshotWrapper *descendantParentWrapper = [FBXCElementSnapshotWrapper ensureWrapped:descendant.parent];
|
|
155
|
+
NSString *parentText = descendantParentWrapper.wdLabel ?: descendantParentWrapper.wdValue;
|
|
156
|
+
if ([parentText isEqualToString:text]) {
|
|
157
|
+
// Avoid duplicated texts on Safari alerts
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (nil != text) {
|
|
163
|
+
[resultText addObject:[NSString stringWithFormat:@"%@", text]];
|
|
164
|
+
}
|
|
165
|
+
}];
|
|
166
|
+
return [resultText componentsJoinedByString:@"\n"];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
- (void)typeText:(NSString *)text
|
|
170
|
+
{
|
|
171
|
+
XCUIElement *alertElement = self.alertElement;
|
|
172
|
+
id<FBXCElementSnapshot> alertSnapshot = self.alertSnapshot;
|
|
173
|
+
if (nil == alertElement || nil == alertSnapshot) {
|
|
174
|
+
[self fb_raiseNotPresentException];
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
NSMutableArray<id<FBXCElementSnapshot>> *dstFieldSnapshots = [NSMutableArray array];
|
|
178
|
+
[alertSnapshot enumerateDescendantsUsingBlock:^(id<FBXCElementSnapshot> descendant) {
|
|
179
|
+
XCUIElementType elementType = descendant.elementType;
|
|
180
|
+
if (elementType == XCUIElementTypeTextField || elementType == XCUIElementTypeSecureTextField) {
|
|
181
|
+
[dstFieldSnapshots addObject:descendant];
|
|
182
|
+
}
|
|
183
|
+
}];
|
|
184
|
+
if (dstFieldSnapshots.count > 1) {
|
|
185
|
+
[self fb_raiseSetTextFailedExceptionWithReason:@"The alert contains more than one input field"];
|
|
186
|
+
}
|
|
187
|
+
id<FBXCElementSnapshot> dstFieldSnapshot = dstFieldSnapshots.firstObject;
|
|
188
|
+
if (nil == dstFieldSnapshot) {
|
|
189
|
+
[self fb_raiseSetTextFailedExceptionWithReason:@"The alert contains no input fields"];
|
|
190
|
+
}
|
|
191
|
+
XCUIElement *dstField = [XCUIApplication fb_elementForSnapshot:dstFieldSnapshot
|
|
192
|
+
underElement:alertElement];
|
|
193
|
+
if (nil == dstField) {
|
|
194
|
+
[self fb_raiseSetTextFailedExceptionWithReason:@"Failed to resolve the input field element"];
|
|
195
|
+
}
|
|
196
|
+
NSError *error;
|
|
197
|
+
// dstField was just resolved via a live query in fb_elementForSnapshot:underElement:
|
|
198
|
+
// above, so its cached snapshot can be safely reconstructed in memory
|
|
199
|
+
// instead of paying for a fresh round trip.
|
|
200
|
+
id<FBXCElementSnapshot> snapshot = dstField.fb_cachedSnapshot ?: [dstField fb_standardSnapshot];
|
|
201
|
+
if (![dstField fb_typeText:text
|
|
202
|
+
shouldClear:YES
|
|
203
|
+
frequency:FBConfiguration.sharedInstance.maxTypingFrequency
|
|
204
|
+
snapshot:snapshot
|
|
205
|
+
error:&error]) {
|
|
206
|
+
[self fb_raiseSetTextFailedExceptionWithReason:error.description];
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
- (NSArray *)buttonLabels
|
|
211
|
+
{
|
|
212
|
+
id<FBXCElementSnapshot> alertSnapshot = self.alertSnapshot;
|
|
213
|
+
if (nil == alertSnapshot) {
|
|
214
|
+
return nil;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
NSMutableArray<NSString *> *labels = [NSMutableArray array];
|
|
218
|
+
[alertSnapshot enumerateDescendantsUsingBlock:^(id<FBXCElementSnapshot> descendant) {
|
|
219
|
+
if (descendant.elementType != XCUIElementTypeButton) {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
NSString *label = [FBXCElementSnapshotWrapper ensureWrapped:descendant].wdLabel;
|
|
223
|
+
if (nil != label) {
|
|
224
|
+
[labels addObject:[NSString stringWithFormat:@"%@", label]];
|
|
225
|
+
}
|
|
226
|
+
}];
|
|
227
|
+
return labels.copy;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
- (void)accept
|
|
231
|
+
{
|
|
232
|
+
XCUIElement *alertElement = self.alertElement;
|
|
233
|
+
id<FBXCElementSnapshot> alertSnapshot = self.alertSnapshot;
|
|
234
|
+
if (nil == alertElement || nil == alertSnapshot) {
|
|
235
|
+
[self fb_raiseNotPresentException];
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
XCUIElement *acceptButton = nil;
|
|
239
|
+
NSString *acceptAlertButtonSelector = FBConfiguration.sharedInstance.acceptAlertButtonSelector ?: @"";
|
|
240
|
+
if (acceptAlertButtonSelector.length) {
|
|
241
|
+
NSString *errorReason = nil;
|
|
242
|
+
@try {
|
|
243
|
+
acceptButton = [[alertElement fb_descendantsMatchingClassChain:acceptAlertButtonSelector
|
|
244
|
+
shouldReturnAfterFirstMatch:YES] firstObject];
|
|
245
|
+
} @catch (NSException *ex) {
|
|
246
|
+
errorReason = ex.reason;
|
|
247
|
+
}
|
|
248
|
+
if (nil == acceptButton) {
|
|
249
|
+
[FBLogger logFmt:@"Cannot find any match for Accept alert button using the class chain selector '%@'",
|
|
250
|
+
acceptAlertButtonSelector];
|
|
251
|
+
if (nil != errorReason) {
|
|
252
|
+
[FBLogger logFmt:@"Original error: %@", errorReason];
|
|
253
|
+
}
|
|
254
|
+
[FBLogger log:@"Will fallback to the default button location algorithm"];
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
if (nil == acceptButton) {
|
|
258
|
+
// buttonSnapshotsInSnapshot's tree-order walk doesn't always match a
|
|
259
|
+
// live query's ordering: on the system location-permission alert (iOS
|
|
260
|
+
// 17.5, confirmed via manual testing), that mismatch put a
|
|
261
|
+
// non-dismissing "Precise: On/Off" toggle first, so accept/dismiss
|
|
262
|
+
// silently tapped the wrong control and left the alert on screen. Not
|
|
263
|
+
// reproduced on iOS 18+, so keep the cheaper snapshot walk there and
|
|
264
|
+
// only pay for a live query below iOS 18.
|
|
265
|
+
if (@available(iOS 18.0, *)) {
|
|
266
|
+
NSArray<id<FBXCElementSnapshot>> *buttonSnapshots = [self.class fb_buttonSnapshotsInSnapshot:alertSnapshot];
|
|
267
|
+
id<FBXCElementSnapshot> chosenSnapshot = (alertSnapshot.elementType == XCUIElementTypeAlert || [self.class isSafariWebAlertWithSnapshot:alertSnapshot])
|
|
268
|
+
? buttonSnapshots.lastObject
|
|
269
|
+
: buttonSnapshots.firstObject;
|
|
270
|
+
if (nil != chosenSnapshot) {
|
|
271
|
+
acceptButton = [XCUIApplication fb_elementForSnapshot:chosenSnapshot underElement:alertElement];
|
|
272
|
+
}
|
|
273
|
+
} else {
|
|
274
|
+
NSArray<XCUIElement *> *buttons = [alertElement.fb_query
|
|
275
|
+
descendantsMatchingType:XCUIElementTypeButton].allElementsBoundByIndex;
|
|
276
|
+
acceptButton = (alertSnapshot.elementType == XCUIElementTypeAlert || [self.class isSafariWebAlertWithSnapshot:alertSnapshot])
|
|
277
|
+
? buttons.lastObject
|
|
278
|
+
: buttons.firstObject;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
if (nil == acceptButton) {
|
|
282
|
+
[self fb_raiseActionFailedExceptionWithReason:
|
|
283
|
+
[NSString stringWithFormat:@"Failed to find accept button for alert: %@", alertElement]];
|
|
284
|
+
}
|
|
285
|
+
[acceptButton tap];
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
- (void)dismiss
|
|
289
|
+
{
|
|
290
|
+
XCUIElement *alertElement = self.alertElement;
|
|
291
|
+
id<FBXCElementSnapshot> alertSnapshot = self.alertSnapshot;
|
|
292
|
+
if (nil == alertElement || nil == alertSnapshot) {
|
|
293
|
+
[self fb_raiseNotPresentException];
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
XCUIElement *dismissButton = nil;
|
|
297
|
+
NSString *dismissAlertButtonSelector = FBConfiguration.sharedInstance.dismissAlertButtonSelector ?: @"";
|
|
298
|
+
if (dismissAlertButtonSelector.length) {
|
|
299
|
+
NSString *errorReason = nil;
|
|
300
|
+
@try {
|
|
301
|
+
dismissButton = [[alertElement fb_descendantsMatchingClassChain:dismissAlertButtonSelector
|
|
302
|
+
shouldReturnAfterFirstMatch:YES] firstObject];
|
|
303
|
+
} @catch (NSException *ex) {
|
|
304
|
+
errorReason = ex.reason;
|
|
305
|
+
}
|
|
306
|
+
if (nil == dismissButton) {
|
|
307
|
+
[FBLogger logFmt:@"Cannot find any match for Dismiss alert button using the class chain selector '%@'",
|
|
308
|
+
dismissAlertButtonSelector];
|
|
309
|
+
if (nil != errorReason) {
|
|
310
|
+
[FBLogger logFmt:@"Original error: %@", errorReason];
|
|
311
|
+
}
|
|
312
|
+
[FBLogger log:@"Will fallback to the default button location algorithm"];
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
if (nil == dismissButton) {
|
|
316
|
+
// See the matching comment in accept.
|
|
317
|
+
if (@available(iOS 18.0, *)) {
|
|
318
|
+
NSArray<id<FBXCElementSnapshot>> *buttonSnapshots = [self.class fb_buttonSnapshotsInSnapshot:alertSnapshot];
|
|
319
|
+
id<FBXCElementSnapshot> chosenSnapshot = (alertSnapshot.elementType == XCUIElementTypeAlert || [self.class isSafariWebAlertWithSnapshot:alertSnapshot])
|
|
320
|
+
? buttonSnapshots.firstObject
|
|
321
|
+
: buttonSnapshots.lastObject;
|
|
322
|
+
if (nil != chosenSnapshot) {
|
|
323
|
+
dismissButton = [XCUIApplication fb_elementForSnapshot:chosenSnapshot underElement:alertElement];
|
|
324
|
+
}
|
|
325
|
+
} else {
|
|
326
|
+
NSArray<XCUIElement *> *buttons = [alertElement.fb_query
|
|
327
|
+
descendantsMatchingType:XCUIElementTypeButton].allElementsBoundByIndex;
|
|
328
|
+
dismissButton = (alertSnapshot.elementType == XCUIElementTypeAlert || [self.class isSafariWebAlertWithSnapshot:alertSnapshot])
|
|
329
|
+
? buttons.firstObject
|
|
330
|
+
: buttons.lastObject;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
if (nil == dismissButton) {
|
|
335
|
+
[self fb_raiseActionFailedExceptionWithReason:
|
|
336
|
+
[NSString stringWithFormat:@"Failed to find dismiss button for alert: %@", alertElement]];
|
|
337
|
+
}
|
|
338
|
+
[dismissButton tap];
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
- (void)clickAlertButton:(NSString *)label
|
|
342
|
+
{
|
|
343
|
+
XCUIElement *alertElement = self.alertElement;
|
|
344
|
+
id<FBXCElementSnapshot> alertSnapshot = self.alertSnapshot;
|
|
345
|
+
if (nil == alertElement || nil == alertSnapshot) {
|
|
346
|
+
[self fb_raiseNotPresentException];
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
__block id<FBXCElementSnapshot> matchedSnapshot = nil;
|
|
350
|
+
[alertSnapshot enumerateDescendantsUsingBlock:^(id<FBXCElementSnapshot> descendant) {
|
|
351
|
+
if (nil != matchedSnapshot || descendant.elementType != XCUIElementTypeButton) {
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
NSString *btnLabel = [FBXCElementSnapshotWrapper ensureWrapped:descendant].wdLabel;
|
|
355
|
+
if (nil != btnLabel && [btnLabel isEqualToString:label]) {
|
|
356
|
+
matchedSnapshot = descendant;
|
|
357
|
+
}
|
|
358
|
+
}];
|
|
359
|
+
XCUIElement *requestedButton = nil == matchedSnapshot
|
|
360
|
+
? nil
|
|
361
|
+
: [XCUIApplication fb_elementForSnapshot:matchedSnapshot underElement:alertElement];
|
|
362
|
+
if (!requestedButton) {
|
|
363
|
+
[self fb_raiseActionFailedExceptionWithReason:
|
|
364
|
+
[NSString stringWithFormat:@"Failed to find button with label '%@' for alert: %@", label, alertElement]];
|
|
365
|
+
}
|
|
366
|
+
[requestedButton tap];
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
- (void)clickElementMatchingClassChain:(NSString *)classChain
|
|
370
|
+
{
|
|
371
|
+
XCUIElement *alertElement = self.alertElement;
|
|
372
|
+
if (nil == alertElement) {
|
|
373
|
+
[self fb_raiseNotPresentException];
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
// For a Safari web alert, alertElement is the containing scrollView, not
|
|
377
|
+
// the alert's own div (see fb_alertElementWithSnapshot:), so a classChain
|
|
378
|
+
// query from it could also match unrelated page content. Constrain
|
|
379
|
+
// matches to descendants of alertSnapshot by uid when available.
|
|
380
|
+
NSSet<NSString *> *alertSnapshotUids = nil;
|
|
381
|
+
id<FBXCElementSnapshot> alertSnapshot = self.alertSnapshot;
|
|
382
|
+
if (nil != alertSnapshot) {
|
|
383
|
+
NSMutableSet<NSString *> *uids = [NSMutableSet set];
|
|
384
|
+
NSString *rootUid = [FBXCElementSnapshotWrapper wdUIDWithSnapshot:alertSnapshot];
|
|
385
|
+
if (nil != rootUid) {
|
|
386
|
+
[uids addObject:rootUid];
|
|
387
|
+
}
|
|
388
|
+
[alertSnapshot enumerateDescendantsUsingBlock:^(id<FBXCElementSnapshot> descendant) {
|
|
389
|
+
NSString *uid = [FBXCElementSnapshotWrapper wdUIDWithSnapshot:descendant];
|
|
390
|
+
if (nil != uid) {
|
|
391
|
+
[uids addObject:uid];
|
|
392
|
+
}
|
|
393
|
+
}];
|
|
394
|
+
alertSnapshotUids = uids;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
NSArray<XCUIElement *> *matches = nil;
|
|
398
|
+
@try {
|
|
399
|
+
matches = [alertElement fb_descendantsMatchingClassChain:classChain
|
|
400
|
+
shouldReturnAfterFirstMatch:NO];
|
|
401
|
+
} @catch (NSException *ex) {
|
|
402
|
+
[self fb_raiseActionFailedExceptionWithReason:
|
|
403
|
+
[NSString stringWithFormat:@"Failed to match class chain selector '%@' for alert: %@. Original error: %@", classChain, alertElement, ex.reason]];
|
|
404
|
+
}
|
|
405
|
+
XCUIElement *matchedElement = nil;
|
|
406
|
+
for (XCUIElement *match in matches) {
|
|
407
|
+
NSString *matchUid = match.fb_uid;
|
|
408
|
+
if (nil == alertSnapshotUids || (nil != matchUid && [alertSnapshotUids containsObject:matchUid])) {
|
|
409
|
+
matchedElement = match;
|
|
410
|
+
break;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
if (nil == matchedElement) {
|
|
414
|
+
[self fb_raiseActionFailedExceptionWithReason:
|
|
415
|
+
[NSString stringWithFormat:@"Failed to find any element matching class chain selector '%@' for alert: %@", classChain, alertElement]];
|
|
416
|
+
}
|
|
417
|
+
[matchedElement tap];
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// Single source of truth for alert detection: checks each candidate
|
|
421
|
+
// application (systemApp, then self.application if different, then the iOS
|
|
422
|
+
// 18+ limited access prompt app) via targeted, predicate-filtered live
|
|
423
|
+
// queries (see XCUIApplication.fb_alertElementWithSnapshot:) instead of
|
|
424
|
+
// snapshotting and walking the whole application tree - the cost stays
|
|
425
|
+
// proportional to the number of alert-shaped elements rather than the
|
|
426
|
+
// size/depth of the app, which matters a lot for deeply nested view
|
|
427
|
+
// hierarchies. Only ever invoked once per instance, by the alertElement
|
|
428
|
+
// getter above, which caches both the element and (if one comes back) the
|
|
429
|
+
// snapshot obtained as a side effect of resolving it.
|
|
430
|
+
- (nullable XCUIElement *)alertElementFromApplication:(id<FBXCElementSnapshot> _Nullable *)snapshotOut
|
|
431
|
+
{
|
|
432
|
+
@try {
|
|
433
|
+
XCUIApplication *systemApp = XCUIApplication.fb_systemApplication;
|
|
434
|
+
NSMutableArray<XCUIApplication *> *candidates = [NSMutableArray arrayWithObject:systemApp];
|
|
435
|
+
if (![systemApp fb_isSameAppAs:self.application]) {
|
|
436
|
+
[candidates addObject:self.application];
|
|
437
|
+
}
|
|
438
|
+
XCUIApplication *promptApp = XCUIApplication.fb_limitedAccessPromptApplication;
|
|
439
|
+
if (nil != promptApp) {
|
|
440
|
+
[candidates addObject:promptApp];
|
|
441
|
+
}
|
|
442
|
+
for (XCUIApplication *candidate in candidates) {
|
|
443
|
+
XCUIElement *element = [candidate fb_alertElementWithSnapshot:snapshotOut];
|
|
444
|
+
if (nil != element) {
|
|
445
|
+
return element;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
} @catch (NSException *) {
|
|
449
|
+
return nil;
|
|
450
|
+
}
|
|
451
|
+
return nil;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
@end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
+
<string>en</string>
|
|
7
|
+
<key>CFBundleExecutable</key>
|
|
8
|
+
<string>$(EXECUTABLE_NAME)</string>
|
|
9
|
+
<key>CFBundleIdentifier</key>
|
|
10
|
+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
11
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
|
12
|
+
<string>6.0</string>
|
|
13
|
+
<key>CFBundleName</key>
|
|
14
|
+
<string>$(PRODUCT_NAME)</string>
|
|
15
|
+
<key>CFBundlePackageType</key>
|
|
16
|
+
<string>FMWK</string>
|
|
17
|
+
<key>CFBundleShortVersionString</key>
|
|
18
|
+
<string>1.7.0</string>
|
|
19
|
+
<key>CFBundleSignature</key>
|
|
20
|
+
<string>????</string>
|
|
21
|
+
<key>CFBundleVersion</key>
|
|
22
|
+
<string>1.7.0</string>
|
|
23
|
+
<key>NSPrincipalClass</key>
|
|
24
|
+
<string/>
|
|
25
|
+
</dict>
|
|
26
|
+
</plist>
|