From f18f73ef12dc76dad75922896d83a7394081bb83 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Tue, 19 Mar 2019 19:01:17 +0900 Subject: [PATCH 01/16] make tvos buildable --- Cartfile | 2 +- Cartfile.resolved | 2 +- PrivateHeaders/XCTest/XCEventGenerator.h | 8 +- WebDriverAgent.xcodeproj/project.pbxproj | 999 ++++++++++++++++++ .../xcschemes/WebDriverAgentLib.xcscheme | 2 - .../xcschemes/WebDriverAgentLib_tvOS.xcscheme | 80 ++ .../xcschemes/WebDriverAgentRunner.xcscheme | 2 - .../WebDriverAgentRunner_tvOS.xcscheme | 121 +++ WebDriverAgentLib copy-Info.plist | 26 + .../Categories/XCUIApplication+FBFocused.h | 24 + .../Categories/XCUIApplication+FBFocused.m | 21 + .../Categories/XCUIApplication+FBHelpers.m | 2 +- .../XCUIApplication+FBTouchAction.m | 4 +- .../Categories/XCUICoordinate+FBFix.h | 2 + .../Categories/XCUICoordinate+FBFix.m | 2 + .../Categories/XCUIDevice+FBHelpers.m | 6 + .../Categories/XCUIDevice+FBRotation.h | 2 + .../Categories/XCUIDevice+FBRotation.m | 2 + .../Categories/XCUIElement+FBIsVisible.m | 2 + .../Categories/XCUIElement+FBPickerWheel.m | 2 + .../Categories/XCUIElement+FBScrolling.h | 4 + .../Categories/XCUIElement+FBScrolling.m | 4 + .../Categories/XCUIElement+FBTVFocuse.h | 22 + .../Categories/XCUIElement+FBTVFocuse.m | 57 + .../Categories/XCUIElement+FBTap.m | 3 +- .../Categories/XCUIElement+FBTyping.m | 8 + .../Categories/XCUIElement+FBUtilities.m | 2 + .../XCUIElement+FBWebDriverAttributes.m | 9 + WebDriverAgentLib/Commands/FBCustomCommands.m | 2 + .../Commands/FBElementCommands.m | 8 + .../Commands/FBOrientationCommands.m | 4 + WebDriverAgentLib/FBSpringboardApplication.h | 20 + WebDriverAgentLib/FBSpringboardApplication.m | 50 + WebDriverAgentLib/Routing/FBElement.h | 5 + WebDriverAgentLib/Routing/FBElementUtils.h | 8 + .../Utilities/FBAppiumActionsSynthesizer.h | 2 + .../Utilities/FBAppiumActionsSynthesizer.m | 2 + .../Utilities/FBBaseActionsSynthesizer.h | 2 + .../Utilities/FBBaseActionsSynthesizer.m | 3 +- WebDriverAgentLib/Utilities/FBImageUtils.h | 2 + WebDriverAgentLib/Utilities/FBImageUtils.m | 2 + WebDriverAgentLib/Utilities/FBMathUtils.h | 2 + WebDriverAgentLib/Utilities/FBMathUtils.m | 2 + WebDriverAgentLib/Utilities/FBPasteboard.h | 2 + WebDriverAgentLib/Utilities/FBPasteboard.m | 2 + .../Utilities/FBTVNavigationTracker.h | 32 + .../Utilities/FBTVNavigationTracker.m | 144 +++ .../Utilities/FBW3CActionsSynthesizer.h | 2 + .../Utilities/FBW3CActionsSynthesizer.m | 2 + .../Utilities/FBXCTestDaemonsProxy.h | 2 + .../Utilities/FBXCTestDaemonsProxy.m | 2 + WebDriverAgentLib/Utilities/FBXPath.m | 31 +- .../Classes/FBNavigationController.m | 2 + .../IntegrationApp/Classes/ViewController.m | 2 + .../IntegrationApp_tvOS/Classes/AppDelegate.h | 15 + .../IntegrationApp_tvOS/Classes/AppDelegate.m | 16 + .../Classes/FBAlertsViewController.h | 17 + .../Classes/FBAlertsViewController.m | 66 ++ .../Classes/FBAttributesViewController.h | 18 + .../Classes/FBAttributesViewController.m | 23 + .../IntegrationApp_tvOS/Info.plist | 42 + .../Resources/Base.lproj/Main.storyboard | 512 +++++++++ .../Resources/Templates.storyboard | 376 +++++++ .../Resources/Templates~.storyboard | 394 +++++++ .../IntegrationApp_tvOS/main.m | 17 + .../IntegrationTests_tvOS/FBTVAlertTests.m | 161 +++ .../FBTVElementAttributeTests.m | 143 +++ .../FBTVElementScreenshotTests.m | 46 + .../FBTVElementSelectTests.m | 118 +++ .../FBTVElementVisibilityTests.m | 48 + .../FBTVFailureProofTestCaseTests.m | 45 + .../FBTVIntegrationTestCase.h | 65 ++ .../FBTVIntegrationTestCase.m | 103 ++ .../IntegrationTests_tvOS/FBTVKeyboardTests.m | 46 + .../IntegrationTests_tvOS/FBTVTypingTest.m | 60 ++ .../FBTVXPathIntegrationTests.m | 68 ++ .../IntegrationTests_tvOS/Info.plist | 22 + .../TVXCElementSnapshotHelperTests.m | 206 ++++ .../TVXCElementSnapshotHitPoint.m | 32 + .../TVXCUIApplicationHelperTests.m | 80 ++ .../TVXCUIDeviceHealthCheckTests.m | 28 + .../TVXCUIDeviceHelperTests.m | 56 + .../TVXCUIElementAttributesTests.m | 126 +++ .../TVXCUIElementFBFindTests.m | 336 ++++++ .../TVXCUIElementHelperIntegrationTests.m | 76 ++ 85 files changed, 5101 insertions(+), 17 deletions(-) create mode 100644 WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentLib_tvOS.xcscheme create mode 100644 WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentRunner_tvOS.xcscheme create mode 100644 WebDriverAgentLib copy-Info.plist create mode 100644 WebDriverAgentLib/Categories/XCUIApplication+FBFocused.h create mode 100644 WebDriverAgentLib/Categories/XCUIApplication+FBFocused.m create mode 100644 WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.h create mode 100644 WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m create mode 100644 WebDriverAgentLib/Utilities/FBTVNavigationTracker.h create mode 100644 WebDriverAgentLib/Utilities/FBTVNavigationTracker.m create mode 100644 WebDriverAgentTests/IntegrationApp_tvOS/Classes/AppDelegate.h create mode 100644 WebDriverAgentTests/IntegrationApp_tvOS/Classes/AppDelegate.m create mode 100644 WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAlertsViewController.h create mode 100644 WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAlertsViewController.m create mode 100644 WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAttributesViewController.h create mode 100644 WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAttributesViewController.m create mode 100644 WebDriverAgentTests/IntegrationApp_tvOS/Info.plist create mode 100644 WebDriverAgentTests/IntegrationApp_tvOS/Resources/Base.lproj/Main.storyboard create mode 100644 WebDriverAgentTests/IntegrationApp_tvOS/Resources/Templates.storyboard create mode 100644 WebDriverAgentTests/IntegrationApp_tvOS/Resources/Templates~.storyboard create mode 100644 WebDriverAgentTests/IntegrationApp_tvOS/main.m create mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/FBTVAlertTests.m create mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementAttributeTests.m create mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementScreenshotTests.m create mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementSelectTests.m create mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementVisibilityTests.m create mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/FBTVFailureProofTestCaseTests.m create mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/FBTVIntegrationTestCase.h create mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/FBTVIntegrationTestCase.m create mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/FBTVKeyboardTests.m create mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/FBTVTypingTest.m create mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/FBTVXPathIntegrationTests.m create mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/Info.plist create mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/TVXCElementSnapshotHelperTests.m create mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/TVXCElementSnapshotHitPoint.m create mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIApplicationHelperTests.m create mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIDeviceHealthCheckTests.m create mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIDeviceHelperTests.m create mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementAttributesTests.m create mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementFBFindTests.m create mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementHelperIntegrationTests.m diff --git a/Cartfile b/Cartfile index f96df7698..aae972220 100644 --- a/Cartfile +++ b/Cartfile @@ -2,7 +2,7 @@ github "appium/RoutingHTTPServer" # Used by the element cache -github "appium/YYCache" +github "KazuCocoa/YYCache" "master" # Used by screenshots broadcaster github "robbiehanson/CocoaAsyncSocket" diff --git a/Cartfile.resolved b/Cartfile.resolved index aa83891cd..fa5f1e532 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,3 +1,3 @@ +git "/Users/kazu/GitHub/YYCache" "06a2997117dd587e6a3206f19ad808993703b69f" github "appium/RoutingHTTPServer" "v1.0.2" -github "appium/YYCache" "1.0.5" github "robbiehanson/CocoaAsyncSocket" "7.6.3" diff --git a/PrivateHeaders/XCTest/XCEventGenerator.h b/PrivateHeaders/XCTest/XCEventGenerator.h index 2394bb269..23ae00fe5 100644 --- a/PrivateHeaders/XCTest/XCEventGenerator.h +++ b/PrivateHeaders/XCTest/XCEventGenerator.h @@ -25,7 +25,10 @@ typedef void (^XCEventGeneratorHandler)(XCSynthesizedEventRecord *record, NSErro @property unsigned long long generation; // @synthesize generation=_generation; //@property(readonly) NSObject *eventQueue; // @synthesize eventQueue=_eventQueue; -#if TARGET_OS_IPHONE +#if TARGET_OS_TV +// TODO: tvOS-specific headers + +#elif TARGET_OS_IPHONE - (double)rotateInRect:(CGRect)arg1 withRotation:(double)arg2 velocity:(double)arg3 orientation:(UIInterfaceOrientation)arg4 handler:(XCEventGeneratorHandler)arg5; - (double)pinchInRect:(CGRect)arg1 withScale:(double)arg2 velocity:(double)arg3 orientation:(UIInterfaceOrientation)arg4 handler:(XCEventGeneratorHandler)arg5; - (double)pressAtPoint:(CGPoint)arg1 forDuration:(double)arg2 liftAtPoint:(CGPoint)arg3 velocity:(double)arg4 orientation:(UIInterfaceOrientation)arg5 name:(NSString *)arg6 handler:(XCEventGeneratorHandler)arg7; @@ -43,9 +46,6 @@ typedef void (^XCEventGeneratorHandler)(XCSynthesizedEventRecord *record, NSErro // iOS 10.3 specific - (double)forcePressAtPoint:(struct CGPoint)arg1 orientation:(long long)arg2 handler:(CDUnknownBlockType)arg3; -#elif TARGET_OS_TV -// TODO: tvOS-specific headers - #elif TARGET_OS_MAC - (double)sendKeyboardInputs:(id)arg1 layout:(id)arg2 handler:(CDUnknownBlockType)arg3; - (double)sendKey:(id)arg1 modifierFlags:(unsigned long long)arg2 handler:(CDUnknownBlockType)arg3; diff --git a/WebDriverAgent.xcodeproj/project.pbxproj b/WebDriverAgent.xcodeproj/project.pbxproj index 2d4341a15..76c6917d6 100644 --- a/WebDriverAgent.xcodeproj/project.pbxproj +++ b/WebDriverAgent.xcodeproj/project.pbxproj @@ -14,6 +14,305 @@ 63FD950221F9D06100A3E356 /* FBImageIOScalerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 631B523421F6174300625362 /* FBImageIOScalerTests.m */; }; 63FD950321F9D06100A3E356 /* FBImageIOScalerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 631B523421F6174300625362 /* FBImageIOScalerTests.m */; }; 63FD950421F9D06200A3E356 /* FBImageIOScalerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 631B523421F6174300625362 /* FBImageIOScalerTests.m */; }; + 641EE3452240C1C800173FCB /* UITestingUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7FD1CAEE048008C271F /* UITestingUITests.m */; }; + 641EE5D72240C5CA00173FCB /* FBScreenshotCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB75F1CAEDF0C008C271F /* FBScreenshotCommands.m */; }; + 641EE5D82240C5CA00173FCB /* FBPredicate.m in Sources */ = {isa = PBXBuildFile; fileRef = EEEC7C911F21F27A0053426C /* FBPredicate.m */; }; + 641EE5D92240C5CA00173FCB /* XCUIElement+FBPickerWheel.m in Sources */ = {isa = PBXBuildFile; fileRef = 7136A4781E8918E60024FC3D /* XCUIElement+FBPickerWheel.m */; }; + 641EE5DA2240C5CA00173FCB /* XCUIApplicationProcessDelay.m in Sources */ = {isa = PBXBuildFile; fileRef = 6385F4A5220A40760095BBDB /* XCUIApplicationProcessDelay.m */; }; + 641EE5DB2240C5CA00173FCB /* FBXPath.m in Sources */ = {isa = PBXBuildFile; fileRef = 711084431DA3AA7500F913D6 /* FBXPath.m */; }; + 641EE5DC2240C5CA00173FCB /* XCUIApplication+FBAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 719CD8FB2126C88B00C7D0C2 /* XCUIApplication+FBAlert.m */; }; + 641EE5DD2240C5CA00173FCB /* FBAppiumActionsSynthesizer.m in Sources */ = {isa = PBXBuildFile; fileRef = 71241D771FAE31F100B9559F /* FBAppiumActionsSynthesizer.m */; }; + 641EE5DE2240C5CA00173FCB /* XCUIApplication+FBTouchAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BD20721F86116100B36EC2 /* XCUIApplication+FBTouchAction.m */; }; + 641EE5DF2240C5CA00173FCB /* FBWebServer.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB78D1CAEDF0C008C271F /* FBWebServer.m */; }; + 641EE5E02240C5CA00173FCB /* FBTCPSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 715557D2211DBCE700613B26 /* FBTCPSocket.m */; }; + 641EE5E12240C5CA00173FCB /* FBErrorBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = EE3A18611CDE618F00DE4205 /* FBErrorBuilder.m */; }; + 641EE5E22240C5CA00173FCB /* XCUIElement+FBClassChain.m in Sources */ = {isa = PBXBuildFile; fileRef = 71A7EAF41E20516B001DA4F2 /* XCUIElement+FBClassChain.m */; }; + 641EE5E32240C5CA00173FCB /* NSExpression+FBFormat.m in Sources */ = {isa = PBXBuildFile; fileRef = 71555A3C1DEC460A007D4A8B /* NSExpression+FBFormat.m */; }; + 641EE5E42240C5CA00173FCB /* XCUIApplication+FBHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = AD6C269B1CF2494200F8B5FF /* XCUIApplication+FBHelpers.m */; }; + 641EE5E52240C5CA00173FCB /* FBKeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = EE3A18651CDE734B00DE4205 /* FBKeyboard.m */; }; + 641EE5E62240C5CA00173FCB /* FBElementUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 713C6DCE1DDC772A00285B92 /* FBElementUtils.m */; }; + 641EE5E72240C5CA00173FCB /* FBW3CActionsSynthesizer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7140974A1FAE1B51008FB2C5 /* FBW3CActionsSynthesizer.m */; }; + 641EE5E82240C5CA00173FCB /* FBApplicationProcessProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7691CAEDF0C008C271F /* FBApplicationProcessProxy.m */; }; + 641EE5E92240C5CA00173FCB /* FBFailureProofTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = EE6A89391D0B38640083E92B /* FBFailureProofTestCase.m */; }; + 641EE5EA2240C5CA00173FCB /* XCUIElement+FBIsVisible.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7481CAEDF0C008C271F /* XCUIElement+FBIsVisible.m */; }; + 641EE5EB2240C5CA00173FCB /* XCUIElement+FBFind.m in Sources */ = {isa = PBXBuildFile; fileRef = EEBBD48A1D47746D00656A81 /* XCUIElement+FBFind.m */; }; + 641EE5EC2240C5CA00173FCB /* FBResponsePayload.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7831CAEDF0C008C271F /* FBResponsePayload.m */; }; + 641EE5ED2240C5CA00173FCB /* FBRoute.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7851CAEDF0C008C271F /* FBRoute.m */; }; + 641EE5EE2240C5CA00173FCB /* NSString+FBVisualLength.m in Sources */ = {isa = PBXBuildFile; fileRef = EE0D1F601EBCDCF7006A3123 /* NSString+FBVisualLength.m */; }; + 641EE5EF2240C5CA00173FCB /* FBRunLoopSpinner.m in Sources */ = {isa = PBXBuildFile; fileRef = EEE9B4711CD02B88009D2030 /* FBRunLoopSpinner.m */; }; + 641EE5F02240C5CA00173FCB /* FBAlertsMonitor.m in Sources */ = {isa = PBXBuildFile; fileRef = 719CD8F72126C78F00C7D0C2 /* FBAlertsMonitor.m */; }; + 641EE5F12240C5CA00173FCB /* FBClassChainQueryParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 71A7EAF81E224648001DA4F2 /* FBClassChainQueryParser.m */; }; + 641EE5F22240C5CA00173FCB /* NSPredicate+FBFormat.m in Sources */ = {isa = PBXBuildFile; fileRef = 71A224E41DE2F56600844D55 /* NSPredicate+FBFormat.m */; }; + 641EE5F32240C5CA00173FCB /* XCAccessibilityElement+FBComparison.m in Sources */ = {isa = PBXBuildFile; fileRef = 710C16CC21497A08006EA1D0 /* XCAccessibilityElement+FBComparison.m */; }; + 641EE5F42240C5CA00173FCB /* XCUIDevice+FBRotation.m in Sources */ = {isa = PBXBuildFile; fileRef = EEE3763E1D59F81400ED88DD /* XCUIDevice+FBRotation.m */; }; + 641EE5F52240C5CA00173FCB /* XCUIElement+FBUID.m in Sources */ = {isa = PBXBuildFile; fileRef = 71B49EC61ED1A58100D51AD6 /* XCUIElement+FBUID.m */; }; + 641EE5F62240C5CA00173FCB /* FBRouteRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7881CAEDF0C008C271F /* FBRouteRequest.m */; }; + 641EE5F72240C5CA00173FCB /* FBResponseJSONPayload.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7811CAEDF0C008C271F /* FBResponseJSONPayload.m */; }; + 641EE5F82240C5CA00173FCB /* FBXCTestCaseImplementationFailureHoldingProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = EE7E271B1D06C69F001BEC7B /* FBXCTestCaseImplementationFailureHoldingProxy.m */; }; + 641EE5F92240C5CA00173FCB /* FBMjpegServer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7155D702211DCEF400166C20 /* FBMjpegServer.m */; }; + 641EE5FA2240C5CA00173FCB /* XCUIDevice+FBHealthCheck.m in Sources */ = {isa = PBXBuildFile; fileRef = EEDFE1201D9C06F800E6FFE5 /* XCUIDevice+FBHealthCheck.m */; }; + 641EE5FB2240C5CA00173FCB /* FBSpringboardApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = EEC088EB1CB5706D00B65968 /* FBSpringboardApplication.m */; }; + 641EE5FC2240C5CA00173FCB /* FBResponseFilePayload.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB77F1CAEDF0C008C271F /* FBResponseFilePayload.m */; }; + 641EE5FD2240C5CA00173FCB /* FBBaseActionsSynthesizer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7140974D1FAE20EE008FB2C5 /* FBBaseActionsSynthesizer.m */; }; + 641EE5FE2240C5CA00173FCB /* XCUIElement+FBWebDriverAttributes.m in Sources */ = {isa = PBXBuildFile; fileRef = EEE376481D59FAE900ED88DD /* XCUIElement+FBWebDriverAttributes.m */; }; + 641EE5FF2240C5CA00173FCB /* XCUIElement+FBForceTouch.m in Sources */ = {isa = PBXBuildFile; fileRef = EE8DDD7C20C5733B004D4925 /* XCUIElement+FBForceTouch.m */; }; + 641EE6002240C5CA00173FCB /* FBTouchActionCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = 71241D7A1FAE3D2500B9559F /* FBTouchActionCommands.m */; }; + 641EE6012240C5CA00173FCB /* FBImageIOScaler.m in Sources */ = {isa = PBXBuildFile; fileRef = 63CCF91121ECE4C700E94ABD /* FBImageIOScaler.m */; }; + 641EE6022240C5CA00173FCB /* FBTouchIDCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7631CAEDF0C008C271F /* FBTouchIDCommands.m */; }; + 641EE6032240C5CA00173FCB /* FBDebugCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7551CAEDF0C008C271F /* FBDebugCommands.m */; }; + 641EE6042240C5CA00173FCB /* NSString+FBXMLSafeString.m in Sources */ = {isa = PBXBuildFile; fileRef = 716E0BCD1E917E810087A825 /* NSString+FBXMLSafeString.m */; }; + 641EE6052240C5CA00173FCB /* FBUnknownCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7651CAEDF0C008C271F /* FBUnknownCommands.m */; }; + 641EE6062240C5CA00173FCB /* FBOrientationCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB75D1CAEDF0C008C271F /* FBOrientationCommands.m */; }; + 641EE6072240C5CA00173FCB /* XCUICoordinate+FBFix.m in Sources */ = {isa = PBXBuildFile; fileRef = EEC9EED520064FAA00BC0D5B /* XCUICoordinate+FBFix.m */; }; + 641EE6082240C5CA00173FCB /* FBRuntimeUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7921CAEDF0C008C271F /* FBRuntimeUtils.m */; }; + 641EE6092240C5CA00173FCB /* XCUIElement+FBUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = EEE376401D59F81400ED88DD /* XCUIElement+FBUtilities.m */; }; + 641EE60A2240C5CA00173FCB /* FBLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9B76A41CF7A43900275851 /* FBLogger.m */; }; + 641EE60B2240C5CA00173FCB /* FBCustomCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7531CAEDF0C008C271F /* FBCustomCommands.m */; }; + 641EE60C2240C5CA00173FCB /* XCUIDevice+FBHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = AD6C26971CF2481700F8B5FF /* XCUIDevice+FBHelpers.m */; }; + 641EE60D2240C5CA00173FCB /* XCTestPrivateSymbols.m in Sources */ = {isa = PBXBuildFile; fileRef = EE6B64FC1D0F86EF00E85F5D /* XCTestPrivateSymbols.m */; }; + 641EE60E2240C5CA00173FCB /* XCUIElement+FBTyping.m in Sources */ = {isa = PBXBuildFile; fileRef = AD76723C1D6B7CC000610457 /* XCUIElement+FBTyping.m */; }; + 641EE60F2240C5CA00173FCB /* XCUIElement+FBAccessibility.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7461CAEDF0C008C271F /* XCUIElement+FBAccessibility.m */; }; + 641EE6102240C5CA00173FCB /* FBImageUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 7150348621A6DAD600A0F4BA /* FBImageUtils.m */; }; + 641EE6112240C5CA00173FCB /* FBSession.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB78B1CAEDF0C008C271F /* FBSession.m */; }; + 641EE6122240C5CA00173FCB /* FBFindElementCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7591CAEDF0C008C271F /* FBFindElementCommands.m */; }; + 641EE6132240C5CA00173FCB /* FBDebugLogDelegateDecorator.m in Sources */ = {isa = PBXBuildFile; fileRef = EE7E27191D06C69F001BEC7B /* FBDebugLogDelegateDecorator.m */; }; + 641EE6142240C5CA00173FCB /* FBAlertViewCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7511CAEDF0C008C271F /* FBAlertViewCommands.m */; }; + 641EE6152240C5CA00173FCB /* XCUIElement+FBScrolling.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB74A1CAEDF0C008C271F /* XCUIElement+FBScrolling.m */; }; + 641EE6162240C5CA00173FCB /* FBSessionCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7611CAEDF0C008C271F /* FBSessionCommands.m */; }; + 641EE6172240C5CA00173FCB /* FBInspectorCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB75B1CAEDF0C008C271F /* FBInspectorCommands.m */; }; + 641EE6182240C5CA00173FCB /* XCElementSnapshot+FBHitPoint.m in Sources */ = {isa = PBXBuildFile; fileRef = EE006EAF1EBA1AA9006900A4 /* XCElementSnapshot+FBHitPoint.m */; }; + 641EE6192240C5CA00173FCB /* FBConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9B76A21CF7A43900275851 /* FBConfiguration.m */; }; + 641EE61A2240C5CA00173FCB /* FBElementCache.m in Sources */ = {isa = PBXBuildFile; fileRef = EEC088E41CB56AC000B65968 /* FBElementCache.m */; }; + 641EE61B2240C5CA00173FCB /* FBPasteboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 71930C4120662E1F00D3AFEC /* FBPasteboard.m */; }; + 641EE61C2240C5CA00173FCB /* FBAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = AD6C26931CF2379700F8B5FF /* FBAlert.m */; }; + 641EE61D2240C5CA00173FCB /* FBElementCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7571CAEDF0C008C271F /* FBElementCommands.m */; }; + 641EE61E2240C5CA00173FCB /* FBExceptionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = EEC088E71CB56DA400B65968 /* FBExceptionHandler.m */; }; + 641EE61F2240C5CA00173FCB /* FBXCodeCompatibility.m in Sources */ = {isa = PBXBuildFile; fileRef = EE5A24411F136C8D0078B1D9 /* FBXCodeCompatibility.m */; }; + 641EE6202240C5CA00173FCB /* XCElementSnapshot+FBHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = EEE3763C1D59F81400ED88DD /* XCElementSnapshot+FBHelpers.m */; }; + 641EE6212240C5CA00173FCB /* FBElementTypeTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7901CAEDF0C008C271F /* FBElementTypeTransformer.m */; }; + 641EE6222240C5CA00173FCB /* FBApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7671CAEDF0C008C271F /* FBApplication.m */; }; + 641EE6232240C5CA00173FCB /* FBScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 715AFAC01FFA29180053896D /* FBScreen.m */; }; + 641EE6242240C5CA00173FCB /* FBXCTestDaemonsProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = EE35AD7A1E3B80C000A02D78 /* FBXCTestDaemonsProxy.m */; }; + 641EE6252240C5CA00173FCB /* XCUIElement+FBTap.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB74C1CAEDF0C008C271F /* XCUIElement+FBTap.m */; }; + 641EE6262240C5CA00173FCB /* FBMathUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = EE1888391DA661C400307AA8 /* FBMathUtils.m */; }; + 641EE6272240C5CA00173FCB /* FBXCAXClientProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7157B290221DADD2001C348C /* FBXCAXClientProxy.m */; }; + 641EE6292240C5CA00173FCB /* libxml2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 71018200211DF62C002FD3A8 /* libxml2.tbd */; }; + 641EE62A2240C5CA00173FCB /* libAccessibility.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 7101820C211E026B002FD3A8 /* libAccessibility.tbd */; }; + 641EE62E2240C5CA00173FCB /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EE8980D321105B49001789EE /* XCTest.framework */; }; + 641EE62F2240C5CA00173FCB /* XCTAutomationSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EE8980D321105B49001789ED /* XCTAutomationSupport.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; + 641EE6312240C5CA00173FCB /* XCUIElement+FBWebDriverAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = EEE376471D59FAE900ED88DD /* XCUIElement+FBWebDriverAttributes.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6322240C5CA00173FCB /* FBScreen.h in Headers */ = {isa = PBXBuildFile; fileRef = 715AFABF1FFA29180053896D /* FBScreen.h */; }; + 641EE6332240C5CA00173FCB /* XCTestPrivateSymbols.h in Headers */ = {isa = PBXBuildFile; fileRef = EE6B64FB1D0F86EF00E85F5D /* XCTestPrivateSymbols.h */; }; + 641EE6342240C5CA00173FCB /* XCUIElement+FBTyping.h in Headers */ = {isa = PBXBuildFile; fileRef = AD76723B1D6B7CC000610457 /* XCUIElement+FBTyping.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6352240C5CA00173FCB /* XCUIElement+FBUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = EEE3763F1D59F81400ED88DD /* XCUIElement+FBUtilities.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6362240C5CA00173FCB /* XCUIElement+FBScrolling.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7491CAEDF0C008C271F /* XCUIElement+FBScrolling.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6372240C5CA00173FCB /* XCSourceCodeTreeNode.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACC51E3B77D600A02D78 /* XCSourceCodeTreeNode.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6382240C5CA00173FCB /* XCPointerEventPath.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACC31E3B77D600A02D78 /* XCPointerEventPath.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6392240C5CA00173FCB /* FBRouteRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7871CAEDF0C008C271F /* FBRouteRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE63A2240C5CA00173FCB /* XCTest.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACCF1E3B77D600A02D78 /* XCTest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE63B2240C5CA00173FCB /* FBAlertsMonitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 719CD8F62126C78F00C7D0C2 /* FBAlertsMonitor.h */; }; + 641EE63C2240C5CA00173FCB /* XCAccessibilityElement.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACB31E3B77D600A02D78 /* XCAccessibilityElement.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE63D2240C5CA00173FCB /* FBSession.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB78A1CAEDF0C008C271F /* FBSession.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE63E2240C5CA00173FCB /* _XCTestImplementation.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35AC9E1E3B77D600A02D78 /* _XCTestImplementation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE63F2240C5CA00173FCB /* FBTouchActionCommands.h in Headers */ = {isa = PBXBuildFile; fileRef = 71241D791FAE3D2500B9559F /* FBTouchActionCommands.h */; }; + 641EE6402240C5CA00173FCB /* FBTouchIDCommands.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7621CAEDF0C008C271F /* FBTouchIDCommands.h */; }; + 641EE6412240C5CA00173FCB /* XCUIApplication.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACF91E3B77D600A02D78 /* XCUIApplication.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6422240C5CA00173FCB /* FBCustomCommands.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7521CAEDF0C008C271F /* FBCustomCommands.h */; }; + 641EE6432240C5CA00173FCB /* _XCTestCaseInterruptionException.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35AC9C1E3B77D600A02D78 /* _XCTestCaseInterruptionException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6442240C5CA00173FCB /* FBOrientationCommands.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB75C1CAEDF0C008C271F /* FBOrientationCommands.h */; }; + 641EE6452240C5CA00173FCB /* XCUIScreen.h in Headers */ = {isa = PBXBuildFile; fileRef = 7119097B2152580600BA3C7E /* XCUIScreen.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6462240C5CA00173FCB /* XCTRunnerIDESession.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACF01E3B77D600A02D78 /* XCTRunnerIDESession.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6472240C5CA00173FCB /* FBRouteRequest-Private.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7861CAEDF0C008C271F /* FBRouteRequest-Private.h */; }; + 641EE6482240C5CA00173FCB /* XCTTestRunSession.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACF11E3B77D600A02D78 /* XCTTestRunSession.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6492240C5CA00173FCB /* XCTestProbe.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACE31E3B77D600A02D78 /* XCTestProbe.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE64A2240C5CA00173FCB /* XCApplicationQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACB71E3B77D600A02D78 /* XCApplicationQuery.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE64B2240C5CA00173FCB /* XCTAsyncActivity.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACCB1E3B77D600A02D78 /* XCTAsyncActivity.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE64C2240C5CA00173FCB /* XCTestMisuseObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACDF1E3B77D600A02D78 /* XCTestMisuseObserver.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE64D2240C5CA00173FCB /* XCTRunnerDaemonSession.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACEF1E3B77D600A02D78 /* XCTRunnerDaemonSession.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE64E2240C5CA00173FCB /* FBApplication.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7661CAEDF0C008C271F /* FBApplication.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE64F2240C5CA00173FCB /* XCTestExpectationWaiter.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACDA1E3B77D600A02D78 /* XCTestExpectationWaiter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6502240C5CA00173FCB /* UIGestureRecognizer-RecordingAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACAD1E3B77D600A02D78 /* UIGestureRecognizer-RecordingAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6512240C5CA00173FCB /* XCKeyboardKeyMap.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACBF1E3B77D600A02D78 /* XCKeyboardKeyMap.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6522240C5CA00173FCB /* XCTNSPredicateExpectationObject-Protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACEC1E3B77D600A02D78 /* XCTNSPredicateExpectationObject-Protocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6532240C5CA00173FCB /* WebDriverAgentLib.h in Headers */ = {isa = PBXBuildFile; fileRef = EE158B5E1CBD47A000A3E3F0 /* WebDriverAgentLib.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6542240C5CA00173FCB /* FBFindElementCommands.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7581CAEDF0C008C271F /* FBFindElementCommands.h */; }; + 641EE6552240C5CA00173FCB /* XCTestRun.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACE41E3B77D600A02D78 /* XCTestRun.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6562240C5CA00173FCB /* FBWebServer.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB78C1CAEDF0C008C271F /* FBWebServer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6572240C5CA00173FCB /* FBScreenshotCommands.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB75E1CAEDF0C008C271F /* FBScreenshotCommands.h */; }; + 641EE6582240C5CA00173FCB /* _XCKVOExpectationImplementation.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35AC991E3B77D600A02D78 /* _XCKVOExpectationImplementation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6592240C5CA00173FCB /* NSString+FBVisualLength.h in Headers */ = {isa = PBXBuildFile; fileRef = EE0D1F5F1EBCDCF7006A3123 /* NSString+FBVisualLength.h */; }; + 641EE65A2240C5CA00173FCB /* FBXCTestDaemonsProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35AD791E3B80C000A02D78 /* FBXCTestDaemonsProxy.h */; }; + 641EE65B2240C5CA00173FCB /* XCUIElementHitPointCoordinate.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35AD011E3B77D600A02D78 /* XCUIElementHitPointCoordinate.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE65C2240C5CA00173FCB /* XCTDarwinNotificationExpectation.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACCE1E3B77D600A02D78 /* XCTDarwinNotificationExpectation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE65D2240C5CA00173FCB /* XCTRunnerAutomationSession.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACEE1E3B77D600A02D78 /* XCTRunnerAutomationSession.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE65E2240C5CA00173FCB /* XCUICoordinate+FBFix.h in Headers */ = {isa = PBXBuildFile; fileRef = EEC9EED420064FAA00BC0D5B /* XCUICoordinate+FBFix.h */; }; + 641EE65F2240C5CA00173FCB /* XCSourceCodeTreeNodeEnumerator.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACC61E3B77D600A02D78 /* XCSourceCodeTreeNodeEnumerator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6602240C5CA00173FCB /* XCUIElement+FBIsVisible.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7471CAEDF0C008C271F /* XCUIElement+FBIsVisible.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6612240C5CA00173FCB /* XCUIElement+FBTap.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB74B1CAEDF0C008C271F /* XCUIElement+FBTap.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6622240C5CA00173FCB /* FBResponsePayload.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7821CAEDF0C008C271F /* FBResponsePayload.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6632240C5CA00173FCB /* FBUnknownCommands.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7641CAEDF0C008C271F /* FBUnknownCommands.h */; }; + 641EE6642240C5CA00173FCB /* NSPredicate+FBFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 71A224E31DE2F56600844D55 /* NSPredicate+FBFormat.h */; }; + 641EE6652240C5CA00173FCB /* UILongPressGestureRecognizer-RecordingAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACAE1E3B77D600A02D78 /* UILongPressGestureRecognizer-RecordingAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6662240C5CA00173FCB /* XCTestCase.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACD01E3B77D600A02D78 /* XCTestCase.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6672240C5CA00173FCB /* XCSymbolicatorHolder.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACC81E3B77D600A02D78 /* XCSymbolicatorHolder.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6682240C5CA00173FCB /* XCUIApplicationImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACFA1E3B77D600A02D78 /* XCUIApplicationImpl.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6692240C5CA00173FCB /* UIPanGestureRecognizer-RecordingAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACAF1E3B77D600A02D78 /* UIPanGestureRecognizer-RecordingAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE66A2240C5CA00173FCB /* NSExpression+FBFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 71555A3B1DEC460A007D4A8B /* NSExpression+FBFormat.h */; }; + 641EE66B2240C5CA00173FCB /* _XCTestCaseImplementation.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35AC9B1E3B77D600A02D78 /* _XCTestCaseImplementation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE66C2240C5CA00173FCB /* UIPinchGestureRecognizer-RecordingAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACB01E3B77D600A02D78 /* UIPinchGestureRecognizer-RecordingAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE66D2240C5CA00173FCB /* XCTestManager_TestsInterface-Protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACDE1E3B77D600A02D78 /* XCTestManager_TestsInterface-Protocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE66E2240C5CA00173FCB /* XCUIApplication+FBAlert.h in Headers */ = {isa = PBXBuildFile; fileRef = 719CD8FA2126C88B00C7D0C2 /* XCUIApplication+FBAlert.h */; }; + 641EE66F2240C5CA00173FCB /* XCDeviceEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACBA1E3B77D600A02D78 /* XCDeviceEvent.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6702240C5CA00173FCB /* FBMathUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = EE1888381DA661C400307AA8 /* FBMathUtils.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6712240C5CA00173FCB /* UISwipeGestureRecognizer-RecordingAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACB11E3B77D600A02D78 /* UISwipeGestureRecognizer-RecordingAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6722240C5CA00173FCB /* FBElementUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 713C6DCD1DDC772A00285B92 /* FBElementUtils.h */; }; + 641EE6732240C5CA00173FCB /* FBDebugCommands.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7541CAEDF0C008C271F /* FBDebugCommands.h */; }; + 641EE6742240C5CA00173FCB /* XCTestSuite.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACE51E3B77D600A02D78 /* XCTestSuite.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6752240C5CA00173FCB /* XCUICoordinate.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACFC1E3B77D600A02D78 /* XCUICoordinate.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6762240C5CA00173FCB /* XCTNSPredicateExpectation.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACEB1E3B77D600A02D78 /* XCTNSPredicateExpectation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6772240C5CA00173FCB /* XCTestObservationCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACE11E3B77D600A02D78 /* XCTestObservationCenter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6782240C5CA00173FCB /* XCTNSNotificationExpectation.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACEA1E3B77D600A02D78 /* XCTNSNotificationExpectation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6792240C5CA00173FCB /* XCUIRecorderNodeFinder.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35AD041E3B77D600A02D78 /* XCUIRecorderNodeFinder.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE67A2240C5CA00173FCB /* XCUIElement+FBAccessibility.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7451CAEDF0C008C271F /* XCUIElement+FBAccessibility.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE67B2240C5CA00173FCB /* XCUIRecorderUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35AD071E3B77D600A02D78 /* XCUIRecorderUtilities.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE67C2240C5CA00173FCB /* XCTestCaseRun.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACD11E3B77D600A02D78 /* XCTestCaseRun.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE67D2240C5CA00173FCB /* XCTestConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACD31E3B77D600A02D78 /* XCTestConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE67E2240C5CA00173FCB /* _XCTDarwinNotificationExpectationImplementation.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35AC9A1E3B77D600A02D78 /* _XCTDarwinNotificationExpectationImplementation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE67F2240C5CA00173FCB /* XCTestExpectation.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACD81E3B77D600A02D78 /* XCTestExpectation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6802240C5CA00173FCB /* FBElementTypeTransformer.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB78F1CAEDF0C008C271F /* FBElementTypeTransformer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6812240C5CA00173FCB /* FBXCAXClientProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 7157B28F221DADD2001C348C /* FBXCAXClientProxy.h */; }; + 641EE6822240C5CA00173FCB /* FBElementCache.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB77B1CAEDF0C008C271F /* FBElementCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6832240C5CA00173FCB /* XCTMetric.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACE91E3B77D600A02D78 /* XCTMetric.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6842240C5CA00173FCB /* XCTestContextScope.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACD51E3B77D600A02D78 /* XCTestContextScope.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6852240C5CA00173FCB /* XCUIElement+FBClassChain.h in Headers */ = {isa = PBXBuildFile; fileRef = 71A7EAF31E20516B001DA4F2 /* XCUIElement+FBClassChain.h */; }; + 641EE6862240C5CA00173FCB /* FBResponseJSONPayload.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7801CAEDF0C008C271F /* FBResponseJSONPayload.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6872240C5CA00173FCB /* XCTAutomationTarget-Protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACCC1E3B77D600A02D78 /* XCTAutomationTarget-Protocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6882240C5CA00173FCB /* FBElement.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7791CAEDF0C008C271F /* FBElement.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6892240C5CA00173FCB /* XCTAXClient-Protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACCD1E3B77D600A02D78 /* XCTAXClient-Protocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE68A2240C5CA00173FCB /* FBPredicate.h in Headers */ = {isa = PBXBuildFile; fileRef = EEEC7C901F21F27A0053426C /* FBPredicate.h */; }; + 641EE68B2240C5CA00173FCB /* FBExceptionHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = EEC088E61CB56DA400B65968 /* FBExceptionHandler.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE68C2240C5CA00173FCB /* FBRoute.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7841CAEDF0C008C271F /* FBRoute.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE68D2240C5CA00173FCB /* XCTestDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACD61E3B77D600A02D78 /* XCTestDriver.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE68E2240C5CA00173FCB /* _XCTNSNotificationExpectationImplementation.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACA11E3B77D600A02D78 /* _XCTNSNotificationExpectationImplementation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE68F2240C5CA00173FCB /* XCSynthesizedEventRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACC91E3B77D600A02D78 /* XCSynthesizedEventRecord.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6902240C5CA00173FCB /* FBInspectorCommands.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB75A1CAEDF0C008C271F /* FBInspectorCommands.h */; }; + 641EE6912240C5CA00173FCB /* FBApplicationProcessProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7681CAEDF0C008C271F /* FBApplicationProcessProxy.h */; }; + 641EE6922240C5CA00173FCB /* XCTWaiterDelegatePrivate-Protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACF61E3B77D600A02D78 /* XCTWaiterDelegatePrivate-Protocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6932240C5CA00173FCB /* XCTestManager_IDEInterface-Protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACDC1E3B77D600A02D78 /* XCTestManager_IDEInterface-Protocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6942240C5CA00173FCB /* FBXPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 711084421DA3AA7500F913D6 /* FBXPath.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6952240C5CA00173FCB /* XCUIRecorderTimingMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35AD061E3B77D600A02D78 /* XCUIRecorderTimingMessage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6962240C5CA00173FCB /* XCApplicationMonitor.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACB61E3B77D600A02D78 /* XCApplicationMonitor.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6972240C5CA00173FCB /* XCUIElement+FBForceTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = EE8DDD7D20C5733C004D4925 /* XCUIElement+FBForceTouch.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6982240C5CA00173FCB /* FBRuntimeUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7911CAEDF0C008C271F /* FBRuntimeUtils.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6992240C5CA00173FCB /* XCUIElement+FBPickerWheel.h in Headers */ = {isa = PBXBuildFile; fileRef = 7136A4771E8918E60024FC3D /* XCUIElement+FBPickerWheel.h */; }; + 641EE69A2240C5CA00173FCB /* XCTestObservation-Protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACE01E3B77D600A02D78 /* XCTestObservation-Protocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE69B2240C5CA00173FCB /* _XCTNSPredicateExpectationImplementation.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACA21E3B77D600A02D78 /* _XCTNSPredicateExpectationImplementation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE69C2240C5CA00173FCB /* FBElementCommands.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7561CAEDF0C008C271F /* FBElementCommands.h */; }; + 641EE69D2240C5CA00173FCB /* FBResponseFilePayload.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB77E1CAEDF0C008C271F /* FBResponseFilePayload.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE69E2240C5CA00173FCB /* FBSpringboardApplication.h in Headers */ = {isa = PBXBuildFile; fileRef = EEC088EA1CB5706D00B65968 /* FBSpringboardApplication.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE69F2240C5CA00173FCB /* FBTCPSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 715557D1211DBCE700613B26 /* FBTCPSocket.h */; }; + 641EE6A02240C5CA00173FCB /* XCUIElement+FBUID.h in Headers */ = {isa = PBXBuildFile; fileRef = 71B49EC51ED1A58100D51AD6 /* XCUIElement+FBUID.h */; }; + 641EE6A12240C5CA00173FCB /* XCSymbolicationRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACC71E3B77D600A02D78 /* XCSymbolicationRecord.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6A22240C5CA00173FCB /* XCUIDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACFD1E3B77D600A02D78 /* XCUIDevice.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6A32240C5CA00173FCB /* XCUIApplication+FBTouchAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 71BD20711F86116100B36EC2 /* XCUIApplication+FBTouchAction.h */; }; + 641EE6A42240C5CA00173FCB /* FBCommandHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7751CAEDF0C008C271F /* FBCommandHandler.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6A52240C5CA00173FCB /* FBSessionCommands.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7601CAEDF0C008C271F /* FBSessionCommands.h */; }; + 641EE6A62240C5CA00173FCB /* FBImageIOScaler.h in Headers */ = {isa = PBXBuildFile; fileRef = 63CCF91021ECE4C700E94ABD /* FBImageIOScaler.h */; }; + 641EE6A72240C5CA00173FCB /* FBSession-Private.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7891CAEDF0C008C271F /* FBSession-Private.h */; }; + 641EE6A82240C5CA00173FCB /* NSString+FBXMLSafeString.h in Headers */ = {isa = PBXBuildFile; fileRef = 716E0BCC1E917E810087A825 /* NSString+FBXMLSafeString.h */; }; + 641EE6A92240C5CA00173FCB /* FBCommandStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7761CAEDF0C008C271F /* FBCommandStatus.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6AA2240C5CA00173FCB /* XCElementSnapshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACBC1E3B77D600A02D78 /* XCElementSnapshot.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6AB2240C5CA00173FCB /* FBAlertViewCommands.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7501CAEDF0C008C271F /* FBAlertViewCommands.h */; }; + 641EE6AC2240C5CA00173FCB /* XCTWaiter.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACF41E3B77D600A02D78 /* XCTWaiter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6AD2240C5CA00173FCB /* XCTWaiterManagement-Protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACF71E3B77D600A02D78 /* XCTWaiterManagement-Protocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6AE2240C5CA00173FCB /* XCElementSnapshot+FBHitPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = EE006EAE1EBA1AA9006900A4 /* XCElementSnapshot+FBHitPoint.h */; }; + 641EE6AF2240C5CA00173FCB /* XCTestContext.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACD41E3B77D600A02D78 /* XCTestContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6B02240C5CA00173FCB /* XCAccessibilityElement+FBComparison.h in Headers */ = {isa = PBXBuildFile; fileRef = 710C16CB21497A08006EA1D0 /* XCAccessibilityElement+FBComparison.h */; }; + 641EE6B12240C5CA00173FCB /* XCTWaiterDelegate-Protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACF51E3B77D600A02D78 /* XCTWaiterDelegate-Protocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6B22240C5CA00173FCB /* _XCTestExpectationImplementation.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35AC9D1E3B77D600A02D78 /* _XCTestExpectationImplementation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6B32240C5CA00173FCB /* XCAXClient_iOS.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACB81E3B77D600A02D78 /* XCAXClient_iOS.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6B42240C5CA00173FCB /* XCTWaiterManager.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACF81E3B77D600A02D78 /* XCTWaiterManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6B52240C5CA00173FCB /* XCTestDriverInterface-Protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACD71E3B77D600A02D78 /* XCTestDriverInterface-Protocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6B62240C5CA00173FCB /* _XCTestSuiteImplementation.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACA01E3B77D600A02D78 /* _XCTestSuiteImplementation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6B72240C5CA00173FCB /* FBBaseActionsSynthesizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 714097411FAE1B0B008FB2C5 /* FBBaseActionsSynthesizer.h */; }; + 641EE6B82240C5CA00173FCB /* FBAlert.h in Headers */ = {isa = PBXBuildFile; fileRef = AD6C26921CF2379700F8B5FF /* FBAlert.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6B92240C5CA00173FCB /* XCUIElementQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35AD021E3B77D600A02D78 /* XCUIElementQuery.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6BA2240C5CA00173FCB /* XCPointerEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACC21E3B77D600A02D78 /* XCPointerEvent.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6BB2240C5CA00173FCB /* XCSourceCodeRecording.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACC41E3B77D600A02D78 /* XCSourceCodeRecording.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6BC2240C5CA00173FCB /* FBRunLoopSpinner.h in Headers */ = {isa = PBXBuildFile; fileRef = EEE9B4701CD02B88009D2030 /* FBRunLoopSpinner.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6BD2240C5CA00173FCB /* FBErrorBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = EE3A18601CDE618F00DE4205 /* FBErrorBuilder.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6BE2240C5CA00173FCB /* XCApplicationMonitor_iOS.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACB51E3B77D600A02D78 /* XCApplicationMonitor_iOS.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6BF2240C5CA00173FCB /* FBKeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = EE3A18641CDE734B00DE4205 /* FBKeyboard.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6C02240C5CA00173FCB /* XCUIApplication+FBHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = AD6C269A1CF2494200F8B5FF /* XCUIApplication+FBHelpers.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6C12240C5CA00173FCB /* _XCTestObservationCenterImplementation.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35AC9F1E3B77D600A02D78 /* _XCTestObservationCenterImplementation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6C22240C5CA00173FCB /* XCUIDevice+FBHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = AD6C26961CF2481700F8B5FF /* XCUIDevice+FBHelpers.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6C32240C5CA00173FCB /* FBClassChainQueryParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 71A7EAF71E224648001DA4F2 /* FBClassChainQueryParser.h */; }; + 641EE6C42240C5CA00173FCB /* FBMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9B76A51CF7A43900275851 /* FBMacros.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6C52240C5CA00173FCB /* XCTestExpectationDelegate-Protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACD91E3B77D600A02D78 /* XCTestExpectationDelegate-Protocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6C62240C5CA00173FCB /* XCTUIApplicationMonitor-Protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACF31E3B77D600A02D78 /* XCTUIApplicationMonitor-Protocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6C72240C5CA00173FCB /* XCElementSnapshot+FBHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = EEE3763B1D59F81400ED88DD /* XCElementSnapshot+FBHelpers.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6C82240C5CA00173FCB /* XCTKVOExpectation.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACE81E3B77D600A02D78 /* XCTKVOExpectation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6C92240C5CA00173FCB /* XCUIDevice+FBRotation.h in Headers */ = {isa = PBXBuildFile; fileRef = EEE3763D1D59F81400ED88DD /* XCUIDevice+FBRotation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6CA2240C5CA00173FCB /* XCEventGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACBD1E3B77D600A02D78 /* XCEventGenerator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6CB2240C5CA00173FCB /* FBConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9B76A11CF7A43900275851 /* FBConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6CC2240C5CA00173FCB /* XCTestSuiteRun.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACE61E3B77D600A02D78 /* XCTestSuiteRun.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6CD2240C5CA00173FCB /* XCUIElementAsynchronousHandlerWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACFF1E3B77D600A02D78 /* XCUIElementAsynchronousHandlerWrapper.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6CE2240C5CA00173FCB /* XCTestLog.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACDB1E3B77D600A02D78 /* XCTestLog.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6CF2240C5CA00173FCB /* UITapGestureRecognizer-RecordingAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACB21E3B77D600A02D78 /* UITapGestureRecognizer-RecordingAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6D02240C5CA00173FCB /* XCDebugLogDelegate-Protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACB91E3B77D600A02D78 /* XCDebugLogDelegate-Protocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6D12240C5CA00173FCB /* NSString-XCTAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACAB1E3B77D600A02D78 /* NSString-XCTAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6D22240C5CA00173FCB /* XCTestWaiter.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACE71E3B77D600A02D78 /* XCTestWaiter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6D32240C5CA00173FCB /* FBImageUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 7150348521A6DAD600A0F4BA /* FBImageUtils.h */; }; + 641EE6D42240C5CA00173FCB /* NSValue-XCTestAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACAC1E3B77D600A02D78 /* NSValue-XCTestAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6D52240C5CA00173FCB /* _XCTWaiterImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACA31E3B77D600A02D78 /* _XCTWaiterImpl.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6D62240C5CA00173FCB /* FBLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9B76A31CF7A43900275851 /* FBLogger.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6D72240C5CA00173FCB /* XCTestObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACE21E3B77D600A02D78 /* XCTestObserver.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6D82240C5CA00173FCB /* XCUIElement.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACFE1E3B77D600A02D78 /* XCUIElement.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6D92240C5CA00173FCB /* XCKeyboardInputSolver.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACBE1E3B77D600A02D78 /* XCKeyboardInputSolver.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6DA2240C5CA00173FCB /* FBXCTestCaseImplementationFailureHoldingProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = EE7E271A1D06C69F001BEC7B /* FBXCTestCaseImplementationFailureHoldingProxy.h */; }; + 641EE6DB2240C5CA00173FCB /* FBPasteboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 71930C4020662E1F00D3AFEC /* FBPasteboard.h */; }; + 641EE6DC2240C5CA00173FCB /* FBAppiumActionsSynthesizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 714097451FAE1B32008FB2C5 /* FBAppiumActionsSynthesizer.h */; }; + 641EE6DD2240C5CA00173FCB /* FBDebugLogDelegateDecorator.h in Headers */ = {isa = PBXBuildFile; fileRef = EE7E27181D06C69F001BEC7B /* FBDebugLogDelegateDecorator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6DE2240C5CA00173FCB /* XCUIDevice+FBHealthCheck.h in Headers */ = {isa = PBXBuildFile; fileRef = EEDFE11F1D9C06F800E6FFE5 /* XCUIDevice+FBHealthCheck.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6DF2240C5CA00173FCB /* FBMjpegServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7155D701211DCEF400166C20 /* FBMjpegServer.h */; }; + 641EE6E02240C5CA00173FCB /* XCUIRecorderNodeFinderMatch.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35AD051E3B77D600A02D78 /* XCUIRecorderNodeFinderMatch.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6E12240C5CA00173FCB /* XCUIApplicationProcess.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACFB1E3B77D600A02D78 /* XCUIApplicationProcess.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6E22240C5CA00173FCB /* FBW3CActionsSynthesizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 714097491FAE1B51008FB2C5 /* FBW3CActionsSynthesizer.h */; }; + 641EE6E32240C5CA00173FCB /* CDStructures.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACA41E3B77D600A02D78 /* CDStructures.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6E42240C5CA00173FCB /* XCKeyboardLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACC01E3B77D600A02D78 /* XCKeyboardLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6E52240C5CA00173FCB /* XCTAsyncActivity-Protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACCA1E3B77D600A02D78 /* XCTAsyncActivity-Protocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6E62240C5CA00173FCB /* XCActivityRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACB41E3B77D600A02D78 /* XCActivityRecord.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6E72240C5CA00173FCB /* XCUIElement+FBFind.h in Headers */ = {isa = PBXBuildFile; fileRef = EEBBD4891D47746D00656A81 /* XCUIElement+FBFind.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6E82240C5CA00173FCB /* XCTestManager_ManagerInterface-Protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACDD1E3B77D600A02D78 /* XCTestManager_ManagerInterface-Protocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6E92240C5CA00173FCB /* FBFailureProofTestCase.h in Headers */ = {isa = PBXBuildFile; fileRef = EE6A89381D0B38640083E92B /* FBFailureProofTestCase.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6EA2240C5CA00173FCB /* XCTTestRunSessionDelegate-Protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACF21E3B77D600A02D78 /* XCTTestRunSessionDelegate-Protocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6EB2240C5CA00173FCB /* XCTestCaseSuite.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACD21E3B77D600A02D78 /* XCTestCaseSuite.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6EC2240C5CA00173FCB /* _XCInternalTestRun.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35AC981E3B77D600A02D78 /* _XCInternalTestRun.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6ED2240C5CA00173FCB /* FBXPath-Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 712A0C861DA3E55D007D02E5 /* FBXPath-Private.h */; }; + 641EE6EE2240C5CA00173FCB /* XCKeyMappingPath.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACC11E3B77D600A02D78 /* XCKeyMappingPath.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 641EE6F02240C5CA00173FCB /* WebDriverAgent.bundle in Resources */ = {isa = PBXBuildFile; fileRef = EEDBEBBA1CB2681900A790A2 /* WebDriverAgent.bundle */; }; + 641EE6FC2240C5FD00173FCB /* WebDriverAgentLib_tvOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 641EE6F82240C5CA00173FCB /* WebDriverAgentLib_tvOS.framework */; }; + 641EE6FD2240C61D00173FCB /* WebDriverAgentLib_tvOS.framework in Copy frameworks */ = {isa = PBXBuildFile; fileRef = 641EE6F82240C5CA00173FCB /* WebDriverAgentLib_tvOS.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 641EE6FF2240CD4900173FCB /* XCUIApplication+FBFocused.h in Headers */ = {isa = PBXBuildFile; fileRef = 641EE6FE2240CD4900173FCB /* XCUIApplication+FBFocused.h */; }; + 641EE7002240CD4900173FCB /* XCUIApplication+FBFocused.h in Headers */ = {isa = PBXBuildFile; fileRef = 641EE6FE2240CD4900173FCB /* XCUIApplication+FBFocused.h */; }; + 641EE7022240CDA200173FCB /* XCUIApplication+FBFocused.m in Sources */ = {isa = PBXBuildFile; fileRef = 641EE7012240CDA200173FCB /* XCUIApplication+FBFocused.m */; }; + 641EE7032240CDA200173FCB /* XCUIApplication+FBFocused.m in Sources */ = {isa = PBXBuildFile; fileRef = 641EE7012240CDA200173FCB /* XCUIApplication+FBFocused.m */; }; + 641EE7052240CDCF00173FCB /* XCUIElement+FBTVFocuse.h in Headers */ = {isa = PBXBuildFile; fileRef = 641EE7042240CDCF00173FCB /* XCUIElement+FBTVFocuse.h */; }; + 641EE7062240CDCF00173FCB /* XCUIElement+FBTVFocuse.h in Headers */ = {isa = PBXBuildFile; fileRef = 641EE7042240CDCF00173FCB /* XCUIElement+FBTVFocuse.h */; }; + 641EE7082240CDEB00173FCB /* XCUIElement+FBTVFocuse.m in Sources */ = {isa = PBXBuildFile; fileRef = 641EE7072240CDEB00173FCB /* XCUIElement+FBTVFocuse.m */; }; + 641EE7092240CDEB00173FCB /* XCUIElement+FBTVFocuse.m in Sources */ = {isa = PBXBuildFile; fileRef = 641EE7072240CDEB00173FCB /* XCUIElement+FBTVFocuse.m */; }; + 641EE70B2240CE2D00173FCB /* FBTVNavigationTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 641EE70A2240CE2D00173FCB /* FBTVNavigationTracker.h */; }; + 641EE70C2240CE2D00173FCB /* FBTVNavigationTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 641EE70A2240CE2D00173FCB /* FBTVNavigationTracker.h */; }; + 641EE70E2240CE4800173FCB /* FBTVNavigationTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 641EE70D2240CE4800173FCB /* FBTVNavigationTracker.m */; }; + 641EE70F2240CE4800173FCB /* FBTVNavigationTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 641EE70D2240CE4800173FCB /* FBTVNavigationTracker.m */; }; + 641EE7132240DE5E00173FCB /* RoutingHTTPServer.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 641EE7122240DE5E00173FCB /* RoutingHTTPServer.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 641EE7152240DE7800173FCB /* CocoaAsyncSocket.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 641EE7142240DE7800173FCB /* CocoaAsyncSocket.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 641EE7162240DE8700173FCB /* CocoaAsyncSocket.framework in Copy frameworks */ = {isa = PBXBuildFile; fileRef = 641EE7142240DE7800173FCB /* CocoaAsyncSocket.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 641EE7172240DE8C00173FCB /* RoutingHTTPServer.framework in Copy frameworks */ = {isa = PBXBuildFile; fileRef = 641EE7122240DE5E00173FCB /* RoutingHTTPServer.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 641EE7182240DFB400173FCB /* CocoaAsyncSocket.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 641EE7142240DE7800173FCB /* CocoaAsyncSocket.framework */; }; + 641EE7192240DFC100173FCB /* RoutingHTTPServer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 641EE7122240DE5E00173FCB /* RoutingHTTPServer.framework */; }; + 641EE73E2240F4CB00173FCB /* YYCache.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 641EE73D2240F4CB00173FCB /* YYCache.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 641EE73F2240F4E900173FCB /* YYCache.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 641EE73D2240F4CB00173FCB /* YYCache.framework */; }; 710181F8211DF584002FD3A8 /* CocoaAsyncSocket.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 710181F7211DF584002FD3A8 /* CocoaAsyncSocket.framework */; }; 71018201211DF62C002FD3A8 /* libxml2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 71018200211DF62C002FD3A8 /* libxml2.tbd */; }; 7101820D211E026B002FD3A8 /* libAccessibility.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 7101820C211E026B002FD3A8 /* libAccessibility.tbd */; }; @@ -370,6 +669,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 641EE6FA2240C5F400173FCB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 91F9DAE11B99DBC2001349B2 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 641EE5D52240C5CA00173FCB; + remoteInfo = WebDriverAgentLib_tvOS; + }; AD8D96F01D3C12960061268E /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 91F9DAE11B99DBC2001349B2 /* Project object */; @@ -429,6 +735,32 @@ /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ + 641EE3472240C1EF00173FCB /* Copy frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 641EE7172240DE8C00173FCB /* RoutingHTTPServer.framework in Copy frameworks */, + 641EE7162240DE8700173FCB /* CocoaAsyncSocket.framework in Copy frameworks */, + 641EE6FD2240C61D00173FCB /* WebDriverAgentLib_tvOS.framework in Copy frameworks */, + ); + name = "Copy frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + 641EE6F12240C5CA00173FCB /* Copy Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 641EE73E2240F4CB00173FCB /* YYCache.framework in Copy Frameworks */, + 641EE7152240DE7800173FCB /* CocoaAsyncSocket.framework in Copy Frameworks */, + 641EE7132240DE5E00173FCB /* RoutingHTTPServer.framework in Copy Frameworks */, + ); + name = "Copy Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; EE93CFF41CCA501300708122 /* Copy frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -467,6 +799,54 @@ 6385F4A5220A40760095BBDB /* XCUIApplicationProcessDelay.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XCUIApplicationProcessDelay.m; sourceTree = ""; }; 63CCF91021ECE4C700E94ABD /* FBImageIOScaler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FBImageIOScaler.h; sourceTree = ""; }; 63CCF91121ECE4C700E94ABD /* FBImageIOScaler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBImageIOScaler.m; sourceTree = ""; }; + 641EE2CD2240BB5E00173FCB /* libxml2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libxml2.tbd; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk/usr/lib/libxml2.tbd; sourceTree = DEVELOPER_DIR; }; + 641EE2CF2240BB6700173FCB /* libAccessibility.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libAccessibility.tbd; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk/usr/lib/libAccessibility.tbd; sourceTree = DEVELOPER_DIR; }; + 641EE2D12240BB7D00173FCB /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/AppleTVOS.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 641EE2DA2240BBE300173FCB /* WebDriverAgentRunner_tvOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WebDriverAgentRunner_tvOS.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 641EE2E72240BE7300173FCB /* FBAttributesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBAttributesViewController.h; sourceTree = ""; }; + 641EE2E82240BE7300173FCB /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 641EE2E92240BE7300173FCB /* FBAlertsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBAlertsViewController.m; sourceTree = ""; }; + 641EE2EA2240BE7300173FCB /* FBAttributesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBAttributesViewController.m; sourceTree = ""; }; + 641EE2EB2240BE7300173FCB /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 641EE2EC2240BE7300173FCB /* FBAlertsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBAlertsViewController.h; sourceTree = ""; }; + 641EE2EF2240BE7300173FCB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 641EE2F02240BE7300173FCB /* Templates~.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = "Templates~.storyboard"; sourceTree = ""; }; + 641EE2F12240BE7300173FCB /* Templates.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Templates.storyboard; sourceTree = ""; }; + 641EE2F22240BE7300173FCB /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 641EE2F32240BE7300173FCB /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 641EE3082240BE8200173FCB /* FBTVAlertTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBTVAlertTests.m; sourceTree = ""; }; + 641EE3092240BE8200173FCB /* TVXCUIDeviceHealthCheckTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TVXCUIDeviceHealthCheckTests.m; sourceTree = ""; }; + 641EE30A2240BE8200173FCB /* TVXCElementSnapshotHelperTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TVXCElementSnapshotHelperTests.m; sourceTree = ""; }; + 641EE30B2240BE8200173FCB /* FBTVIntegrationTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBTVIntegrationTestCase.m; sourceTree = ""; }; + 641EE30C2240BE8200173FCB /* FBTVElementSelectTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBTVElementSelectTests.m; sourceTree = ""; }; + 641EE30D2240BE8200173FCB /* TVXCUIDeviceHelperTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TVXCUIDeviceHelperTests.m; sourceTree = ""; }; + 641EE30E2240BE8200173FCB /* FBTVElementScreenshotTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBTVElementScreenshotTests.m; sourceTree = ""; }; + 641EE30F2240BE8200173FCB /* FBTVKeyboardTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBTVKeyboardTests.m; sourceTree = ""; }; + 641EE3102240BE8200173FCB /* TVXCUIElementFBFindTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TVXCUIElementFBFindTests.m; sourceTree = ""; }; + 641EE3112240BE8200173FCB /* FBTVFailureProofTestCaseTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBTVFailureProofTestCaseTests.m; sourceTree = ""; }; + 641EE3122240BE8200173FCB /* TVXCUIElementAttributesTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TVXCUIElementAttributesTests.m; sourceTree = ""; }; + 641EE3132240BE8200173FCB /* FBTVTypingTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBTVTypingTest.m; sourceTree = ""; }; + 641EE3142240BE8200173FCB /* FBTVXPathIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBTVXPathIntegrationTests.m; sourceTree = ""; }; + 641EE3152240BE8200173FCB /* TVXCElementSnapshotHitPoint.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TVXCElementSnapshotHitPoint.m; sourceTree = ""; }; + 641EE3162240BE8200173FCB /* FBTVElementVisibilityTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBTVElementVisibilityTests.m; sourceTree = ""; }; + 641EE3172240BE8200173FCB /* TVXCUIApplicationHelperTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TVXCUIApplicationHelperTests.m; sourceTree = ""; }; + 641EE3182240BE8200173FCB /* FBTVElementAttributeTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBTVElementAttributeTests.m; sourceTree = ""; }; + 641EE3192240BE8200173FCB /* TVXCUIElementHelperIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TVXCUIElementHelperIntegrationTests.m; sourceTree = ""; }; + 641EE31A2240BE8200173FCB /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 641EE31B2240BE8200173FCB /* FBTVIntegrationTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBTVIntegrationTestCase.h; sourceTree = ""; }; + 641EE6F82240C5CA00173FCB /* WebDriverAgentLib_tvOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WebDriverAgentLib_tvOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 641EE6F92240C5CB00173FCB /* WebDriverAgentLib copy-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "WebDriverAgentLib copy-Info.plist"; path = "/Users/kazu/GitHub/WebDriverAgent/WebDriverAgentLib copy-Info.plist"; sourceTree = ""; }; + 641EE6FE2240CD4900173FCB /* XCUIApplication+FBFocused.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "XCUIApplication+FBFocused.h"; sourceTree = ""; }; + 641EE7012240CDA200173FCB /* XCUIApplication+FBFocused.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "XCUIApplication+FBFocused.m"; sourceTree = ""; }; + 641EE7042240CDCF00173FCB /* XCUIElement+FBTVFocuse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "XCUIElement+FBTVFocuse.h"; sourceTree = ""; }; + 641EE7072240CDEB00173FCB /* XCUIElement+FBTVFocuse.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "XCUIElement+FBTVFocuse.m"; sourceTree = ""; }; + 641EE70A2240CE2D00173FCB /* FBTVNavigationTracker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FBTVNavigationTracker.h; sourceTree = ""; }; + 641EE70D2240CE4800173FCB /* FBTVNavigationTracker.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBTVNavigationTracker.m; sourceTree = ""; }; + 641EE7122240DE5E00173FCB /* RoutingHTTPServer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RoutingHTTPServer.framework; path = Carthage/Build/tvOS/RoutingHTTPServer.framework; sourceTree = ""; }; + 641EE7142240DE7800173FCB /* CocoaAsyncSocket.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CocoaAsyncSocket.framework; path = Carthage/Build/tvOS/CocoaAsyncSocket.framework; sourceTree = ""; }; + 641EE71A2240E0FD00173FCB /* YYCache.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = YYCache.framework; path = Carthage/Build/iOS/YYCache.framework; sourceTree = ""; }; + 641EE73A2240F49D00173FCB /* YYCache.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = YYCache.framework; path = Carthage/Build/tvOS/YYCache.framework; sourceTree = ""; }; + 641EE73D2240F4CB00173FCB /* YYCache.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = YYCache.framework; path = Carthage/Build/tvOS/YYCache.framework; sourceTree = ""; }; 710181F7211DF584002FD3A8 /* CocoaAsyncSocket.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CocoaAsyncSocket.framework; path = Carthage/Build/iOS/CocoaAsyncSocket.framework; sourceTree = ""; }; 71018200211DF62C002FD3A8 /* libxml2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libxml2.tbd; path = usr/lib/libxml2.tbd; sourceTree = SDKROOT; }; 7101820C211E026B002FD3A8 /* libAccessibility.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libAccessibility.tbd; path = usr/lib/libAccessibility.tbd; sourceTree = SDKROOT; }; @@ -832,6 +1212,28 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 641EE2D72240BBE300173FCB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 641EE6FC2240C5FD00173FCB /* WebDriverAgentLib_tvOS.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 641EE6282240C5CA00173FCB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 641EE73F2240F4E900173FCB /* YYCache.framework in Frameworks */, + 641EE7192240DFC100173FCB /* RoutingHTTPServer.framework in Frameworks */, + 641EE7182240DFB400173FCB /* CocoaAsyncSocket.framework in Frameworks */, + 641EE6292240C5CA00173FCB /* libxml2.tbd in Frameworks */, + 641EE62A2240C5CA00173FCB /* libAccessibility.tbd in Frameworks */, + 641EE62E2240C5CA00173FCB /* XCTest.framework in Frameworks */, + 641EE62F2240C5CA00173FCB /* XCTAutomationSupport.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; EE158A951CBD452B00A3E3F0 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -908,9 +1310,74 @@ path = Resources; sourceTree = ""; }; + 641EE2E52240BE7300173FCB /* IntegrationApp_tvOS */ = { + isa = PBXGroup; + children = ( + 641EE2E62240BE7300173FCB /* Classes */, + 641EE2ED2240BE7300173FCB /* Resources */, + 641EE2F22240BE7300173FCB /* main.m */, + 641EE2F32240BE7300173FCB /* Info.plist */, + ); + path = IntegrationApp_tvOS; + sourceTree = ""; + }; + 641EE2E62240BE7300173FCB /* Classes */ = { + isa = PBXGroup; + children = ( + 641EE2E72240BE7300173FCB /* FBAttributesViewController.h */, + 641EE2E82240BE7300173FCB /* AppDelegate.h */, + 641EE2E92240BE7300173FCB /* FBAlertsViewController.m */, + 641EE2EA2240BE7300173FCB /* FBAttributesViewController.m */, + 641EE2EB2240BE7300173FCB /* AppDelegate.m */, + 641EE2EC2240BE7300173FCB /* FBAlertsViewController.h */, + ); + path = Classes; + sourceTree = ""; + }; + 641EE2ED2240BE7300173FCB /* Resources */ = { + isa = PBXGroup; + children = ( + 641EE2EE2240BE7300173FCB /* Main.storyboard */, + 641EE2F02240BE7300173FCB /* Templates~.storyboard */, + 641EE2F12240BE7300173FCB /* Templates.storyboard */, + ); + path = Resources; + sourceTree = ""; + }; + 641EE3072240BE8200173FCB /* IntegrationTests_tvOS */ = { + isa = PBXGroup; + children = ( + 641EE3082240BE8200173FCB /* FBTVAlertTests.m */, + 641EE3092240BE8200173FCB /* TVXCUIDeviceHealthCheckTests.m */, + 641EE30A2240BE8200173FCB /* TVXCElementSnapshotHelperTests.m */, + 641EE30B2240BE8200173FCB /* FBTVIntegrationTestCase.m */, + 641EE30C2240BE8200173FCB /* FBTVElementSelectTests.m */, + 641EE30D2240BE8200173FCB /* TVXCUIDeviceHelperTests.m */, + 641EE30E2240BE8200173FCB /* FBTVElementScreenshotTests.m */, + 641EE30F2240BE8200173FCB /* FBTVKeyboardTests.m */, + 641EE3102240BE8200173FCB /* TVXCUIElementFBFindTests.m */, + 641EE3112240BE8200173FCB /* FBTVFailureProofTestCaseTests.m */, + 641EE3122240BE8200173FCB /* TVXCUIElementAttributesTests.m */, + 641EE3132240BE8200173FCB /* FBTVTypingTest.m */, + 641EE3142240BE8200173FCB /* FBTVXPathIntegrationTests.m */, + 641EE3152240BE8200173FCB /* TVXCElementSnapshotHitPoint.m */, + 641EE3162240BE8200173FCB /* FBTVElementVisibilityTests.m */, + 641EE3172240BE8200173FCB /* TVXCUIApplicationHelperTests.m */, + 641EE3182240BE8200173FCB /* FBTVElementAttributeTests.m */, + 641EE3192240BE8200173FCB /* TVXCUIElementHelperIntegrationTests.m */, + 641EE31A2240BE8200173FCB /* Info.plist */, + 641EE31B2240BE8200173FCB /* FBTVIntegrationTestCase.h */, + ); + path = IntegrationTests_tvOS; + sourceTree = ""; + }; 91F9DAE01B99DBC2001349B2 = { isa = PBXGroup; children = ( + 641EE71A2240E0FD00173FCB /* YYCache.framework */, + 641EE73D2240F4CB00173FCB /* YYCache.framework */, + 641EE7142240DE7800173FCB /* CocoaAsyncSocket.framework */, + 641EE7122240DE5E00173FCB /* RoutingHTTPServer.framework */, EEE5CABE1C80361500CBBDD9 /* Configurations */, 91F9DB731B99DDD8001349B2 /* PrivateHeaders */, 498495C81BB2E6FA009CC848 /* Resources */, @@ -921,6 +1388,7 @@ 91F9DAEA1B99DBC2001349B2 /* Products */, B6E83A410C45944B036B6B0F /* Frameworks */, AD42DD291CF121E600806E5D /* Modules */, + 641EE6F92240C5CB00173FCB /* WebDriverAgentLib copy-Info.plist */, ); indentWidth = 2; sourceTree = ""; @@ -937,6 +1405,8 @@ EE9B75EC1CF7956C00275851 /* IntegrationTests_1.xctest */, EE5095FE1EBCC9090028E2FE /* IntegrationTests_2.xctest */, EE22021C1ECC612200A29571 /* IntegrationTests_3.xctest */, + 641EE2DA2240BBE300173FCB /* WebDriverAgentRunner_tvOS.xctest */, + 641EE6F82240C5CA00173FCB /* WebDriverAgentLib_tvOS.framework */, ); name = Products; sourceTree = ""; @@ -971,6 +1441,10 @@ B6E83A410C45944B036B6B0F /* Frameworks */ = { isa = PBXGroup; children = ( + 641EE73A2240F49D00173FCB /* YYCache.framework */, + 641EE2D12240BB7D00173FCB /* XCTest.framework */, + 641EE2CF2240BB6700173FCB /* libAccessibility.tbd */, + 641EE2CD2240BB5E00173FCB /* libxml2.tbd */, 710181F7211DF584002FD3A8 /* CocoaAsyncSocket.framework */, E456BF72206BC17F00963F9F /* YYCache.framework */, AD42DD2B1CF1238500806E5D /* RoutingHTTPServer.framework */, @@ -1003,6 +1477,8 @@ AD6C269B1CF2494200F8B5FF /* XCUIApplication+FBHelpers.m */, EEC9EED420064FAA00BC0D5B /* XCUICoordinate+FBFix.h */, EEC9EED520064FAA00BC0D5B /* XCUICoordinate+FBFix.m */, + 641EE6FE2240CD4900173FCB /* XCUIApplication+FBFocused.h */, + 641EE7012240CDA200173FCB /* XCUIApplication+FBFocused.m */, 719CD8FA2126C88B00C7D0C2 /* XCUIApplication+FBAlert.h */, 719CD8FB2126C88B00C7D0C2 /* XCUIApplication+FBAlert.m */, 71BD20711F86116100B36EC2 /* XCUIApplication+FBTouchAction.h */, @@ -1037,6 +1513,8 @@ EEE376401D59F81400ED88DD /* XCUIElement+FBUtilities.m */, EEE376471D59FAE900ED88DD /* XCUIElement+FBWebDriverAttributes.h */, EEE376481D59FAE900ED88DD /* XCUIElement+FBWebDriverAttributes.m */, + 641EE7042240CDCF00173FCB /* XCUIElement+FBTVFocuse.h */, + 641EE7072240CDEB00173FCB /* XCUIElement+FBTVFocuse.m */, ); name = Categories; path = WebDriverAgentLib/Categories; @@ -1124,6 +1602,8 @@ 719CD8F62126C78F00C7D0C2 /* FBAlertsMonitor.h */, 719CD8F72126C78F00C7D0C2 /* FBAlertsMonitor.m */, 714097451FAE1B32008FB2C5 /* FBAppiumActionsSynthesizer.h */, + 641EE70A2240CE2D00173FCB /* FBTVNavigationTracker.h */, + 641EE70D2240CE4800173FCB /* FBTVNavigationTracker.m */, 71241D771FAE31F100B9559F /* FBAppiumActionsSynthesizer.m */, 714097411FAE1B0B008FB2C5 /* FBBaseActionsSynthesizer.h */, 7140974D1FAE20EE008FB2C5 /* FBBaseActionsSynthesizer.m */, @@ -1194,6 +1674,8 @@ EE9B75F91CF7964100275851 /* WebDriverAgentTests */ = { isa = PBXGroup; children = ( + 641EE3072240BE8200173FCB /* IntegrationTests_tvOS */, + 641EE2E52240BE7300173FCB /* IntegrationApp_tvOS */, EE9B76801CF7997600275851 /* IntegrationApp */, EE9B76541CF7987300275851 /* IntegrationTests */, EE9B76561CF7987300275851 /* UnitTests */, @@ -1465,6 +1947,206 @@ /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ + 641EE6302240C5CA00173FCB /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 641EE6312240C5CA00173FCB /* XCUIElement+FBWebDriverAttributes.h in Headers */, + 641EE6322240C5CA00173FCB /* FBScreen.h in Headers */, + 641EE6332240C5CA00173FCB /* XCTestPrivateSymbols.h in Headers */, + 641EE6342240C5CA00173FCB /* XCUIElement+FBTyping.h in Headers */, + 641EE6352240C5CA00173FCB /* XCUIElement+FBUtilities.h in Headers */, + 641EE6362240C5CA00173FCB /* XCUIElement+FBScrolling.h in Headers */, + 641EE6372240C5CA00173FCB /* XCSourceCodeTreeNode.h in Headers */, + 641EE6382240C5CA00173FCB /* XCPointerEventPath.h in Headers */, + 641EE6392240C5CA00173FCB /* FBRouteRequest.h in Headers */, + 641EE63A2240C5CA00173FCB /* XCTest.h in Headers */, + 641EE63B2240C5CA00173FCB /* FBAlertsMonitor.h in Headers */, + 641EE63C2240C5CA00173FCB /* XCAccessibilityElement.h in Headers */, + 641EE63D2240C5CA00173FCB /* FBSession.h in Headers */, + 641EE63E2240C5CA00173FCB /* _XCTestImplementation.h in Headers */, + 641EE63F2240C5CA00173FCB /* FBTouchActionCommands.h in Headers */, + 641EE6402240C5CA00173FCB /* FBTouchIDCommands.h in Headers */, + 641EE6412240C5CA00173FCB /* XCUIApplication.h in Headers */, + 641EE6422240C5CA00173FCB /* FBCustomCommands.h in Headers */, + 641EE6432240C5CA00173FCB /* _XCTestCaseInterruptionException.h in Headers */, + 641EE6442240C5CA00173FCB /* FBOrientationCommands.h in Headers */, + 641EE6452240C5CA00173FCB /* XCUIScreen.h in Headers */, + 641EE6462240C5CA00173FCB /* XCTRunnerIDESession.h in Headers */, + 641EE6472240C5CA00173FCB /* FBRouteRequest-Private.h in Headers */, + 641EE6482240C5CA00173FCB /* XCTTestRunSession.h in Headers */, + 641EE6492240C5CA00173FCB /* XCTestProbe.h in Headers */, + 641EE64A2240C5CA00173FCB /* XCApplicationQuery.h in Headers */, + 641EE64B2240C5CA00173FCB /* XCTAsyncActivity.h in Headers */, + 641EE64C2240C5CA00173FCB /* XCTestMisuseObserver.h in Headers */, + 641EE64D2240C5CA00173FCB /* XCTRunnerDaemonSession.h in Headers */, + 641EE64E2240C5CA00173FCB /* FBApplication.h in Headers */, + 641EE64F2240C5CA00173FCB /* XCTestExpectationWaiter.h in Headers */, + 641EE6502240C5CA00173FCB /* UIGestureRecognizer-RecordingAdditions.h in Headers */, + 641EE6512240C5CA00173FCB /* XCKeyboardKeyMap.h in Headers */, + 641EE6522240C5CA00173FCB /* XCTNSPredicateExpectationObject-Protocol.h in Headers */, + 641EE6532240C5CA00173FCB /* WebDriverAgentLib.h in Headers */, + 641EE6542240C5CA00173FCB /* FBFindElementCommands.h in Headers */, + 641EE6552240C5CA00173FCB /* XCTestRun.h in Headers */, + 641EE6562240C5CA00173FCB /* FBWebServer.h in Headers */, + 641EE6572240C5CA00173FCB /* FBScreenshotCommands.h in Headers */, + 641EE6582240C5CA00173FCB /* _XCKVOExpectationImplementation.h in Headers */, + 641EE6592240C5CA00173FCB /* NSString+FBVisualLength.h in Headers */, + 641EE65A2240C5CA00173FCB /* FBXCTestDaemonsProxy.h in Headers */, + 641EE65B2240C5CA00173FCB /* XCUIElementHitPointCoordinate.h in Headers */, + 641EE65C2240C5CA00173FCB /* XCTDarwinNotificationExpectation.h in Headers */, + 641EE65D2240C5CA00173FCB /* XCTRunnerAutomationSession.h in Headers */, + 641EE65E2240C5CA00173FCB /* XCUICoordinate+FBFix.h in Headers */, + 641EE65F2240C5CA00173FCB /* XCSourceCodeTreeNodeEnumerator.h in Headers */, + 641EE6602240C5CA00173FCB /* XCUIElement+FBIsVisible.h in Headers */, + 641EE6612240C5CA00173FCB /* XCUIElement+FBTap.h in Headers */, + 641EE6622240C5CA00173FCB /* FBResponsePayload.h in Headers */, + 641EE6632240C5CA00173FCB /* FBUnknownCommands.h in Headers */, + 641EE7062240CDCF00173FCB /* XCUIElement+FBTVFocuse.h in Headers */, + 641EE6642240C5CA00173FCB /* NSPredicate+FBFormat.h in Headers */, + 641EE6652240C5CA00173FCB /* UILongPressGestureRecognizer-RecordingAdditions.h in Headers */, + 641EE6662240C5CA00173FCB /* XCTestCase.h in Headers */, + 641EE6672240C5CA00173FCB /* XCSymbolicatorHolder.h in Headers */, + 641EE6682240C5CA00173FCB /* XCUIApplicationImpl.h in Headers */, + 641EE6692240C5CA00173FCB /* UIPanGestureRecognizer-RecordingAdditions.h in Headers */, + 641EE66A2240C5CA00173FCB /* NSExpression+FBFormat.h in Headers */, + 641EE66B2240C5CA00173FCB /* _XCTestCaseImplementation.h in Headers */, + 641EE66C2240C5CA00173FCB /* UIPinchGestureRecognizer-RecordingAdditions.h in Headers */, + 641EE66D2240C5CA00173FCB /* XCTestManager_TestsInterface-Protocol.h in Headers */, + 641EE66E2240C5CA00173FCB /* XCUIApplication+FBAlert.h in Headers */, + 641EE66F2240C5CA00173FCB /* XCDeviceEvent.h in Headers */, + 641EE6702240C5CA00173FCB /* FBMathUtils.h in Headers */, + 641EE6712240C5CA00173FCB /* UISwipeGestureRecognizer-RecordingAdditions.h in Headers */, + 641EE6722240C5CA00173FCB /* FBElementUtils.h in Headers */, + 641EE6732240C5CA00173FCB /* FBDebugCommands.h in Headers */, + 641EE6742240C5CA00173FCB /* XCTestSuite.h in Headers */, + 641EE6752240C5CA00173FCB /* XCUICoordinate.h in Headers */, + 641EE6762240C5CA00173FCB /* XCTNSPredicateExpectation.h in Headers */, + 641EE6772240C5CA00173FCB /* XCTestObservationCenter.h in Headers */, + 641EE6782240C5CA00173FCB /* XCTNSNotificationExpectation.h in Headers */, + 641EE6792240C5CA00173FCB /* XCUIRecorderNodeFinder.h in Headers */, + 641EE67A2240C5CA00173FCB /* XCUIElement+FBAccessibility.h in Headers */, + 641EE7002240CD4900173FCB /* XCUIApplication+FBFocused.h in Headers */, + 641EE67B2240C5CA00173FCB /* XCUIRecorderUtilities.h in Headers */, + 641EE67C2240C5CA00173FCB /* XCTestCaseRun.h in Headers */, + 641EE67D2240C5CA00173FCB /* XCTestConfiguration.h in Headers */, + 641EE67E2240C5CA00173FCB /* _XCTDarwinNotificationExpectationImplementation.h in Headers */, + 641EE67F2240C5CA00173FCB /* XCTestExpectation.h in Headers */, + 641EE6802240C5CA00173FCB /* FBElementTypeTransformer.h in Headers */, + 641EE6812240C5CA00173FCB /* FBXCAXClientProxy.h in Headers */, + 641EE6822240C5CA00173FCB /* FBElementCache.h in Headers */, + 641EE6832240C5CA00173FCB /* XCTMetric.h in Headers */, + 641EE6842240C5CA00173FCB /* XCTestContextScope.h in Headers */, + 641EE6852240C5CA00173FCB /* XCUIElement+FBClassChain.h in Headers */, + 641EE6862240C5CA00173FCB /* FBResponseJSONPayload.h in Headers */, + 641EE6872240C5CA00173FCB /* XCTAutomationTarget-Protocol.h in Headers */, + 641EE6882240C5CA00173FCB /* FBElement.h in Headers */, + 641EE6892240C5CA00173FCB /* XCTAXClient-Protocol.h in Headers */, + 641EE68A2240C5CA00173FCB /* FBPredicate.h in Headers */, + 641EE68B2240C5CA00173FCB /* FBExceptionHandler.h in Headers */, + 641EE68C2240C5CA00173FCB /* FBRoute.h in Headers */, + 641EE68D2240C5CA00173FCB /* XCTestDriver.h in Headers */, + 641EE68E2240C5CA00173FCB /* _XCTNSNotificationExpectationImplementation.h in Headers */, + 641EE68F2240C5CA00173FCB /* XCSynthesizedEventRecord.h in Headers */, + 641EE6902240C5CA00173FCB /* FBInspectorCommands.h in Headers */, + 641EE6912240C5CA00173FCB /* FBApplicationProcessProxy.h in Headers */, + 641EE6922240C5CA00173FCB /* XCTWaiterDelegatePrivate-Protocol.h in Headers */, + 641EE6932240C5CA00173FCB /* XCTestManager_IDEInterface-Protocol.h in Headers */, + 641EE6942240C5CA00173FCB /* FBXPath.h in Headers */, + 641EE6952240C5CA00173FCB /* XCUIRecorderTimingMessage.h in Headers */, + 641EE6962240C5CA00173FCB /* XCApplicationMonitor.h in Headers */, + 641EE6972240C5CA00173FCB /* XCUIElement+FBForceTouch.h in Headers */, + 641EE6982240C5CA00173FCB /* FBRuntimeUtils.h in Headers */, + 641EE6992240C5CA00173FCB /* XCUIElement+FBPickerWheel.h in Headers */, + 641EE69A2240C5CA00173FCB /* XCTestObservation-Protocol.h in Headers */, + 641EE69B2240C5CA00173FCB /* _XCTNSPredicateExpectationImplementation.h in Headers */, + 641EE69C2240C5CA00173FCB /* FBElementCommands.h in Headers */, + 641EE69D2240C5CA00173FCB /* FBResponseFilePayload.h in Headers */, + 641EE69E2240C5CA00173FCB /* FBSpringboardApplication.h in Headers */, + 641EE69F2240C5CA00173FCB /* FBTCPSocket.h in Headers */, + 641EE6A02240C5CA00173FCB /* XCUIElement+FBUID.h in Headers */, + 641EE6A12240C5CA00173FCB /* XCSymbolicationRecord.h in Headers */, + 641EE6A22240C5CA00173FCB /* XCUIDevice.h in Headers */, + 641EE6A32240C5CA00173FCB /* XCUIApplication+FBTouchAction.h in Headers */, + 641EE6A42240C5CA00173FCB /* FBCommandHandler.h in Headers */, + 641EE6A52240C5CA00173FCB /* FBSessionCommands.h in Headers */, + 641EE70C2240CE2D00173FCB /* FBTVNavigationTracker.h in Headers */, + 641EE6A62240C5CA00173FCB /* FBImageIOScaler.h in Headers */, + 641EE6A72240C5CA00173FCB /* FBSession-Private.h in Headers */, + 641EE6A82240C5CA00173FCB /* NSString+FBXMLSafeString.h in Headers */, + 641EE6A92240C5CA00173FCB /* FBCommandStatus.h in Headers */, + 641EE6AA2240C5CA00173FCB /* XCElementSnapshot.h in Headers */, + 641EE6AB2240C5CA00173FCB /* FBAlertViewCommands.h in Headers */, + 641EE6AC2240C5CA00173FCB /* XCTWaiter.h in Headers */, + 641EE6AD2240C5CA00173FCB /* XCTWaiterManagement-Protocol.h in Headers */, + 641EE6AE2240C5CA00173FCB /* XCElementSnapshot+FBHitPoint.h in Headers */, + 641EE6AF2240C5CA00173FCB /* XCTestContext.h in Headers */, + 641EE6B02240C5CA00173FCB /* XCAccessibilityElement+FBComparison.h in Headers */, + 641EE6B12240C5CA00173FCB /* XCTWaiterDelegate-Protocol.h in Headers */, + 641EE6B22240C5CA00173FCB /* _XCTestExpectationImplementation.h in Headers */, + 641EE6B32240C5CA00173FCB /* XCAXClient_iOS.h in Headers */, + 641EE6B42240C5CA00173FCB /* XCTWaiterManager.h in Headers */, + 641EE6B52240C5CA00173FCB /* XCTestDriverInterface-Protocol.h in Headers */, + 641EE6B62240C5CA00173FCB /* _XCTestSuiteImplementation.h in Headers */, + 641EE6B72240C5CA00173FCB /* FBBaseActionsSynthesizer.h in Headers */, + 641EE6B82240C5CA00173FCB /* FBAlert.h in Headers */, + 641EE6B92240C5CA00173FCB /* XCUIElementQuery.h in Headers */, + 641EE6BA2240C5CA00173FCB /* XCPointerEvent.h in Headers */, + 641EE6BB2240C5CA00173FCB /* XCSourceCodeRecording.h in Headers */, + 641EE6BC2240C5CA00173FCB /* FBRunLoopSpinner.h in Headers */, + 641EE6BD2240C5CA00173FCB /* FBErrorBuilder.h in Headers */, + 641EE6BE2240C5CA00173FCB /* XCApplicationMonitor_iOS.h in Headers */, + 641EE6BF2240C5CA00173FCB /* FBKeyboard.h in Headers */, + 641EE6C02240C5CA00173FCB /* XCUIApplication+FBHelpers.h in Headers */, + 641EE6C12240C5CA00173FCB /* _XCTestObservationCenterImplementation.h in Headers */, + 641EE6C22240C5CA00173FCB /* XCUIDevice+FBHelpers.h in Headers */, + 641EE6C32240C5CA00173FCB /* FBClassChainQueryParser.h in Headers */, + 641EE6C42240C5CA00173FCB /* FBMacros.h in Headers */, + 641EE6C52240C5CA00173FCB /* XCTestExpectationDelegate-Protocol.h in Headers */, + 641EE6C62240C5CA00173FCB /* XCTUIApplicationMonitor-Protocol.h in Headers */, + 641EE6C72240C5CA00173FCB /* XCElementSnapshot+FBHelpers.h in Headers */, + 641EE6C82240C5CA00173FCB /* XCTKVOExpectation.h in Headers */, + 641EE6C92240C5CA00173FCB /* XCUIDevice+FBRotation.h in Headers */, + 641EE6CA2240C5CA00173FCB /* XCEventGenerator.h in Headers */, + 641EE6CB2240C5CA00173FCB /* FBConfiguration.h in Headers */, + 641EE6CC2240C5CA00173FCB /* XCTestSuiteRun.h in Headers */, + 641EE6CD2240C5CA00173FCB /* XCUIElementAsynchronousHandlerWrapper.h in Headers */, + 641EE6CE2240C5CA00173FCB /* XCTestLog.h in Headers */, + 641EE6CF2240C5CA00173FCB /* UITapGestureRecognizer-RecordingAdditions.h in Headers */, + 641EE6D02240C5CA00173FCB /* XCDebugLogDelegate-Protocol.h in Headers */, + 641EE6D12240C5CA00173FCB /* NSString-XCTAdditions.h in Headers */, + 641EE6D22240C5CA00173FCB /* XCTestWaiter.h in Headers */, + 641EE6D32240C5CA00173FCB /* FBImageUtils.h in Headers */, + 641EE6D42240C5CA00173FCB /* NSValue-XCTestAdditions.h in Headers */, + 641EE6D52240C5CA00173FCB /* _XCTWaiterImpl.h in Headers */, + 641EE6D62240C5CA00173FCB /* FBLogger.h in Headers */, + 641EE6D72240C5CA00173FCB /* XCTestObserver.h in Headers */, + 641EE6D82240C5CA00173FCB /* XCUIElement.h in Headers */, + 641EE6D92240C5CA00173FCB /* XCKeyboardInputSolver.h in Headers */, + 641EE6DA2240C5CA00173FCB /* FBXCTestCaseImplementationFailureHoldingProxy.h in Headers */, + 641EE6DB2240C5CA00173FCB /* FBPasteboard.h in Headers */, + 641EE6DC2240C5CA00173FCB /* FBAppiumActionsSynthesizer.h in Headers */, + 641EE6DD2240C5CA00173FCB /* FBDebugLogDelegateDecorator.h in Headers */, + 641EE6DE2240C5CA00173FCB /* XCUIDevice+FBHealthCheck.h in Headers */, + 641EE6DF2240C5CA00173FCB /* FBMjpegServer.h in Headers */, + 641EE6E02240C5CA00173FCB /* XCUIRecorderNodeFinderMatch.h in Headers */, + 641EE6E12240C5CA00173FCB /* XCUIApplicationProcess.h in Headers */, + 641EE6E22240C5CA00173FCB /* FBW3CActionsSynthesizer.h in Headers */, + 641EE6E32240C5CA00173FCB /* CDStructures.h in Headers */, + 641EE6E42240C5CA00173FCB /* XCKeyboardLayout.h in Headers */, + 641EE6E52240C5CA00173FCB /* XCTAsyncActivity-Protocol.h in Headers */, + 641EE6E62240C5CA00173FCB /* XCActivityRecord.h in Headers */, + 641EE6E72240C5CA00173FCB /* XCUIElement+FBFind.h in Headers */, + 641EE6E82240C5CA00173FCB /* XCTestManager_ManagerInterface-Protocol.h in Headers */, + 641EE6E92240C5CA00173FCB /* FBFailureProofTestCase.h in Headers */, + 641EE6EA2240C5CA00173FCB /* XCTTestRunSessionDelegate-Protocol.h in Headers */, + 641EE6EB2240C5CA00173FCB /* XCTestCaseSuite.h in Headers */, + 641EE6EC2240C5CA00173FCB /* _XCInternalTestRun.h in Headers */, + 641EE6ED2240C5CA00173FCB /* FBXPath-Private.h in Headers */, + 641EE6EE2240C5CA00173FCB /* XCKeyMappingPath.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; EE158A961CBD452B00A3E3F0 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -1520,6 +2202,7 @@ EE158AB41CBD456F00A3E3F0 /* XCUIElement+FBTap.h in Headers */, EE158ADC1CBD456F00A3E3F0 /* FBResponsePayload.h in Headers */, EE158ACC1CBD456F00A3E3F0 /* FBUnknownCommands.h in Headers */, + 641EE7052240CDCF00173FCB /* XCUIElement+FBTVFocuse.h in Headers */, 71A224E51DE2F56600844D55 /* NSPredicate+FBFormat.h in Headers */, EE35AD1F1E3B77D600A02D78 /* UILongPressGestureRecognizer-RecordingAdditions.h in Headers */, EE35AD411E3B77D600A02D78 /* XCTestCase.h in Headers */, @@ -1543,6 +2226,7 @@ EE35AD5B1E3B77D600A02D78 /* XCTNSNotificationExpectation.h in Headers */, EE35AD751E3B77D600A02D78 /* XCUIRecorderNodeFinder.h in Headers */, EE158AAE1CBD456F00A3E3F0 /* XCUIElement+FBAccessibility.h in Headers */, + 641EE6FF2240CD4900173FCB /* XCUIApplication+FBFocused.h in Headers */, EE35AD781E3B77D600A02D78 /* XCUIRecorderUtilities.h in Headers */, EE35AD421E3B77D600A02D78 /* XCTestCaseRun.h in Headers */, EE35AD441E3B77D600A02D78 /* XCTestConfiguration.h in Headers */, @@ -1586,6 +2270,7 @@ 71BD20731F86116100B36EC2 /* XCUIApplication+FBTouchAction.h in Headers */, EE158ACE1CBD456F00A3E3F0 /* FBCommandHandler.h in Headers */, EE158AC81CBD456F00A3E3F0 /* FBSessionCommands.h in Headers */, + 641EE70B2240CE2D00173FCB /* FBTVNavigationTracker.h in Headers */, 63CCF91221ECE4C700E94ABD /* FBImageIOScaler.h in Headers */, EE158AE31CBD456F00A3E3F0 /* FBSession-Private.h in Headers */, 716E0BCE1E917E810087A825 /* NSString+FBXMLSafeString.h in Headers */, @@ -1665,6 +2350,44 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + 641EE2D92240BBE300173FCB /* WebDriverAgentRunner_tvOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 641EE2DF2240BBE300173FCB /* Build configuration list for PBXNativeTarget "WebDriverAgentRunner_tvOS" */; + buildPhases = ( + 641EE2D62240BBE300173FCB /* Sources */, + 641EE2D72240BBE300173FCB /* Frameworks */, + 641EE2D82240BBE300173FCB /* Resources */, + 641EE3472240C1EF00173FCB /* Copy frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 641EE6FB2240C5F400173FCB /* PBXTargetDependency */, + ); + name = WebDriverAgentRunner_tvOS; + productName = WebDriverAgent; + productReference = 641EE2DA2240BBE300173FCB /* WebDriverAgentRunner_tvOS.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; + 641EE5D52240C5CA00173FCB /* WebDriverAgentLib_tvOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 641EE6F52240C5CA00173FCB /* Build configuration list for PBXNativeTarget "WebDriverAgentLib_tvOS" */; + buildPhases = ( + 641EE5D62240C5CA00173FCB /* Sources */, + 641EE6282240C5CA00173FCB /* Frameworks */, + 641EE6302240C5CA00173FCB /* Headers */, + 641EE6EF2240C5CA00173FCB /* Resources */, + 641EE6F12240C5CA00173FCB /* Copy Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = WebDriverAgentLib_tvOS; + productName = WebDriverAgentLib_; + productReference = 641EE6F82240C5CA00173FCB /* WebDriverAgentLib_tvOS.framework */; + productType = "com.apple.product-type.framework"; + }; EE158A981CBD452B00A3E3F0 /* WebDriverAgentLib */ = { isa = PBXNativeTarget; buildConfigurationList = EE158AA01CBD452B00A3E3F0 /* Build configuration list for PBXNativeTarget "WebDriverAgentLib" */; @@ -1805,6 +2528,10 @@ LastUpgradeCheck = 0900; ORGANIZATIONNAME = Facebook; TargetAttributes = { + 641EE2D92240BBE300173FCB = { + CreatedOnToolsVersion = 10.1; + ProvisioningStyle = Automatic; + }; EE158A981CBD452B00A3E3F0 = { CreatedOnToolsVersion = 7.3; }; @@ -1838,7 +2565,9 @@ projectRoot = ""; targets = ( EE158A981CBD452B00A3E3F0 /* WebDriverAgentLib */, + 641EE5D52240C5CA00173FCB /* WebDriverAgentLib_tvOS */, EEF988291C486603005CA669 /* WebDriverAgentRunner */, + 641EE2D92240BBE300173FCB /* WebDriverAgentRunner_tvOS */, EE836C011C0F118600D87246 /* UnitTests */, EE9B75EB1CF7956C00275851 /* IntegrationTests_1 */, EE5095DD1EBCC9090028E2FE /* IntegrationTests_2 */, @@ -1849,6 +2578,21 @@ /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 641EE2D82240BBE300173FCB /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 641EE6EF2240C5CA00173FCB /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 641EE6F02240C5CA00173FCB /* WebDriverAgent.bundle in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; EE158A971CBD452B00A3E3F0 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -1903,6 +2647,105 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 641EE2D62240BBE300173FCB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 641EE3452240C1C800173FCB /* UITestingUITests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 641EE5D62240C5CA00173FCB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 641EE5D72240C5CA00173FCB /* FBScreenshotCommands.m in Sources */, + 641EE5D82240C5CA00173FCB /* FBPredicate.m in Sources */, + 641EE5D92240C5CA00173FCB /* XCUIElement+FBPickerWheel.m in Sources */, + 641EE5DA2240C5CA00173FCB /* XCUIApplicationProcessDelay.m in Sources */, + 641EE5DB2240C5CA00173FCB /* FBXPath.m in Sources */, + 641EE7032240CDA200173FCB /* XCUIApplication+FBFocused.m in Sources */, + 641EE5DC2240C5CA00173FCB /* XCUIApplication+FBAlert.m in Sources */, + 641EE5DD2240C5CA00173FCB /* FBAppiumActionsSynthesizer.m in Sources */, + 641EE70F2240CE4800173FCB /* FBTVNavigationTracker.m in Sources */, + 641EE5DE2240C5CA00173FCB /* XCUIApplication+FBTouchAction.m in Sources */, + 641EE5DF2240C5CA00173FCB /* FBWebServer.m in Sources */, + 641EE5E02240C5CA00173FCB /* FBTCPSocket.m in Sources */, + 641EE5E12240C5CA00173FCB /* FBErrorBuilder.m in Sources */, + 641EE5E22240C5CA00173FCB /* XCUIElement+FBClassChain.m in Sources */, + 641EE5E32240C5CA00173FCB /* NSExpression+FBFormat.m in Sources */, + 641EE5E42240C5CA00173FCB /* XCUIApplication+FBHelpers.m in Sources */, + 641EE5E52240C5CA00173FCB /* FBKeyboard.m in Sources */, + 641EE5E62240C5CA00173FCB /* FBElementUtils.m in Sources */, + 641EE5E72240C5CA00173FCB /* FBW3CActionsSynthesizer.m in Sources */, + 641EE5E82240C5CA00173FCB /* FBApplicationProcessProxy.m in Sources */, + 641EE5E92240C5CA00173FCB /* FBFailureProofTestCase.m in Sources */, + 641EE5EA2240C5CA00173FCB /* XCUIElement+FBIsVisible.m in Sources */, + 641EE5EB2240C5CA00173FCB /* XCUIElement+FBFind.m in Sources */, + 641EE5EC2240C5CA00173FCB /* FBResponsePayload.m in Sources */, + 641EE5ED2240C5CA00173FCB /* FBRoute.m in Sources */, + 641EE5EE2240C5CA00173FCB /* NSString+FBVisualLength.m in Sources */, + 641EE5EF2240C5CA00173FCB /* FBRunLoopSpinner.m in Sources */, + 641EE5F02240C5CA00173FCB /* FBAlertsMonitor.m in Sources */, + 641EE5F12240C5CA00173FCB /* FBClassChainQueryParser.m in Sources */, + 641EE5F22240C5CA00173FCB /* NSPredicate+FBFormat.m in Sources */, + 641EE5F32240C5CA00173FCB /* XCAccessibilityElement+FBComparison.m in Sources */, + 641EE5F42240C5CA00173FCB /* XCUIDevice+FBRotation.m in Sources */, + 641EE5F52240C5CA00173FCB /* XCUIElement+FBUID.m in Sources */, + 641EE5F62240C5CA00173FCB /* FBRouteRequest.m in Sources */, + 641EE5F72240C5CA00173FCB /* FBResponseJSONPayload.m in Sources */, + 641EE5F82240C5CA00173FCB /* FBXCTestCaseImplementationFailureHoldingProxy.m in Sources */, + 641EE5F92240C5CA00173FCB /* FBMjpegServer.m in Sources */, + 641EE5FA2240C5CA00173FCB /* XCUIDevice+FBHealthCheck.m in Sources */, + 641EE5FB2240C5CA00173FCB /* FBSpringboardApplication.m in Sources */, + 641EE5FC2240C5CA00173FCB /* FBResponseFilePayload.m in Sources */, + 641EE5FD2240C5CA00173FCB /* FBBaseActionsSynthesizer.m in Sources */, + 641EE5FE2240C5CA00173FCB /* XCUIElement+FBWebDriverAttributes.m in Sources */, + 641EE5FF2240C5CA00173FCB /* XCUIElement+FBForceTouch.m in Sources */, + 641EE6002240C5CA00173FCB /* FBTouchActionCommands.m in Sources */, + 641EE6012240C5CA00173FCB /* FBImageIOScaler.m in Sources */, + 641EE6022240C5CA00173FCB /* FBTouchIDCommands.m in Sources */, + 641EE6032240C5CA00173FCB /* FBDebugCommands.m in Sources */, + 641EE6042240C5CA00173FCB /* NSString+FBXMLSafeString.m in Sources */, + 641EE6052240C5CA00173FCB /* FBUnknownCommands.m in Sources */, + 641EE6062240C5CA00173FCB /* FBOrientationCommands.m in Sources */, + 641EE7092240CDEB00173FCB /* XCUIElement+FBTVFocuse.m in Sources */, + 641EE6072240C5CA00173FCB /* XCUICoordinate+FBFix.m in Sources */, + 641EE6082240C5CA00173FCB /* FBRuntimeUtils.m in Sources */, + 641EE6092240C5CA00173FCB /* XCUIElement+FBUtilities.m in Sources */, + 641EE60A2240C5CA00173FCB /* FBLogger.m in Sources */, + 641EE60B2240C5CA00173FCB /* FBCustomCommands.m in Sources */, + 641EE60C2240C5CA00173FCB /* XCUIDevice+FBHelpers.m in Sources */, + 641EE60D2240C5CA00173FCB /* XCTestPrivateSymbols.m in Sources */, + 641EE60E2240C5CA00173FCB /* XCUIElement+FBTyping.m in Sources */, + 641EE60F2240C5CA00173FCB /* XCUIElement+FBAccessibility.m in Sources */, + 641EE6102240C5CA00173FCB /* FBImageUtils.m in Sources */, + 641EE6112240C5CA00173FCB /* FBSession.m in Sources */, + 641EE6122240C5CA00173FCB /* FBFindElementCommands.m in Sources */, + 641EE6132240C5CA00173FCB /* FBDebugLogDelegateDecorator.m in Sources */, + 641EE6142240C5CA00173FCB /* FBAlertViewCommands.m in Sources */, + 641EE6152240C5CA00173FCB /* XCUIElement+FBScrolling.m in Sources */, + 641EE6162240C5CA00173FCB /* FBSessionCommands.m in Sources */, + 641EE6172240C5CA00173FCB /* FBInspectorCommands.m in Sources */, + 641EE6182240C5CA00173FCB /* XCElementSnapshot+FBHitPoint.m in Sources */, + 641EE6192240C5CA00173FCB /* FBConfiguration.m in Sources */, + 641EE61A2240C5CA00173FCB /* FBElementCache.m in Sources */, + 641EE61B2240C5CA00173FCB /* FBPasteboard.m in Sources */, + 641EE61C2240C5CA00173FCB /* FBAlert.m in Sources */, + 641EE61D2240C5CA00173FCB /* FBElementCommands.m in Sources */, + 641EE61E2240C5CA00173FCB /* FBExceptionHandler.m in Sources */, + 641EE61F2240C5CA00173FCB /* FBXCodeCompatibility.m in Sources */, + 641EE6202240C5CA00173FCB /* XCElementSnapshot+FBHelpers.m in Sources */, + 641EE6212240C5CA00173FCB /* FBElementTypeTransformer.m in Sources */, + 641EE6222240C5CA00173FCB /* FBApplication.m in Sources */, + 641EE6232240C5CA00173FCB /* FBScreen.m in Sources */, + 641EE6242240C5CA00173FCB /* FBXCTestDaemonsProxy.m in Sources */, + 641EE6252240C5CA00173FCB /* XCUIElement+FBTap.m in Sources */, + 641EE6262240C5CA00173FCB /* FBMathUtils.m in Sources */, + 641EE6272240C5CA00173FCB /* FBXCAXClientProxy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; EE158A941CBD452B00A3E3F0 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1912,8 +2755,10 @@ 7136A47A1E8918E60024FC3D /* XCUIElement+FBPickerWheel.m in Sources */, 6385F4A7220A40760095BBDB /* XCUIApplicationProcessDelay.m in Sources */, 711084451DA3AA7500F913D6 /* FBXPath.m in Sources */, + 641EE7022240CDA200173FCB /* XCUIApplication+FBFocused.m in Sources */, 719CD8FD2126C88B00C7D0C2 /* XCUIApplication+FBAlert.m in Sources */, 71241D781FAE31F100B9559F /* FBAppiumActionsSynthesizer.m in Sources */, + 641EE70E2240CE4800173FCB /* FBTVNavigationTracker.m in Sources */, 71BD20741F86116100B36EC2 /* XCUIApplication+FBTouchAction.m in Sources */, EE158AE71CBD456F00A3E3F0 /* FBWebServer.m in Sources */, 715557D4211DBCE700613B26 /* FBTCPSocket.m in Sources */, @@ -1955,6 +2800,7 @@ 716E0BCF1E917E810087A825 /* NSString+FBXMLSafeString.m in Sources */, EE158ACD1CBD456F00A3E3F0 /* FBUnknownCommands.m in Sources */, EE158AC51CBD456F00A3E3F0 /* FBOrientationCommands.m in Sources */, + 641EE7082240CDEB00173FCB /* XCUIElement+FBTVFocuse.m in Sources */, EEC9EED720064FAA00BC0D5B /* XCUICoordinate+FBFix.m in Sources */, EE158AEB1CBD456F00A3E3F0 /* FBRuntimeUtils.m in Sources */, EEE376461D59F81400ED88DD /* XCUIElement+FBUtilities.m in Sources */, @@ -2100,6 +2946,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 641EE6FB2240C5F400173FCB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 641EE5D52240C5CA00173FCB /* WebDriverAgentLib_tvOS */; + targetProxy = 641EE6FA2240C5F400173FCB /* PBXContainerItemProxy */; + }; AD8D96F11D3C12960061268E /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = EE158A981CBD452B00A3E3F0 /* WebDriverAgentLib */; @@ -2143,6 +2994,14 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ + 641EE2EE2240BE7300173FCB /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 641EE2EF2240BE7300173FCB /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; EE9B768C1CF7997600275851 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -2154,6 +3013,128 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 641EE2E02240BBE300173FCB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = ""; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = WebDriverAgentRunner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.WebDriverAgentRunner; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SDKROOT = appletvos; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 12.1; + }; + name = Debug; + }; + 641EE2E12240BBE300173FCB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = WebDriverAgentRunner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.WebDriverAgentRunner; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SDKROOT = appletvos; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 12.1; + }; + name = Release; + }; + 641EE6F62240C5CA00173FCB /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = EEE5CABF1C80361500CBBDD9 /* ProjectSettings.xcconfig */; + buildSettings = { + CLANG_STATIC_ANALYZER_MODE = deep; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = NO; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = ( + "$(PLATFORM_DIR)/Developer/Library/Frameworks", + "$(PLATFORM_DIR)/Developer/Library/PrivateFrameworks", + "$(PROJECT_DIR)/Carthage/Build/tvOS", + "$(PROJECT_DIR)/Carthage/Build/iOS", + "$(PROJECT_DIR)/Carthage/Build/Mac", + ); + GCC_TREAT_WARNINGS_AS_ERRORS = NO; + INFOPLIST_FILE = WebDriverAgentLib/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + OTHER_LDFLAGS = ""; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.WebDriverAgentLib; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 641EE6F72240C5CA00173FCB /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = EEE5CABF1C80361500CBBDD9 /* ProjectSettings.xcconfig */; + buildSettings = { + CLANG_STATIC_ANALYZER_MODE = deep; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = NO; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = ( + "$(PLATFORM_DIR)/Developer/Library/Frameworks", + "$(PLATFORM_DIR)/Developer/Library/PrivateFrameworks", + "$(PROJECT_DIR)/Carthage/Build/tvOS", + "$(PROJECT_DIR)/Carthage/Build/iOS", + "$(PROJECT_DIR)/Carthage/Build/Mac", + ); + GCC_TREAT_WARNINGS_AS_ERRORS = NO; + INFOPLIST_FILE = WebDriverAgentLib/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + OTHER_LDFLAGS = ""; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.WebDriverAgentLib; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; 91F9DB0A1B99DBC2001349B2 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2541,6 +3522,24 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 641EE2DF2240BBE300173FCB /* Build configuration list for PBXNativeTarget "WebDriverAgentRunner_tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 641EE2E02240BBE300173FCB /* Debug */, + 641EE2E12240BBE300173FCB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 641EE6F52240C5CA00173FCB /* Build configuration list for PBXNativeTarget "WebDriverAgentLib_tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 641EE6F62240C5CA00173FCB /* Debug */, + 641EE6F72240C5CA00173FCB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 91F9DAE41B99DBC2001349B2 /* Build configuration list for PBXProject "WebDriverAgent" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentLib.xcscheme b/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentLib.xcscheme index a46c97e3d..223ff0fd1 100644 --- a/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentLib.xcscheme +++ b/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentLib.xcscheme @@ -26,7 +26,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" shouldUseLaunchSchemeArgsEnv = "YES"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentRunner.xcscheme b/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentRunner.xcscheme index 2c143c116..8ef138420 100644 --- a/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentRunner.xcscheme +++ b/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentRunner.xcscheme @@ -26,7 +26,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" systemAttachmentLifetime = "keepNever" shouldUseLaunchSchemeArgsEnv = "YES"> @@ -48,7 +47,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentRunner_tvOS.xcscheme b/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentRunner_tvOS.xcscheme new file mode 100644 index 000000000..846ad68f1 --- /dev/null +++ b/WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentRunner_tvOS.xcscheme @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebDriverAgentLib copy-Info.plist b/WebDriverAgentLib copy-Info.plist new file mode 100644 index 000000000..1b89f4fcd --- /dev/null +++ b/WebDriverAgentLib copy-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.facebook.wda.lib + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/WebDriverAgentLib/Categories/XCUIApplication+FBFocused.h b/WebDriverAgentLib/Categories/XCUIApplication+FBFocused.h new file mode 100644 index 000000000..29f867c66 --- /dev/null +++ b/WebDriverAgentLib/Categories/XCUIApplication+FBFocused.h @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import +#import "FBElement.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XCUIApplication (FBFocused) + + /** + Return current focused element + */ +- (id) fb_focusedElement; + + @end + +NS_ASSUME_NONNULL_END diff --git a/WebDriverAgentLib/Categories/XCUIApplication+FBFocused.m b/WebDriverAgentLib/Categories/XCUIApplication+FBFocused.m new file mode 100644 index 000000000..a8fd1f6b7 --- /dev/null +++ b/WebDriverAgentLib/Categories/XCUIApplication+FBFocused.m @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "XCUIApplication+FBFocused.h" +#import "XCUIElement+FBWebDriverAttributes.h" + +@implementation XCUIApplication (FBFocused) + +- (id) fb_focusedElement +{ + XCUIElementQuery *query = [self descendantsMatchingType:XCUIElementTypeAny]; + return [query elementMatchingPredicate: [NSPredicate predicateWithFormat:@"hasFocus == true"]]; +} + +@end diff --git a/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m b/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m index 5c1f821c8..ce2250def 100644 --- a/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m +++ b/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m @@ -37,7 +37,7 @@ - (BOOL)fb_deactivateWithDuration:(NSTimeInterval)duration error:(NSError **)err [self fb_activate]; return YES; } - return [[FBSpringboardApplication fb_springboard] fb_tapApplicationWithIdentifier:applicationIdentifier error:error]; + return [[FBSpringboardApplication fb_springboard] fb_openApplicationWithIdentifier:applicationIdentifier error:error]; } - (NSDictionary *)fb_tree diff --git a/WebDriverAgentLib/Categories/XCUIApplication+FBTouchAction.m b/WebDriverAgentLib/Categories/XCUIApplication+FBTouchAction.m index 941ec2f78..155cff087 100644 --- a/WebDriverAgentLib/Categories/XCUIApplication+FBTouchAction.m +++ b/WebDriverAgentLib/Categories/XCUIApplication+FBTouchAction.m @@ -19,6 +19,8 @@ #import "FBXCTestDaemonsProxy.h" #import "XCEventGenerator.h" +#if !TARGET_OS_TV + @implementation XCUIApplication (FBTouchAction) + (BOOL)handleEventSynthesWithError:(NSError *)error @@ -57,5 +59,5 @@ - (BOOL)fb_synthesizeEvent:(XCSynthesizedEventRecord *)event error:(NSError *__a return [FBXCTestDaemonsProxy synthesizeEventWithRecord:event error:error]; } - @end +#endif diff --git a/WebDriverAgentLib/Categories/XCUICoordinate+FBFix.h b/WebDriverAgentLib/Categories/XCUICoordinate+FBFix.h index 55742a95c..14c8750eb 100644 --- a/WebDriverAgentLib/Categories/XCUICoordinate+FBFix.h +++ b/WebDriverAgentLib/Categories/XCUICoordinate+FBFix.h @@ -9,8 +9,10 @@ #import +#if !TARGET_OS_TV @interface XCUICoordinate (FBFix) - (CGPoint)fb_screenPoint; @end +#endif diff --git a/WebDriverAgentLib/Categories/XCUICoordinate+FBFix.m b/WebDriverAgentLib/Categories/XCUICoordinate+FBFix.m index 6b6aa62c3..5bac07392 100644 --- a/WebDriverAgentLib/Categories/XCUICoordinate+FBFix.m +++ b/WebDriverAgentLib/Categories/XCUICoordinate+FBFix.m @@ -13,6 +13,7 @@ #import "XCUIElement+FBUtilities.h" #import "XCElementSnapshot+FBHitPoint.h" +# if !TARGET_OS_TV @implementation XCUICoordinate (FBFix) - (CGPoint)fb_screenPoint @@ -37,3 +38,4 @@ - (CGPoint)fb_screenPoint } @end +#endif diff --git a/WebDriverAgentLib/Categories/XCUIDevice+FBHelpers.m b/WebDriverAgentLib/Categories/XCUIDevice+FBHelpers.m index 6fe17dd9a..45fe5c6dd 100644 --- a/WebDriverAgentLib/Categories/XCUIDevice+FBHelpers.m +++ b/WebDriverAgentLib/Categories/XCUIDevice+FBHelpers.m @@ -90,11 +90,15 @@ - (BOOL)fb_unlockScreen:(NSError **)error } [self pressButton:XCUIDeviceButtonHome]; [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:FBHomeButtonCoolOffTime]]; +#if !TARGET_OS_TV if (SYSTEM_VERSION_LESS_THAN(@"10.0")) { [[FBApplication fb_activeApplication] swipeRight]; } else { [self pressButton:XCUIDeviceButtonHome]; } +#else + [self pressButton:XCUIDeviceButtonHome]; +#endif [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:FBHomeButtonCoolOffTime]]; return [[[[FBRunLoopSpinner new] timeout:FBScreenLockTimeout] @@ -104,6 +108,7 @@ - (BOOL)fb_unlockScreen:(NSError **)error } error:error]; } +#if !TARGET_OS_TV - (NSData *)fb_screenshotWithError:(NSError*__autoreleasing*)error { NSData* screenshotData = [self fb_rawScreenshotWithQuality:FBConfiguration.screenshotQuality rect:CGRectNull error:error]; @@ -112,6 +117,7 @@ - (NSData *)fb_screenshotWithError:(NSError*__autoreleasing*)error } return FBAdjustScreenshotOrientationForApplication(screenshotData, FBApplication.fb_activeApplication.interfaceOrientation); } +#endif - (NSData *)fb_rawScreenshotWithQuality:(NSUInteger)quality rect:(CGRect)rect error:(NSError*__autoreleasing*)error { diff --git a/WebDriverAgentLib/Categories/XCUIDevice+FBRotation.h b/WebDriverAgentLib/Categories/XCUIDevice+FBRotation.h index f94877971..79271e628 100644 --- a/WebDriverAgentLib/Categories/XCUIDevice+FBRotation.h +++ b/WebDriverAgentLib/Categories/XCUIDevice+FBRotation.h @@ -12,6 +12,7 @@ NS_ASSUME_NONNULL_BEGIN +#if !TARGET_OS_TV @interface XCUIDevice (FBRotation) /** @@ -34,5 +35,6 @@ NS_ASSUME_NONNULL_BEGIN @property (strong, nonatomic, readonly) NSDictionary *fb_rotationMapping; @end +#endif NS_ASSUME_NONNULL_END diff --git a/WebDriverAgentLib/Categories/XCUIDevice+FBRotation.m b/WebDriverAgentLib/Categories/XCUIDevice+FBRotation.m index c25e0f1f7..6e91bdd9e 100644 --- a/WebDriverAgentLib/Categories/XCUIDevice+FBRotation.m +++ b/WebDriverAgentLib/Categories/XCUIDevice+FBRotation.m @@ -12,6 +12,7 @@ static const NSTimeInterval kFBWebDriverOrientationChangeDelay = 5.0; static const CGFloat FBRotationCoolOffTime = 1.f; +# if !TARGET_OS_TV @implementation XCUIDevice (FBRotation) - (BOOL)fb_setDeviceInterfaceOrientation:(UIDeviceOrientation)orientation @@ -67,3 +68,4 @@ - (NSDictionary *)fb_rotationMapping } @end +#endif diff --git a/WebDriverAgentLib/Categories/XCUIElement+FBIsVisible.m b/WebDriverAgentLib/Categories/XCUIElement+FBIsVisible.m index f2065f1a3..e67c8dd9c 100644 --- a/WebDriverAgentLib/Categories/XCUIElement+FBIsVisible.m +++ b/WebDriverAgentLib/Categories/XCUIElement+FBIsVisible.m @@ -206,6 +206,7 @@ - (BOOL)fb_isVisible CGPoint midPoint = CGPointMake(visibleRect.origin.x + visibleRect.size.width / 2, visibleRect.origin.y + visibleRect.size.height / 2); CGRect windowFrame = nil == parentWindow ? selfFrame : parentWindow.frame; +#if !TARGET_OS_TV if ((appFrame.size.height > appFrame.size.width && windowFrame.size.height < windowFrame.size.width) || (appFrame.size.height < appFrame.size.width && windowFrame.size.height > windowFrame.size.width)) { // This is the indication of the fact that transformation is broken and coordinates should be @@ -213,6 +214,7 @@ - (BOOL)fb_isVisible // However, upside-down case cannot be covered this way, which is not important for Appium midPoint = FBInvertPointForApplication(midPoint, appFrame.size, FBApplication.fb_activeApplication.interfaceOrientation); } +#endif XCAccessibilityElement *hitElement = [self elementAtPoint:midPoint]; if (nil != hitElement) { if ([self.accessibilityElement isEqualToElement:hitElement]) { diff --git a/WebDriverAgentLib/Categories/XCUIElement+FBPickerWheel.m b/WebDriverAgentLib/Categories/XCUIElement+FBPickerWheel.m index a878420f2..9daf519c0 100644 --- a/WebDriverAgentLib/Categories/XCUIElement+FBPickerWheel.m +++ b/WebDriverAgentLib/Categories/XCUIElement+FBPickerWheel.m @@ -14,6 +14,7 @@ #import "XCUICoordinate.h" #import "XCUICoordinate+FBFix.h" +#if !TARGET_OS_TV @implementation XCUIElement (FBPickerWheel) static const NSTimeInterval VALUE_CHANGE_TIMEOUT = 2; @@ -57,3 +58,4 @@ - (BOOL)fb_selectPreviousOptionWithOffset:(CGFloat)offset error:(NSError **)erro } @end +#endif diff --git a/WebDriverAgentLib/Categories/XCUIElement+FBScrolling.h b/WebDriverAgentLib/Categories/XCUIElement+FBScrolling.h index 3aceb3988..1ee7c1dab 100644 --- a/WebDriverAgentLib/Categories/XCUIElement+FBScrolling.h +++ b/WebDriverAgentLib/Categories/XCUIElement+FBScrolling.h @@ -20,6 +20,8 @@ typedef NS_ENUM(NSUInteger, FBXCUIElementScrollDirection) { FBXCUIElementScrollDirectionHorizontal, }; +#if !TARGET_OS_TV + @interface XCUIElement (FBScrolling) /** @@ -82,4 +84,6 @@ typedef NS_ENUM(NSUInteger, FBXCUIElementScrollDirection) { @end +#endif + NS_ASSUME_NONNULL_END diff --git a/WebDriverAgentLib/Categories/XCUIElement+FBScrolling.m b/WebDriverAgentLib/Categories/XCUIElement+FBScrolling.m index 51ff120a7..e52eb22af 100644 --- a/WebDriverAgentLib/Categories/XCUIElement+FBScrolling.m +++ b/WebDriverAgentLib/Categories/XCUIElement+FBScrolling.m @@ -34,6 +34,8 @@ const CGFloat FBScrollCoolOffTime = 1.f; const CGFloat FBMinimumTouchEventDelay = 0.1f; +#if !TARGET_OS_TV + @interface XCElementSnapshot (FBScrolling) - (void)fb_scrollUpByNormalizedDistance:(CGFloat)distance inApplication:(XCUIApplication *)application; @@ -311,3 +313,5 @@ - (BOOL)fb_scrollAncestorScrollViewByVectorWithinScrollViewFrame:(CGVector)vecto } @end + +#endif diff --git a/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.h b/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.h new file mode 100644 index 000000000..ecadb0fbd --- /dev/null +++ b/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.h @@ -0,0 +1,22 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XCUIElement (FBTVFocuse) + + -(BOOL)fb_focuseWithError:(NSError**) error; + + -(BOOL)fb_selectWithError:(NSError**) error; + + @end + +NS_ASSUME_NONNULL_END diff --git a/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m b/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m new file mode 100644 index 000000000..a07bd6ce5 --- /dev/null +++ b/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "XCUIElement+FBTVFocuse.h" + +#import +#import "FBApplication.h" +#import "FBErrorBuilder.h" +#import +#import "XCUIElement+FBUtilities.h" +#import "XCUIElement+FBWebDriverAttributes.h" + +int const MAX_ITERATIONS_COUNT = 100; + +@implementation XCUIElement (FBTVFocuse) + +-(BOOL)fb_focuseWithError:(NSError**) error +{ + [[FBApplication fb_activeApplication] fb_waitUntilSnapshotIsStable]; + if (self.wdEnabled) { + FBTVNavigationTracker *tracker = [FBTVNavigationTracker trackerWithTargetElement:self]; + for (int i = 0; i < MAX_ITERATIONS_COUNT; i++) { + if (self.hasFocus) { + return YES; + } + if (self.exists) { + FBTVDirection direction = tracker.directionToMoveFocuse; + if(direction != FBTVDirectionNone) { + [[XCUIRemote sharedRemote] pressButton: (XCUIRemoteButton)direction]; + continue; + } + } + [[[FBErrorBuilder builder] withDescription:@"Unable to reach element. Try to use XCUIRemote commands."] + buildError:error]; + return NO; + } + } + [[[FBErrorBuilder builder] withDescription:@"Element could not be focused."] + buildError:error]; + return NO; +} + +-(BOOL)fb_selectWithError:(NSError**) error +{ + BOOL result = [self fb_focuseWithError: error]; + if (result) { + [[XCUIRemote sharedRemote] pressButton:XCUIRemoteButtonSelect]; + } + return result; +} +@end diff --git a/WebDriverAgentLib/Categories/XCUIElement+FBTap.m b/WebDriverAgentLib/Categories/XCUIElement+FBTap.m index 235865a5b..02c34c831 100644 --- a/WebDriverAgentLib/Categories/XCUIElement+FBTap.m +++ b/WebDriverAgentLib/Categories/XCUIElement+FBTap.m @@ -12,7 +12,7 @@ #import "XCUIApplication+FBTouchAction.h" #import "XCUIElement+FBUtilities.h" - +#if !TARGET_OS_TV @implementation XCUIElement (FBTap) - (BOOL)fb_tapWithError:(NSError **)error @@ -43,3 +43,4 @@ - (BOOL)fb_tapCoordinate:(CGPoint)relativeCoordinate error:(NSError **)error } @end +#endif diff --git a/WebDriverAgentLib/Categories/XCUIElement+FBTyping.m b/WebDriverAgentLib/Categories/XCUIElement+FBTyping.m index e1a580b2a..aa377b786 100644 --- a/WebDriverAgentLib/Categories/XCUIElement+FBTyping.m +++ b/WebDriverAgentLib/Categories/XCUIElement+FBTyping.m @@ -48,9 +48,17 @@ - (BOOL)fb_typeText:(NSString *)text error:(NSError **)error - (BOOL)fb_typeText:(NSString *)text frequency:(NSUInteger)frequency error:(NSError **)error { + // There is no ability to open text field via tap +#if TARGET_OS_TV + if (!self.hasKeyboardFocus) { + [[[FBErrorBuilder builder] withDescription:@"Keyboard is not opened."] buildError:error]; + return NO; + } +#else if (![self fb_prepareForTextInputWithError:error]) { return NO; } +#endif if (![FBKeyboard typeText:text frequency:frequency error:error]) { return NO; } diff --git a/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.m b/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.m index cb83ade0f..bef17ff14 100644 --- a/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.m +++ b/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.m @@ -226,6 +226,7 @@ - (BOOL)fb_waitUntilSnapshotIsStable return result; } +#if !TARGET_OS_TV - (NSData *)fb_screenshotWithError:(NSError **)error { if (CGRectIsEmpty(self.frame)) { @@ -268,5 +269,6 @@ - (NSData *)fb_screenshotWithError:(NSError **)error } return FBAdjustScreenshotOrientationForApplication(imageData, orientation); } +#endif @end diff --git a/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.m b/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.m index e7479ffe0..defea2a5f 100644 --- a/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.m +++ b/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.m @@ -191,6 +191,15 @@ - (BOOL)isWDVisible return [[self fb_cachedValueWithAttributeName:@"isWDVisible" valueGetter:getter] boolValue]; } +#if TARGET_OS_TV + +- (BOOL)isWDFocused +{ + return self.hasFocus; +} + +#endif + - (BOOL)isWDAccessible { id (^getter)(void) = ^id(void) { diff --git a/WebDriverAgentLib/Commands/FBCustomCommands.m b/WebDriverAgentLib/Commands/FBCustomCommands.m index f330c65e4..d8de16abf 100644 --- a/WebDriverAgentLib/Commands/FBCustomCommands.m +++ b/WebDriverAgentLib/Commands/FBCustomCommands.m @@ -155,6 +155,7 @@ + (NSArray *)routes }); } +#if !TARGET_OS_TV + (id)handleSetPasteboard:(FBRouteRequest *)request { NSString *contentType = request.arguments[@"contentType"] ?: @"plaintext"; @@ -192,6 +193,7 @@ + (NSArray *)routes @"state": @([UIDevice currentDevice].batteryState) }); } +#endif + (id)handlePressButtonCommand:(FBRouteRequest *)request { diff --git a/WebDriverAgentLib/Commands/FBElementCommands.m b/WebDriverAgentLib/Commands/FBElementCommands.m index 18f9167d4..d1e579799 100644 --- a/WebDriverAgentLib/Commands/FBElementCommands.m +++ b/WebDriverAgentLib/Commands/FBElementCommands.m @@ -34,6 +34,7 @@ #import "XCUIElement+FBTyping.h" #import "XCUIElement+FBUtilities.h" #import "XCUIElement+FBWebDriverAttributes.h" +#import "XCUIElement+FBTVFocuse.h" #import "FBElementTypeTransformer.h" #import "XCUIElement.h" #import "XCUIElementQuery.h" @@ -149,6 +150,7 @@ + (NSArray *)routes return FBResponseWithStatus(FBCommandStatusNoError, type); } +#if !TARGET_OS_TV + (id)handleSetValue:(FBRouteRequest *)request { FBElementCache *elementCache = request.session.elementCache; @@ -181,6 +183,7 @@ + (NSArray *)routes } return FBResponseWithElementUUID(elementUUID); } +#endif + (id)handleClick:(FBRouteRequest *)request { @@ -206,6 +209,7 @@ + (NSArray *)routes return FBResponseWithElementUUID(elementUUID); } +#if !TARGET_OS_TV + (id)handleDoubleTap:(FBRouteRequest *)request { FBElementCache *elementCache = request.session.elementCache; @@ -389,6 +393,7 @@ + (NSArray *)routes [element pinchWithScale:scale velocity:velocity]; return FBResponseWithOK(); } +#endif + (id)handleKeys:(FBRouteRequest *)request { @@ -401,6 +406,7 @@ + (NSArray *)routes return FBResponseWithOK(); } +#if !TARGET_OS_TV + (id)handleGetWindowSize:(FBRouteRequest *)request { CGRect frame = request.session.activeApplication.wdFrame; @@ -528,4 +534,6 @@ + (XCUICoordinate *)gestureCoordinateWithCoordinate:(CGPoint)coordinate element: return [[XCUICoordinate alloc] initWithCoordinate:appCoordinate pointsOffset:CGVectorMake(coordinate.x, coordinate.y)]; } +#endif + @end diff --git a/WebDriverAgentLib/Commands/FBOrientationCommands.m b/WebDriverAgentLib/Commands/FBOrientationCommands.m index 64f84118f..56d29fde4 100644 --- a/WebDriverAgentLib/Commands/FBOrientationCommands.m +++ b/WebDriverAgentLib/Commands/FBOrientationCommands.m @@ -29,6 +29,8 @@ .portraitUpsideDown = @"UIA_DEVICE_ORIENTATION_PORTRAIT_UPSIDEDOWN", }; +#if !TARGET_OS_TV + @implementation FBOrientationCommands #pragma mark - @@ -147,3 +149,5 @@ + (NSDictionary *)_wdOrientationsMapping } @end + +#endif diff --git a/WebDriverAgentLib/FBSpringboardApplication.h b/WebDriverAgentLib/FBSpringboardApplication.h index 7de642a5b..75406aff1 100644 --- a/WebDriverAgentLib/FBSpringboardApplication.h +++ b/WebDriverAgentLib/FBSpringboardApplication.h @@ -21,6 +21,15 @@ extern NSString *const SPRINGBOARD_BUNDLE_ID; */ + (instancetype)fb_springboard; +/** + Opens application on SpringBoard(HeadBoard) app with given identifier + @param identifier identifier of the application to tap + @param error If there is an error, upon return contains an NSError object that describes the problem. + @return YES if the operation succeeds, otherwise NO. + */ +- (BOOL)fb_openApplicationWithIdentifier:(NSString *)identifier error:(NSError **)error; + +#if TARGET_OS_IOS /** Taps application on SpringBoard app with given identifier @@ -30,6 +39,17 @@ extern NSString *const SPRINGBOARD_BUNDLE_ID; */ - (BOOL)fb_tapApplicationWithIdentifier:(NSString *)identifier error:(NSError **)error; +#elif TARGET_OS_TV +/** + Taps application on SpringBoard app with given identifier + + @param identifier identifier of the application to tap + @param error If there is an error, upon return contains an NSError object that describes the problem. + @return YES if the operation succeeds, otherwise NO. +*/ +- (BOOL)fb_selectApplicationWithIdentifier:(NSString *)identifier error:(NSError **)error; +#endif + /** Waits until application board is visible with timeout diff --git a/WebDriverAgentLib/FBSpringboardApplication.m b/WebDriverAgentLib/FBSpringboardApplication.m index 10b3d6daf..31709e382 100644 --- a/WebDriverAgentLib/FBSpringboardApplication.m +++ b/WebDriverAgentLib/FBSpringboardApplication.m @@ -19,10 +19,15 @@ #import "XCUIElement+FBUtilities.h" #import "XCUIElement+FBTap.h" #import "XCUIElement+FBScrolling.h" +#import "XCUIElement+FBTVFocuse.h" #import "XCUIElement.h" #import "XCUIElementQuery.h" +#if TARGET_OS_IOS NSString *const SPRINGBOARD_BUNDLE_ID = @"com.apple.springboard"; +#elif TARGET_OS_TV +NSString *const SPRINGBOARD_BUNDLE_ID = @"com.apple.HeadBoard"; +#endif @implementation FBSpringboardApplication @@ -36,6 +41,16 @@ + (instancetype)fb_springboard return _springboardApp; } +- (BOOL)fb_openApplicationWithIdentifier:(NSString *)identifier error:(NSError **)error +{ +#if TARGET_OS_IOS + return [self fb_tapApplicationWithIdentifier:identifier error:error]; +#else + return [self fb_selectApplicationWithIdentifier:identifier error:error]; +#endif +} + +#if TARGET_OS_IOS - (BOOL)fb_tapApplicationWithIdentifier:(NSString *)identifier error:(NSError **)error { XCUIElementQuery *appElementsQuery = [[self descendantsMatchingType:XCUIElementTypeIcon] matchingIdentifier:identifier]; @@ -85,6 +100,36 @@ - (BOOL)fb_tapApplicationWithIdentifier:(NSString *)identifier error:(NSError ** } error:error]; } +#elif TARGET_OS_TV + +- (BOOL)fb_selectApplicationWithIdentifier:(NSString *)identifier error:(NSError **)error +{ + XCUIElementQuery *appElementsQuery = [[self descendantsMatchingType:XCUIElementTypeIcon] matchingIdentifier:identifier]; + NSArray *matchedAppElements = [appElementsQuery allElementsBoundByIndex]; + if (0 == matchedAppElements.count) { + return [[[FBErrorBuilder builder] + withDescriptionFormat:@"Cannot locate Headboard icon for '%@' application", identifier] + buildError:error]; + } + // Select the most recent installed application if there are multiple matches + XCUIElement *appElement = [matchedAppElements lastObject]; + if (![appElement fb_selectWithError:error]) { + return NO; + } + [[XCUIRemote sharedRemote] pressButton: XCUIRemoteButtonSelect]; + return + [[[[FBRunLoopSpinner new] + interval:0.3] + timeoutErrorMessage:@"Timeout waiting for application to activate"] + spinUntilTrue:^BOOL{ + FBApplication *activeApp = [FBApplication fb_activeApplication]; + return activeApp && + activeApp.processID != self.processID && + activeApp.fb_isVisible; + } error:error]; +} +#endif + - (BOOL)fb_waitUntilApplicationBoardIsVisible:(NSError **)error { return @@ -99,9 +144,14 @@ - (BOOL)fb_waitUntilApplicationBoardIsVisible:(NSError **)error - (BOOL)fb_isApplicationBoardVisible { [self resolve]; + +#if TARGET_OS_IOS // the dock (and other icons) don't seem to be consistently reported as // visible. esp on iOS 11 but also on 10.3.3 return self.otherElements[@"Dock"].isEnabled; +#elif TARGET_OS_TV + return self.collectionViews[@"GridCollectionView"].isEnabled; +#endif } @end diff --git a/WebDriverAgentLib/Routing/FBElement.h b/WebDriverAgentLib/Routing/FBElement.h index 5f7a7db6b..e71c61760 100644 --- a/WebDriverAgentLib/Routing/FBElement.h +++ b/WebDriverAgentLib/Routing/FBElement.h @@ -50,6 +50,11 @@ NS_ASSUME_NONNULL_BEGIN /*! Whether element is an accessibility container (contains children of any depth that are accessible) */ @property (nonatomic, readonly, getter = isWDAccessibilityContainer) BOOL wdAccessibilityContainer; +#if TARGET_OS_TV +/*! Whether element is focused */ +@property (nonatomic, readonly, getter = isWDFocused) BOOL wdFocused; +#endif + /** Returns value of given property specified in WebDriver Spec Check the FBElement protocol to get list of supported attributes. diff --git a/WebDriverAgentLib/Routing/FBElementUtils.h b/WebDriverAgentLib/Routing/FBElementUtils.h index 808bfec33..d31b79f8e 100644 --- a/WebDriverAgentLib/Routing/FBElementUtils.h +++ b/WebDriverAgentLib/Routing/FBElementUtils.h @@ -55,6 +55,14 @@ extern NSString *const FBUnknownAttributeException; */ + (NSString *)uidWithAccessibilityElement:(XCAccessibilityElement *)element; +/** + Gets the unique identifier of the particular XCAccessibilityElement instance. + + @param element accessiblity element instance + @return the unique element identifier + */ ++ (NSString *)uidWithAccessibilityElement:(XCAccessibilityElement *)element; + @end NS_ASSUME_NONNULL_END diff --git a/WebDriverAgentLib/Utilities/FBAppiumActionsSynthesizer.h b/WebDriverAgentLib/Utilities/FBAppiumActionsSynthesizer.h index 2f29fbd23..090bacdd7 100644 --- a/WebDriverAgentLib/Utilities/FBAppiumActionsSynthesizer.h +++ b/WebDriverAgentLib/Utilities/FBAppiumActionsSynthesizer.h @@ -11,8 +11,10 @@ NS_ASSUME_NONNULL_BEGIN +#if !TARGET_OS_TV @interface FBAppiumActionsSynthesizer : FBBaseActionsSynthesizer @end +#endif NS_ASSUME_NONNULL_END diff --git a/WebDriverAgentLib/Utilities/FBAppiumActionsSynthesizer.m b/WebDriverAgentLib/Utilities/FBAppiumActionsSynthesizer.m index 7785f098f..978aaacf1 100644 --- a/WebDriverAgentLib/Utilities/FBAppiumActionsSynthesizer.m +++ b/WebDriverAgentLib/Utilities/FBAppiumActionsSynthesizer.m @@ -43,6 +43,7 @@ static NSString *const FB_OPTIONS_KEY = @"options"; static NSString *const FB_ELEMENT_KEY = @"element"; +#if !TARGET_OS_TV @interface FBAppiumGestureItem : FBBaseGestureItem @end @@ -489,3 +490,4 @@ - (nullable XCSynthesizedEventRecord *)synthesizeWithError:(NSError **)error @end +#endif diff --git a/WebDriverAgentLib/Utilities/FBBaseActionsSynthesizer.h b/WebDriverAgentLib/Utilities/FBBaseActionsSynthesizer.h index db6911249..fca8ce174 100644 --- a/WebDriverAgentLib/Utilities/FBBaseActionsSynthesizer.h +++ b/WebDriverAgentLib/Utilities/FBBaseActionsSynthesizer.h @@ -14,6 +14,7 @@ NS_ASSUME_NONNULL_BEGIN +#if !TARGET_OS_TV @interface FBBaseGestureItem : NSObject /*! Raw JSON representation of the corresponding action item */ @@ -121,5 +122,6 @@ NS_ASSUME_NONNULL_BEGIN - (nullable XCSynthesizedEventRecord *)synthesizeWithError:(NSError **)error; @end +#endif NS_ASSUME_NONNULL_END diff --git a/WebDriverAgentLib/Utilities/FBBaseActionsSynthesizer.m b/WebDriverAgentLib/Utilities/FBBaseActionsSynthesizer.m index fec313fd7..65baa515c 100644 --- a/WebDriverAgentLib/Utilities/FBBaseActionsSynthesizer.m +++ b/WebDriverAgentLib/Utilities/FBBaseActionsSynthesizer.m @@ -22,7 +22,7 @@ #import "XCSynthesizedEventRecord.h" #import "XCUIElement+FBUtilities.h" - +#if !TARGET_OS_TV @implementation FBBaseGestureItem + (NSString *)actionName @@ -185,3 +185,4 @@ - (nullable XCSynthesizedEventRecord *)synthesizeWithError:(NSError **)error } @end +#endif diff --git a/WebDriverAgentLib/Utilities/FBImageUtils.h b/WebDriverAgentLib/Utilities/FBImageUtils.h index e5298929d..a3d78575f 100644 --- a/WebDriverAgentLib/Utilities/FBImageUtils.h +++ b/WebDriverAgentLib/Utilities/FBImageUtils.h @@ -15,5 +15,7 @@ BOOL FBIsJpegImage(NSData *imageData); /*! Returns YES if the data contains a PNG image */ BOOL FBIsPngImage(NSData *imageData); +#if !TARGET_OS_TV /*! Fixes the screenshot orientation if necessary to match current screen orientation */ NSData *FBAdjustScreenshotOrientationForApplication(NSData *screenshotData, UIInterfaceOrientation orientation); +#endif diff --git a/WebDriverAgentLib/Utilities/FBImageUtils.m b/WebDriverAgentLib/Utilities/FBImageUtils.m index 815a3cc86..66ef7bea7 100644 --- a/WebDriverAgentLib/Utilities/FBImageUtils.m +++ b/WebDriverAgentLib/Utilities/FBImageUtils.m @@ -54,6 +54,7 @@ BOOL FBIsPngImage(NSData *imageData) return range.location != NSNotFound; } +#if !TARGET_OS_TV NSData *FBAdjustScreenshotOrientationForApplication(NSData *screenshotData, UIInterfaceOrientation orientation) { UIImageOrientation imageOrientation; @@ -84,3 +85,4 @@ BOOL FBIsPngImage(NSData *imageData) // The resulting data should be a PNG image return (NSData *)UIImagePNGRepresentation(fixedImage); } +#endif diff --git a/WebDriverAgentLib/Utilities/FBMathUtils.h b/WebDriverAgentLib/Utilities/FBMathUtils.h index 860a048f6..858140bf3 100644 --- a/WebDriverAgentLib/Utilities/FBMathUtils.h +++ b/WebDriverAgentLib/Utilities/FBMathUtils.h @@ -28,6 +28,7 @@ BOOL FBSizeFuzzyEqualToSize(CGSize size1, CGSize size2, CGFloat threshold); /*! Returns whether rect are equal within given threshold */ BOOL FBRectFuzzyEqualToRect(CGRect rect1, CGRect rect2, CGFloat threshold); +#if !TARGET_OS_TV /*! Inverts point if necessary to match location on screen */ CGPoint FBInvertPointForApplication(CGPoint point, CGSize screenSize, UIInterfaceOrientation orientation); @@ -36,6 +37,7 @@ CGPoint FBInvertOffsetForOrientation(CGPoint offset, UIInterfaceOrientation orie /*! Inverts size if necessary to match current screen orientation */ CGSize FBAdjustDimensionsForApplication(CGSize actualSize, UIInterfaceOrientation orientation); +#endif /*! Replaces the wdRect dictionary passed as the argument with zero-size wdRect if any of its attributes equal to Infinity */ NSDictionary *FBwdRectNoInf(NSDictionary *wdRect); diff --git a/WebDriverAgentLib/Utilities/FBMathUtils.m b/WebDriverAgentLib/Utilities/FBMathUtils.m index af26b935f..c4b6455b3 100644 --- a/WebDriverAgentLib/Utilities/FBMathUtils.m +++ b/WebDriverAgentLib/Utilities/FBMathUtils.m @@ -40,6 +40,7 @@ BOOL FBRectFuzzyEqualToRect(CGRect rect1, CGRect rect2, CGFloat threshold) FBSizeFuzzyEqualToSize(rect1.size, rect2.size, threshold); } +#if !TARGET_OS_TV CGPoint FBInvertPointForApplication(CGPoint point, CGSize screenSize, UIInterfaceOrientation orientation) { switch (orientation) { @@ -84,6 +85,7 @@ This verification is just to make sure the bug is still there (since height is n } return actualSize; } +#endif NSDictionary *FBwdRectNoInf(NSDictionary *wdRect) { diff --git a/WebDriverAgentLib/Utilities/FBPasteboard.h b/WebDriverAgentLib/Utilities/FBPasteboard.h index 0fdd93d8a..9595162d4 100644 --- a/WebDriverAgentLib/Utilities/FBPasteboard.h +++ b/WebDriverAgentLib/Utilities/FBPasteboard.h @@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN +#if !TARGET_OS_TV @interface FBPasteboard : NSObject /** @@ -34,6 +35,7 @@ NS_ASSUME_NONNULL_BEGIN + (nullable NSData *)dataForType:(NSString *)type error:(NSError **)error; @end +#endif NS_ASSUME_NONNULL_END diff --git a/WebDriverAgentLib/Utilities/FBPasteboard.m b/WebDriverAgentLib/Utilities/FBPasteboard.m index 3d8df6015..149ad4f01 100644 --- a/WebDriverAgentLib/Utilities/FBPasteboard.m +++ b/WebDriverAgentLib/Utilities/FBPasteboard.m @@ -11,6 +11,7 @@ #import "FBErrorBuilder.h" +#if !TARGET_OS_TV @implementation FBPasteboard + (BOOL)setData:(NSData *)data forType:(NSString *)type error:(NSError **)error @@ -81,3 +82,4 @@ + (NSData *)dataForType:(NSString *)type error:(NSError **)error } @end +#endif diff --git a/WebDriverAgentLib/Utilities/FBTVNavigationTracker.h b/WebDriverAgentLib/Utilities/FBTVNavigationTracker.h new file mode 100644 index 000000000..a82633d3d --- /dev/null +++ b/WebDriverAgentLib/Utilities/FBTVNavigationTracker.h @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import +#import +#import "FBElement.h" + +typedef NS_ENUM(NSUInteger, FBTVDirection) { + FBTVDirectionUp = 0, + FBTVDirectionDown = 1, + FBTVDirectionLeft = 2, + FBTVDirectionRight = 3, + FBTVDirectionNone = 4 +}; + +NS_ASSUME_NONNULL_BEGIN + +@interface FBTVNavigationTracker : NSObject + + +(instancetype)trackerWithTargetElement: (id) targetElement; + + -(FBTVDirection)directionToMoveFocuse; + + @end + +NS_ASSUME_NONNULL_END diff --git a/WebDriverAgentLib/Utilities/FBTVNavigationTracker.m b/WebDriverAgentLib/Utilities/FBTVNavigationTracker.m new file mode 100644 index 000000000..58c2237c3 --- /dev/null +++ b/WebDriverAgentLib/Utilities/FBTVNavigationTracker.m @@ -0,0 +1,144 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "FBTVNavigationTracker.h" + +#import "FBApplication.h" +#import "FBMathUtils.h" +#import "XCUIApplication+FBFocused.h" +#import "XCUIElement+FBUtilities.h" +#import "XCUIElement+FBWebDriverAttributes.h" + +@interface FBTVNavigationItem : NSObject +@property (nonatomic, assign) NSUInteger uid; +@property (nonatomic, strong) NSMutableSet* directions; + ++ (instancetype)itemWithUid:(NSUInteger) uid; +@end + +@implementation FBTVNavigationItem + ++ (instancetype)itemWithUid:(NSUInteger) uid +{ + return [[FBTVNavigationItem alloc] initWithUid:uid]; +} + +- (instancetype)initWithUid:(NSUInteger) uid +{ + self = [super init]; + if(self) { + _uid = uid; + _directions = [NSMutableSet set]; + } + return self; +} + +@end + +@interface FBTVNavigationTracker () +@property (nonatomic, strong) id targetElement; +@property (nonatomic, assign) CGPoint targetCenter; +@property (nonatomic, strong) NSMutableDictionary* navigationItems; +@end + +@implementation FBTVNavigationTracker + ++ (instancetype)trackerWithTargetElement:(id)targetElement +{ + FBTVNavigationTracker *tracker = [[FBTVNavigationTracker alloc] initWithTargetElement:targetElement]; + tracker.targetElement = targetElement; + return tracker; +} + +- (instancetype)initWithTargetElement:(id)targetElement +{ + self = [super init]; + if(self) { + _targetElement = targetElement; + _targetCenter = FBRectGetCenter(targetElement.wdFrame); + _navigationItems = [NSMutableDictionary dictionary]; + } + return self; +} + +- (FBTVDirection)directionToMoveFocuse +{ + id focused = self.focusedElement; + CGPoint focusedCenter = FBRectGetCenter(focused.wdFrame); + FBTVNavigationItem *item = [self navigationItemFromElement:focused]; + CGFloat yDelta = self.targetCenter.y - focusedCenter.y; + CGFloat xDelta = self.targetCenter.x - focusedCenter.x; + FBTVDirection direction; + if(fabs(yDelta) > fabs(xDelta)) { + direction = [self getVerticalDirectionForItem:item withDelta:yDelta]; + if (direction == FBTVDirectionNone) { + direction = [self getHorizontalDirectionForItem:item withDelta:xDelta]; + } + } else { + direction = [self getHorizontalDirectionForItem:item withDelta:xDelta]; + if (direction == FBTVDirectionNone) { + direction = [self getVerticalDirectionForItem:item withDelta:yDelta]; + } + } + + return direction; +} + +#pragma mark - Utilities +- (id)focusedElement +{ + return [FBApplication fb_activeApplication].fb_focusedElement; +} + +-(FBTVNavigationItem*) navigationItemFromElement:(id)element + +{ + NSNumber *key = [NSNumber numberWithUnsignedInteger:element.wdUID]; + FBTVNavigationItem* item = [self.navigationItems objectForKey: key]; + if(item) { + return item; + } + item = [FBTVNavigationItem itemWithUid:element.wdUID]; + [self.navigationItems setObject:item forKey:key]; + return item; +} + +- (FBTVDirection)getHorizontalDirectionForItem:(FBTVNavigationItem *)item withDelta:(CGFloat)delta { + if (delta > 0) { + if(![item.directions containsObject: [NSNumber numberWithInteger: FBTVDirectionRight]]) { + [item.directions addObject: [NSNumber numberWithInteger: FBTVDirectionRight]]; + return FBTVDirectionRight; + } + } + if (delta < 0) { + if(![item.directions containsObject: [NSNumber numberWithInteger: FBTVDirectionLeft]]) { + [item.directions addObject: [NSNumber numberWithInteger: FBTVDirectionLeft]]; + return FBTVDirectionLeft; + } + } + return FBTVDirectionNone; +} + +- (FBTVDirection)getVerticalDirectionForItem:(FBTVNavigationItem *)item withDelta:(CGFloat)delta { + if (delta > 0) { + if(![item.directions containsObject: [NSNumber numberWithInteger: FBTVDirectionDown]]) { + [item.directions addObject: [NSNumber numberWithInteger: FBTVDirectionDown]]; + return FBTVDirectionDown; + } + } + if (delta < 0) { + if(![item.directions containsObject: [NSNumber numberWithInteger: FBTVDirectionUp]]) { + [item.directions addObject: [NSNumber numberWithInteger: FBTVDirectionUp]]; + return FBTVDirectionUp; + } + } + return FBTVDirectionNone; +} + +@end diff --git a/WebDriverAgentLib/Utilities/FBW3CActionsSynthesizer.h b/WebDriverAgentLib/Utilities/FBW3CActionsSynthesizer.h index 38d4cc52d..e5ed479a7 100644 --- a/WebDriverAgentLib/Utilities/FBW3CActionsSynthesizer.h +++ b/WebDriverAgentLib/Utilities/FBW3CActionsSynthesizer.h @@ -11,8 +11,10 @@ NS_ASSUME_NONNULL_BEGIN +#if !TARGET_OS_TV @interface FBW3CActionsSynthesizer : FBBaseActionsSynthesizer @end +#endif NS_ASSUME_NONNULL_END diff --git a/WebDriverAgentLib/Utilities/FBW3CActionsSynthesizer.m b/WebDriverAgentLib/Utilities/FBW3CActionsSynthesizer.m index 9b2abc94a..c2eb10a1f 100644 --- a/WebDriverAgentLib/Utilities/FBW3CActionsSynthesizer.m +++ b/WebDriverAgentLib/Utilities/FBW3CActionsSynthesizer.m @@ -57,6 +57,7 @@ static NSString *const FB_KEY_ACTIONS = @"actions"; +#if !TARGET_OS_TV @interface FBW3CGestureItem : FBBaseGestureItem @property (nullable, readonly, nonatomic) FBBaseGestureItem *previousItem; @@ -492,3 +493,4 @@ - (nullable XCSynthesizedEventRecord *)synthesizeWithError:(NSError **)error } @end +#endif diff --git a/WebDriverAgentLib/Utilities/FBXCTestDaemonsProxy.h b/WebDriverAgentLib/Utilities/FBXCTestDaemonsProxy.h index 78132d19c..efd2a8bc1 100644 --- a/WebDriverAgentLib/Utilities/FBXCTestDaemonsProxy.h +++ b/WebDriverAgentLib/Utilities/FBXCTestDaemonsProxy.h @@ -22,7 +22,9 @@ NS_ASSUME_NONNULL_BEGIN + (id)testRunnerProxy; +#if !TARGET_OS_TV + (UIInterfaceOrientation)orientationWithApplication:(XCUIApplication *)application; +#endif + (BOOL)synthesizeEventWithRecord:(XCSynthesizedEventRecord *)record error:(NSError *__autoreleasing*)error; diff --git a/WebDriverAgentLib/Utilities/FBXCTestDaemonsProxy.m b/WebDriverAgentLib/Utilities/FBXCTestDaemonsProxy.m index b93b41887..d4515fb30 100644 --- a/WebDriverAgentLib/Utilities/FBXCTestDaemonsProxy.m +++ b/WebDriverAgentLib/Utilities/FBXCTestDaemonsProxy.m @@ -55,6 +55,7 @@ + (void)load } } +#if !TARGET_OS_TV + (UIInterfaceOrientation)orientationWithApplication:(XCUIApplication *)application { if (nil == FBXCTRunnerDaemonSessionClass || @@ -63,6 +64,7 @@ + (UIInterfaceOrientation)orientationWithApplication:(XCUIApplication *)applicat } return UIInterfaceOrientationPortrait; } +#endif + (BOOL)synthesizeEventWithRecord:(XCSynthesizedEventRecord *)record error:(NSError *__autoreleasing*)error { diff --git a/WebDriverAgentLib/Utilities/FBXPath.m b/WebDriverAgentLib/Utilities/FBXPath.m index ac8e96c79..c78822310 100644 --- a/WebDriverAgentLib/Utilities/FBXPath.m +++ b/WebDriverAgentLib/Utilities/FBXPath.m @@ -82,6 +82,13 @@ + (int)recordWithWriter:(xmlTextWriterPtr)writer forValue:(NSString *)value; @end +#if TARGET_OS_TV + +@interface FBFocusedAttribute : FBElementAttribute + +@end + +#endif const static char *_UTF8Encoding = "UTF-8"; @@ -422,6 +429,9 @@ + (int)recordWithWriter:(xmlTextWriterPtr)writer forElement:(id)eleme FBLabelAttribute.class, FBEnabledAttribute.class, FBVisibleAttribute.class, +#if TARGET_OS_TV + FBFocusedAttribute.class, +#endif FBXAttribute.class, FBYAttribute.class, FBWidthAttribute.class, @@ -520,6 +530,24 @@ + (NSString *)valueForElement:(id)element @end +#if TARGET_OS_TV + +@implementation FBFocusedAttribute + ++ (NSString *)name +{ + return @"focused"; +} + ++ (NSString *)valueForElement:(id)element +{ + return element.wdFocused ? @"true" : @"false"; +} + +@end + +#endif + @implementation FBDimensionAttribute + (NSString *)valueForElement:(id)element @@ -585,6 +613,3 @@ + (int)recordWithWriter:(xmlTextWriterPtr)writer forValue:(NSString *)value return rc; } @end - - - diff --git a/WebDriverAgentTests/IntegrationApp/Classes/FBNavigationController.m b/WebDriverAgentTests/IntegrationApp/Classes/FBNavigationController.m index c727913a6..f404c0ba3 100644 --- a/WebDriverAgentTests/IntegrationApp/Classes/FBNavigationController.m +++ b/WebDriverAgentTests/IntegrationApp/Classes/FBNavigationController.m @@ -11,10 +11,12 @@ @implementation FBNavigationController +#if !TARGET_OS_TV - (UIInterfaceOrientationMask)supportedInterfaceOrientations { return UIInterfaceOrientationMaskAll; } +#endif - (BOOL)shouldAutorotate { diff --git a/WebDriverAgentTests/IntegrationApp/Classes/ViewController.m b/WebDriverAgentTests/IntegrationApp/Classes/ViewController.m index 6014a5674..6a0d0441a 100644 --- a/WebDriverAgentTests/IntegrationApp/Classes/ViewController.m +++ b/WebDriverAgentTests/IntegrationApp/Classes/ViewController.m @@ -33,6 +33,7 @@ - (void)viewDidLayoutSubviews [self updateOrentationLabel]; } +#if !TARGET_OS_TV - (void)updateOrentationLabel { NSString *orientation = nil; @@ -55,5 +56,6 @@ - (void)updateOrentationLabel } self.orentationLabel.text = orientation; } +#endif @end diff --git a/WebDriverAgentTests/IntegrationApp_tvOS/Classes/AppDelegate.h b/WebDriverAgentTests/IntegrationApp_tvOS/Classes/AppDelegate.h new file mode 100644 index 000000000..bf20b2f35 --- /dev/null +++ b/WebDriverAgentTests/IntegrationApp_tvOS/Classes/AppDelegate.h @@ -0,0 +1,15 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +@interface AppDelegate : UIResponder +@property (strong, nonatomic) UIWindow *window; +@end + diff --git a/WebDriverAgentTests/IntegrationApp_tvOS/Classes/AppDelegate.m b/WebDriverAgentTests/IntegrationApp_tvOS/Classes/AppDelegate.m new file mode 100644 index 000000000..2082d38d4 --- /dev/null +++ b/WebDriverAgentTests/IntegrationApp_tvOS/Classes/AppDelegate.m @@ -0,0 +1,16 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "AppDelegate.h" + +@interface AppDelegate () +@end + +@implementation AppDelegate +@end diff --git a/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAlertsViewController.h b/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAlertsViewController.h new file mode 100644 index 000000000..a6ce3f25a --- /dev/null +++ b/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAlertsViewController.h @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface FBAlertsViewController : UIViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAlertsViewController.m b/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAlertsViewController.m new file mode 100644 index 000000000..f7cc19599 --- /dev/null +++ b/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAlertsViewController.m @@ -0,0 +1,66 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "FBAlertsViewController.h" +#import +#import + +@interface FBAlertsViewController () +@property (nonatomic, strong) CLLocationManager *locationManager; +@end + +@implementation FBAlertsViewController + +- (IBAction)createAppAlert:(UIButton *)sender +{ + [self presentAlertController]; +} + +- (IBAction)createAppSheet:(UIButton *)sender +{ + UIAlertController *alerController = + [UIAlertController alertControllerWithTitle:@"Magic Sheet" + message:@"Should read" + preferredStyle:UIAlertControllerStyleActionSheet]; + [self presentViewController:alerController animated:YES completion:nil]; + +} + +- (IBAction)createCameraRollAccessAlert:(UIButton *)sender +{ + [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) { + }]; +} + +- (IBAction)createGPSAccessAlert:(UIButton *)sender +{ + self.locationManager = [CLLocationManager new]; + [self.locationManager requestWhenInUseAuthorization]; +} + +- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event +{ + [super touchesMoved:touches withEvent:event]; + for (UITouch *touch in touches) { + if (fabs(touch.maximumPossibleForce - touch.force) < 0.0001) { + [self presentAlertController]; + } + } +} + +- (void)presentAlertController { + UIAlertController *alerController = + [UIAlertController alertControllerWithTitle:@"Magic" + message:@"Should read" + preferredStyle:UIAlertControllerStyleAlert]; + [alerController addAction:[UIAlertAction actionWithTitle:@"Will do" style:UIAlertActionStyleDefault handler:nil]]; + [self presentViewController:alerController animated:YES completion:nil]; +} + +@end diff --git a/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAttributesViewController.h b/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAttributesViewController.h new file mode 100644 index 000000000..c7100fc3d --- /dev/null +++ b/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAttributesViewController.h @@ -0,0 +1,18 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface FBAttributesViewController : UIViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAttributesViewController.m b/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAttributesViewController.m new file mode 100644 index 000000000..82acae842 --- /dev/null +++ b/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAttributesViewController.m @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "FBAttributesViewController.h" + +@interface FBAttributesViewController () + +@end + +@implementation FBAttributesViewController + +- (IBAction)didSelectButton:(UIButton *)button +{ + button.selected = !button.selected; +} + +@end diff --git a/WebDriverAgentTests/IntegrationApp_tvOS/Info.plist b/WebDriverAgentTests/IntegrationApp_tvOS/Info.plist new file mode 100644 index 000000000..67be95910 --- /dev/null +++ b/WebDriverAgentTests/IntegrationApp_tvOS/Info.plist @@ -0,0 +1,42 @@ + + + + + NSLocationAlwaysAndWhenInUseUsageDescription + Yo Yo + NSPhotoLibraryUsageDescription + Yo Yo + NSLocationWhenInUseUsageDescription + Yo Yo + NSLocationUsageDescription + Yo Yo + NSLocationAlwaysUsageDescription + Yo Yo + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + arm64 + + UIUserInterfaceStyle + Automatic + + diff --git a/WebDriverAgentTests/IntegrationApp_tvOS/Resources/Base.lproj/Main.storyboard b/WebDriverAgentTests/IntegrationApp_tvOS/Resources/Base.lproj/Main.storyboard new file mode 100644 index 000000000..07e15fac8 --- /dev/null +++ b/WebDriverAgentTests/IntegrationApp_tvOS/Resources/Base.lproj/Main.storyboard @@ -0,0 +1,512 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebDriverAgentTests/IntegrationApp_tvOS/Resources/Templates.storyboard b/WebDriverAgentTests/IntegrationApp_tvOS/Resources/Templates.storyboard new file mode 100644 index 000000000..8679b9edf --- /dev/null +++ b/WebDriverAgentTests/IntegrationApp_tvOS/Resources/Templates.storyboard @@ -0,0 +1,376 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebDriverAgentTests/IntegrationApp_tvOS/Resources/Templates~.storyboard b/WebDriverAgentTests/IntegrationApp_tvOS/Resources/Templates~.storyboard new file mode 100644 index 000000000..74058b605 --- /dev/null +++ b/WebDriverAgentTests/IntegrationApp_tvOS/Resources/Templates~.storyboard @@ -0,0 +1,394 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebDriverAgentTests/IntegrationApp_tvOS/main.m b/WebDriverAgentTests/IntegrationApp_tvOS/main.m new file mode 100644 index 000000000..2b841fd81 --- /dev/null +++ b/WebDriverAgentTests/IntegrationApp_tvOS/main.m @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVAlertTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVAlertTests.m new file mode 100644 index 000000000..8e6e5d7f3 --- /dev/null +++ b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVAlertTests.m @@ -0,0 +1,161 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import + +#import "FBTVIntegrationTestCase.h" +#import "FBTestMacros.h" + +@interface FBTVAlertTests : FBTVIntegrationTestCase +@end + +@implementation FBTVAlertTests + +- (void)setUp +{ + [super setUp]; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + [self launchApplication]; + [self goToAlertsPage]; + }); +} + +- (void)tearDown +{ + [super tearDown]; + [[FBAlert alertWithApplication:self.testedApplication] dismissWithError:nil]; +} + +- (void)showApplicationAlert +{ + [self select: self.testedApplication.buttons[FBShowAlertButtonName]]; + XCUIElementQuery* query = self.testedApplication.alerts; + FBAssertWaitTillBecomesTrue(query.count != 0); +} + +- (void)showApplicationSheet +{ + [self select: self.testedApplication.buttons[FBShowSheetAlertButtonName]]; + FBAssertWaitTillBecomesTrue(self.testedApplication.sheets.count != 0); +} + +- (void)testAlertException +{ + XCTAssertThrowsSpecificNamed([FBAlert throwRequestedItemObstructedByAlertException], NSException, FBAlertObstructingElementException); +} + +- (void)testAlertPresence +{ + FBAlert *alert = [FBAlert alertWithApplication:self.testedApplication]; + XCTAssertFalse(alert.isPresent); + [self showApplicationAlert]; + XCTAssertTrue(alert.isPresent); +} + +- (void)testAlertText +{ + FBAlert *alert = [FBAlert alertWithApplication:self.testedApplication]; + XCTAssertNil(alert.text); + [self showApplicationAlert]; + XCTAssertTrue([alert.text containsString:@"Magic"]); + XCTAssertTrue([alert.text containsString:@"Should read"]); +} + +- (void)testAlertLabels +{ + FBAlert* alert = [FBAlert alertWithApplication:self.testedApplication]; + XCTAssertNil(alert.buttonLabels); + [self showApplicationAlert]; + XCTAssertNotNil(alert.buttonLabels); + XCTAssertEqual(1, alert.buttonLabels.count); + XCTAssertEqualObjects(@"Will do", alert.buttonLabels[0]); +} + +- (void)testSelectAlertButton +{ + FBAlert* alert = [FBAlert alertWithApplication:self.testedApplication]; + XCTAssertFalse([alert clickAlertButton:@"Invalid" error:nil]); + [self showApplicationAlert]; + XCTAssertFalse([alert clickAlertButton:@"Invalid" error:nil]); + XCTAssertTrue([alert clickAlertButton:@"Will do" error:nil]); +} + +- (void)testAcceptingAlert +{ + NSError *error; + [self showApplicationAlert]; + XCTAssertTrue([[FBAlert alertWithApplication:self.testedApplication] acceptWithError:&error]); + FBAssertWaitTillBecomesTrue(self.testedApplication.alerts.count == 0); + XCTAssertNil(error); +} + +- (void)testDismissingAlert +{ + NSError *error; + [self showApplicationAlert]; + XCTAssertTrue([[FBAlert alertWithApplication:self.testedApplication] dismissWithError:&error]); + FBAssertWaitTillBecomesTrue(self.testedApplication.alerts.count == 0); + XCTAssertNil(error); +} + +- (void)testAlertElement +{ + [self showApplicationAlert]; + XCUIElement *alertElement = [FBAlert alertWithApplication:self.testedApplication].alertElement; + XCTAssertTrue(alertElement.exists); + XCTAssertTrue(alertElement.elementType == XCUIElementTypeAlert); +} + +- (void)testFilteringObstructedElements +{ + FBAlert *alert = [FBAlert alertWithApplication:self.testedApplication]; + XCUIElement *showAlertButton = self.testedApplication.buttons[FBShowAlertButtonName]; + XCUIElement *acceptAlertButton = self.testedApplication.buttons[@"Will do"]; + [self showApplicationAlert]; + + NSArray *filteredElements = [alert filterObstructedElements:@[showAlertButton, acceptAlertButton]]; + XCTAssertEqualObjects(filteredElements, @[acceptAlertButton]); +} + +- (void)testCameraRollAlert +{ + FBAlert *alert = [FBAlert alertWithApplication:self.testedApplication]; + XCTAssertNil(alert.text); + [self select: self.testedApplication.buttons[@"Create Photo Lib access Alert"]]; + FBAssertWaitTillBecomesTrue(alert.isPresent); + + XCTAssertTrue([alert.text containsString:@"Would Like to Access Your Photos"]); +} + +- (void)testGPSAccessAlert +{ + FBAlert *alert = [FBAlert alertWithApplication:self.testedApplication]; + XCTAssertNil(alert.text); + + [self select: self.testedApplication.buttons[@"Create GPS access Alert"]]; + FBAssertWaitTillBecomesTrue(alert.isPresent); + + XCTAssertTrue([alert.text containsString:@"to access your location"]); + XCTAssertTrue([alert.text containsString:@"Yo Yo"]); +} + +- (void)testSheetAlert +{ + FBAlert *alert = [FBAlert alertWithApplication:self.testedApplication]; + BOOL isIpad = [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad; + [self showApplicationSheet]; + XCUIElement *showSheetButton = self.testedApplication.buttons[FBShowSheetAlertButtonName]; + XCTAssertThrowsSpecificNamed([alert filterObstructedElements:@[showSheetButton]], NSException, FBAlertObstructingElementException, @"should throw FBAlertObstructingElementException"); + +} + +@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementAttributeTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementAttributeTests.m new file mode 100644 index 000000000..f482231ae --- /dev/null +++ b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementAttributeTests.m @@ -0,0 +1,143 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import "FBTVIntegrationTestCase.h" +#import "FBFindElementCommands.h" +#import "XCUIElement+FBAccessibility.h" +#import "XCUIElement+FBIsVisible.h" +#import "XCUIElement+FBWebDriverAttributes.h" + +@interface FBTVElementAttributeTests : FBTVIntegrationTestCase +@end + +@implementation FBTVElementAttributeTests + +- (void)setUp +{ + [super setUp]; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + [self launchApplication]; + [self goToAttributesPage]; + }); +} + +- (void)testElementAccessibilityAttributes +{ + // "Select me" is accessibility element, and therefore isn't accessibility container + XCUIElement *buttonElement = self.testedApplication.buttons[@"Select me"]; + XCTAssertTrue(buttonElement.exists); + XCTAssertTrue(buttonElement.fb_isAccessibilityElement); + XCTAssertFalse(buttonElement.isWDAccessibilityContainer); +} + +- (void)testContainerAccessibilityAttributes +{ + // "Not accessible" isn't accessibility element, but contains accessibility elements, so it is accessibility container + XCUIElement *inaccessibleButtonElement = self.testedApplication.buttons[@"Not accessible"]; + XCTAssertTrue(inaccessibleButtonElement.exists); + XCTAssertFalse(inaccessibleButtonElement.fb_isAccessibilityElement); + XCTAssertTrue(inaccessibleButtonElement.isWDAccessibilityContainer); +} + +- (void)testIgnoredAccessibilityAttributes +{ + // Images are neither accessibility elements nor contain them, so both checks should fail + XCUIElement *imageElement = [self.testedApplication.images elementBoundByIndex:0]; + XCTAssertTrue(imageElement.exists); + XCTAssertFalse(imageElement.fb_isAccessibilityElement); + XCTAssertFalse(imageElement.isWDAccessibilityContainer); +} + +- (void)testButtonAttributes +{ + XCUIElement *element = self.testedApplication.buttons[@"Select me"]; + XCTAssertTrue(element.exists); + XCTAssertEqualObjects(element.wdType, @"XCUIElementTypeButton"); + XCTAssertEqualObjects(element.wdName, @"Select me"); + XCTAssertEqualObjects(element.wdLabel, @"Select me"); + XCTAssertNil(element.wdValue); + [self select:element]; + [element resolve]; + XCTAssertEqual(element.wdValue.boolValue, YES); +} + +- (void)testLabelAttributes +{ + XCUIElement *element = self.testedApplication.staticTexts[@"Text Field"]; + XCTAssertTrue(element.exists); + XCTAssertEqualObjects(element.wdType, @"XCUIElementTypeStaticText"); + XCTAssertEqualObjects(element.wdName, @"Text Field"); + XCTAssertEqualObjects(element.wdLabel, @"Text Field"); + XCTAssertEqualObjects(element.wdValue, @"Text Field"); +} + +- (void)testTextFieldAttributes +{ + XCUIElement *element = self.testedApplication.textFields[@"Value"]; + XCTAssertTrue(element.exists); + XCTAssertEqualObjects(element.wdType, @"XCUIElementTypeTextField"); + XCTAssertNil(element.wdName); + XCTAssertEqualObjects(element.wdLabel, @""); + XCTAssertEqualObjects(element.wdValue, @"Value"); +} + +- (void)testTextFieldWithAccessibilityIdentifiersAttributes +{ + XCUIElement *element = self.testedApplication.textFields[@"aIdentifier"]; + XCTAssertTrue(element.exists); + XCTAssertEqualObjects(element.wdType, @"XCUIElementTypeTextField"); + XCTAssertEqualObjects(element.wdName, @"aIdentifier"); + XCTAssertEqualObjects(element.wdLabel, @"aLabel"); + XCTAssertEqualObjects(element.wdValue, @"Value2"); +} + +- (void)testSegmentedControlAttributes +{ + XCUIElement *element = self.testedApplication.segmentedControls.element; + XCTAssertTrue(element.exists); + XCTAssertEqualObjects(element.wdType, @"XCUIElementTypeSegmentedControl"); + XCTAssertNil(element.wdName); + XCTAssertNil(element.wdLabel); + XCTAssertNil(element.wdValue); +} + +- (void)testActivityIndicatorAttributes +{ + XCUIElement *element = self.testedApplication.activityIndicators.element; + XCTAssertTrue(element.exists); + XCTAssertEqualObjects(element.wdType, @"XCUIElementTypeActivityIndicator"); + XCTAssertEqualObjects(element.wdName, @"Progress halted"); + XCTAssertEqualObjects(element.wdLabel, @"Progress halted"); + XCTAssertEqualObjects(element.wdValue, @"0"); +} + +- (void)testPageIndicatorAttributes +{ + XCUIElement *element = self.testedApplication.pageIndicators.element; + XCTAssertTrue(element.exists); + XCTAssertEqualObjects(element.wdType, @"XCUIElementTypePageIndicator"); + XCTAssertNil(element.wdName); + XCTAssertNil(element.wdLabel); + XCTAssertEqualObjects(element.wdValue, @"page 1 of 3"); +} + +- (void)testTextViewAttributes +{ + XCUIElement *element = self.testedApplication.textViews.element; + XCTAssertTrue(element.exists); + XCTAssertEqualObjects(element.wdType, @"XCUIElementTypeTextView"); + XCTAssertNil(element.wdName); + XCTAssertNil(element.wdLabel); + XCTAssertEqualObjects(element.wdValue, @"Text Field long text"); +} + +@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementScreenshotTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementScreenshotTests.m new file mode 100644 index 000000000..486c8c1ed --- /dev/null +++ b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementScreenshotTests.m @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import "FBTVIntegrationTestCase.h" +#import "XCUIDevice+FBRotation.h" +#import "XCUIElement+FBUtilities.h" + +@interface FBTVElementScreenshotTests : FBTVIntegrationTestCase +@end + +@implementation FBTVElementScreenshotTests + +- (void)setUp +{ + [super setUp]; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + [self launchApplication]; + [self goToAlertsPage]; + }); +} + +- (void)testElementScreenshot +{ + XCUIElement *button = self.testedApplication.buttons[FBShowAlertButtonName]; + NSError *error = nil; + NSData *screenshotData = [button fb_screenshotWithError:&error]; + if (nil == screenshotData && [error.description containsString:@"available since Xcode9"]) { + return; + } + XCTAssertNotNil(screenshotData); + XCTAssertNil(error); + UIImage *image = [UIImage imageWithData:screenshotData]; + XCTAssertNotNil(image); + XCTAssertTrue(image.size.width > image.size.height); +} + +@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementSelectTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementSelectTests.m new file mode 100644 index 000000000..10e69dc47 --- /dev/null +++ b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementSelectTests.m @@ -0,0 +1,118 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import + +#import "FBTVIntegrationTestCase.h" +#import "FBTestMacros.h" +#import "XCUIElement+FBTVFocuse.h" + +@interface FBTVElementSelectTests : FBTVIntegrationTestCase +@end + +@implementation FBTVElementSelectTests + +- (void)setUp +{ + [super setUp]; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + [self launchApplication]; + [self goToNavigationPage]; + }); +} + +- (void)showHorizontalLayout +{ + XCUIElement *category = self.testedApplication.cells[@"horizontal_layout"]; + NSError *error; + XCTAssertTrue([category fb_selectWithError: &error]); + XCTAssertNil(error); + XCUIElement * right = self.testedApplication.buttons[@"right"]; + XCUIElement * topLeft = self.testedApplication.buttons[@"top left"]; + FBAssertWaitTillBecomesTrue(right.exists && !topLeft.exists); +} + +- (void)showGridLayout +{ + XCUIElement *category = self.testedApplication.cells[@"grid_layout"]; + NSError *error; + XCTAssertTrue([category fb_selectWithError: &error]); + XCTAssertNil(error); + FBAssertWaitTillBecomesTrue(self.testedApplication.buttons[@"top left"].exists); +} + +- (void)showCustomLayout +{ + XCUIElement *category = self.testedApplication.cells[@"custom_layout"]; + NSError *error; + XCTAssertTrue([category fb_selectWithError: &error]); + XCTAssertNil(error); + XCUIElement * topRight = self.testedApplication.buttons[@"top right"]; + XCUIElement * topLeft = self.testedApplication.buttons[@"top left"]; + FBAssertWaitTillBecomesTrue(topRight.exists && !topLeft.exists); +} + +- (void)testVerticalNavigation +{ + XCUIElement *lastElement = self.testedApplication.cells[@"custom_layout"]; + NSError *error; + XCTAssertTrue([lastElement fb_focuseWithError: &error]); + XCTAssertNil(error); + XCTAssertTrue(lastElement.hasFocus); +} + +- (void)testErrorNavigation +{ + XCUIElement *disabledElement = self.testedApplication.cells[@"disabled_layout"]; + NSError *error; + XCTAssertFalse([disabledElement fb_focuseWithError: &error]); + XCTAssertNotNil(error); + XCTAssertFalse(disabledElement.hasFocus); +} + +- (void)testHorizontalNavigation +{ + [self showHorizontalLayout]; + XCUIElement *rightElement = self.testedApplication.buttons[@"right"]; + NSError *error; + XCTAssertTrue([rightElement fb_focuseWithError: &error]); + XCTAssertNil(error); + XCTAssertTrue(rightElement.hasFocus); +} + +- (void)testGridNavigation +{ + [self showGridLayout]; + XCUIElement *rightElement = self.testedApplication.buttons[@"bottom right"]; + NSError *firstNavError; + XCTAssertTrue([rightElement fb_focuseWithError: &firstNavError]); + XCTAssertNil(firstNavError); + XCTAssertTrue(rightElement.hasFocus); + + XCUIElement *leftElement = self.testedApplication.cells[@"grid_layout"]; + NSError *secondNavError; + XCTAssertTrue([leftElement fb_focuseWithError: &secondNavError]); + XCTAssertNil(secondNavError); + XCTAssertTrue(leftElement.hasFocus); +} + +- (void)testCustomNavigation +{ + [self showCustomLayout]; + XCUIElement *rightElement = self.testedApplication.buttons[@"bottom right"]; + NSError *error; + XCTAssertTrue([rightElement fb_focuseWithError: &error]); + XCTAssertNil(error); + XCTAssertTrue(rightElement.hasFocus); +} + +@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementVisibilityTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementVisibilityTests.m new file mode 100644 index 000000000..c28edff44 --- /dev/null +++ b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementVisibilityTests.m @@ -0,0 +1,48 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import "FBApplication.h" +#import "FBTVIntegrationTestCase.h" +#import "FBHomeboardApplication.h" +#import "FBTestMacros.h" +#import "FBXCodeCompatibility.h" +#import "XCUIElement+FBIsVisible.h" + +@interface FBTVElementVisibilityTests : FBTVIntegrationTestCase +@end + +@implementation FBTVElementVisibilityTests + +- (void)testHeadBoardIcons +{ + [self launchApplication]; + [self goToHeadBoardPage]; + + XCTAssertTrue(self.homeboard.icons[@"IntegrationApp_tvOS"].fb_isVisible); + XCTAssertTrue(self.homeboard.icons[@"Settings"].fb_isVisible); +} + +- (void)testTableViewCells +{ + [self launchApplication]; + [self goToScrollPageWithCells:true]; + XCUIElement *table = self.testedApplication.tables.allElementsBoundByIndex.firstObject; + for (int i = 0 ; i < 10 ; i++) { + FBAssertWaitTillBecomesTrue(table.cells.allElementsBoundByIndex[i].fb_isVisible); + FBAssertWaitTillBecomesTrue(table.staticTexts.allElementsBoundByIndex[i].fb_isVisible); + } + for (int i = 30 ; i < 40 ; i++) { + FBAssertWaitTillBecomesTrue(!table.cells.allElementsBoundByIndex[i].fb_isVisible); + FBAssertWaitTillBecomesTrue(!table.staticTexts.allElementsBoundByIndex[i].fb_isVisible); + } +} + +@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVFailureProofTestCaseTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVFailureProofTestCaseTests.m new file mode 100644 index 000000000..192340c85 --- /dev/null +++ b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVFailureProofTestCaseTests.m @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import "FBFailureProofTestCase.h" +#import "FBExceptionHandler.h" +#import "XCUIElement+FBTVFocuse.h" + +@interface FBTVFailureProofTestCaseTests : FBFailureProofTestCase +@end + +@implementation FBTVFailureProofTestCaseTests + +- (void)setUp +{ + [super setUp]; + [[XCUIApplication new] launch]; +} + +- (void)testPreventElementSearchFailure +{ + + [[XCUIApplication new].buttons[@"kaboom"] typeText:@"kaboom"]; +} + +- (void)testInactiveAppSearch +{ + [[XCUIDevice sharedDevice] pressButton:XCUIDeviceButtonHome]; + [[XCUIApplication new].buttons[@"kaboom"] typeText:@"kaboom"]; +} + +- (void)testPreventAssertFailure +{ + XCTAssertNotNil(nil); +} + + +@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVIntegrationTestCase.h b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVIntegrationTestCase.h new file mode 100644 index 000000000..9d4cf38af --- /dev/null +++ b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVIntegrationTestCase.h @@ -0,0 +1,65 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import "FBHomeboardApplication.h" + +NS_ASSUME_NONNULL_BEGIN + +extern NSString *const FBShowAlertButtonName; +extern NSString *const FBShowSheetAlertButtonName; +extern NSString *const FBShowAlertForceTouchButtonName; + +/** + XCTestCase helper class used for integration tests + */ +@interface FBTVIntegrationTestCase : XCTestCase +@property (nonatomic, strong, readonly) XCUIApplication *testedApplication; +@property (nonatomic, strong, readonly, getter = homeboard) FBHomeboardApplication *homeboard; + +/** + Launches application and resets side effects of testing like orientation etc. + */ +- (void)launchApplication; + +/** + Navigates integration app to attributes page + */ +- (void)goToAttributesPage; + +/** + Navigates integration app to alerts page + */ +- (void)goToAlertsPage; + +/** + Navigates integration app to navigation page + */ +- (void)goToNavigationPage; + +/** + Navigates to HeadBoard first page + */ +- (void)goToHeadBoardPage; + +/** + Select tv element in vertical row + */ +- (void)select:(XCUIElement*) element; + +/** + Navigates integration app to scrolling page + @param showCells whether should navigate to view with cell or plain scrollview + */ +- (void)goToScrollPageWithCells:(BOOL)showCells; + +@end + +NS_ASSUME_NONNULL_END diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVIntegrationTestCase.m b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVIntegrationTestCase.m new file mode 100644 index 000000000..211715628 --- /dev/null +++ b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVIntegrationTestCase.m @@ -0,0 +1,103 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "FBTVIntegrationTestCase.h" + +#import "FBHomeboardApplication.h" +#import "FBTestMacros.h" +#import "FBConfiguration.h" +#import "FBMacros.h" +#import "FBRunLoopSpinner.h" +#import "XCUIDevice+FBRotation.h" +#import "XCUIElement.h" +#import "XCUIElement+FBIsVisible.h" +#import "XCUIApplication+FBFocused.h" +#import "XCUIElement+FBTVFocuse.h" +#import "XCUIElement+FBUtilities.h" + +NSString *const FBShowAlertButtonName = @"Create App Alert"; +NSString *const FBShowSheetAlertButtonName = @"Create Sheet Alert"; +NSString *const FBShowAlertForceTouchButtonName = @"Create Alert (Force Touch)"; + +@interface FBTVIntegrationTestCase () +@property (nonatomic, strong) XCUIApplication *testedApplication; +@property (nonatomic, strong, getter = homeboard) FBHomeboardApplication *homeboard; +@end + +@implementation FBTVIntegrationTestCase + +- (void)setUp +{ + [super setUp]; + [FBConfiguration disableRemoteQueryEvaluation]; + [FBConfiguration disableAttributeKeyPathAnalysis]; + self.continueAfterFailure = NO; + self.testedApplication = [XCUIApplication new]; +} + +- (FBHomeboardApplication*) homeboard { + return [FBHomeboardApplication fb_homeboard]; +} + +- (void)launchApplication +{ + [self.testedApplication launch]; + FBAssertWaitTillBecomesTrue(self.testedApplication.buttons[@"Alerts"].fb_isVisible); + [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1]]; + + // Force resolving XCUIApplication + [self.testedApplication query]; + [self.testedApplication resolve]; +} + +- (void)goToAttributesPage +{ + [[XCUIRemote sharedRemote] pressButton:XCUIRemoteButtonDown]; + [[XCUIRemote sharedRemote] pressButton:XCUIRemoteButtonSelect]; + FBAssertWaitTillBecomesTrue(self.testedApplication.buttons[@"Select me"].fb_isVisible); +} + +- (void)goToNavigationPage +{ + [[XCUIRemote sharedRemote] pressButton:XCUIRemoteButtonDown]; + [[XCUIRemote sharedRemote] pressButton:XCUIRemoteButtonDown]; + [[XCUIRemote sharedRemote] pressButton:XCUIRemoteButtonSelect]; + FBAssertWaitTillBecomesTrue(self.testedApplication.staticTexts[@"Select template"].fb_isVisible); +} + +- (void)goToAlertsPage +{ + [[XCUIRemote sharedRemote] pressButton:XCUIRemoteButtonSelect]; + FBAssertWaitTillBecomesTrue(self.testedApplication.buttons[FBShowAlertButtonName].fb_isVisible); + FBAssertWaitTillBecomesTrue(self.testedApplication.buttons[FBShowSheetAlertButtonName].fb_isVisible); +} + +- (void)goToHeadBoardPage +{ + [[XCUIRemote sharedRemote] pressButton:XCUIRemoteButtonHome]; + FBAssertWaitTillBecomesTrue([FBHomeboardApplication fb_homeboard].icons[@"Settings"].exists); +} + +- (void)goToScrollPageWithCells:(BOOL)showCells +{ + [self select:self.testedApplication.buttons[@"Scrolling"]]; + FBAssertWaitTillBecomesTrue(self.testedApplication.buttons[@"TableView"].fb_isVisible); + [self select:self.testedApplication.buttons[showCells ? @"TableView": @"ScrollView"]]; + FBAssertWaitTillBecomesTrue(self.testedApplication.staticTexts[@"3"].fb_isVisible); +} + +- (void)select:(XCUIElement*) element +{ + [self.testedApplication fb_waitUntilSnapshotIsStable]; + NSError *error; + [element fb_selectWithError:&error]; + XCTAssertNil(error); +} + +@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVKeyboardTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVKeyboardTests.m new file mode 100644 index 000000000..2fb718314 --- /dev/null +++ b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVKeyboardTests.m @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import "FBTVIntegrationTestCase.h" +#import "FBKeyboard.h" +#import "FBRunLoopSpinner.h" + +@interface FBTVKeyboardTests : FBTVIntegrationTestCase +@end + +@implementation FBTVKeyboardTests + +- (void)setUp +{ + [super setUp]; + [self launchApplication]; + [self goToAttributesPage]; +} + +- (void)testTextTyping +{ + NSString *text = @"Happy typing"; + XCUIElement *textField = self.testedApplication.textFields[@"aIdentifier"]; + [self select: textField]; + NSError *error; + XCTAssertTrue([FBKeyboard typeText:text error:&error]); + XCTAssertNil(error); + XCTAssertEqualObjects(textField.value, text); +} + +- (void)testTypingWithoutKeyboardPresent +{ + NSError *error; + XCTAssertFalse([FBKeyboard typeText:@"This should fail" error:&error]); + XCTAssertNotNil(error); +} + +@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVTypingTest.m b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVTypingTest.m new file mode 100644 index 000000000..83dd0ba7c --- /dev/null +++ b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVTypingTest.m @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import "FBTVIntegrationTestCase.h" +#import "XCUIElement+FBTyping.h" + +@interface FBTVTypingTest : FBTVIntegrationTestCase +@end + +@implementation FBTVTypingTest + +- (void)setUp +{ + [super setUp]; + [self launchApplication]; + [self goToAttributesPage]; +} + +- (void)testTextTyping +{ + NSString *text = @"Cannot automatically open keyboard"; + XCUIElement *textField = self.testedApplication.textFields[@"aIdentifier"]; + NSError *error; + XCTAssertFalse([textField fb_typeText:text error:&error]); + XCTAssertNotNil(error); +} + +- (void)testTextTypingOnFocusedElement +{ + NSString *text = @"Happy typing"; + XCUIElement *textField = self.testedApplication.textFields[@"aIdentifier"]; + [self select:textField]; + XCTAssertTrue(textField.hasKeyboardFocus); + NSError *error; + XCTAssertTrue([textField fb_typeText:text error:&error]); + XCTAssertNil(error); + XCTAssertEqualObjects(textField.value, text); +} + +- (void)testTextClearing +{ + XCUIElement *textField = self.testedApplication.textFields[@"aIdentifier"]; + [self select:textField]; + [textField typeText:@"Happy typing"]; + XCTAssertTrue([textField.value length] > 0); + NSError *error; + XCTAssertTrue([textField fb_clearTextWithError:&error]); + XCTAssertNil(error); + XCTAssertEqualObjects(textField.value, @"Hold  to dictate"); +} + +@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVXPathIntegrationTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVXPathIntegrationTests.m new file mode 100644 index 000000000..d228ab3fc --- /dev/null +++ b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVXPathIntegrationTests.m @@ -0,0 +1,68 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import "FBTVIntegrationTestCase.h" +#import "XCUIElement.h" +#import "XCUIElement+FBFind.h" +#import "XCUIElement+FBUtilities.h" +#import "FBXPath.h" +#import "XCUIElement+FBWebDriverAttributes.h" + +@interface FBTVXPathIntegrationTests : FBTVIntegrationTestCase +@property (nonatomic, strong) XCUIElement *testedView; +@end + +@implementation FBTVXPathIntegrationTests + +- (void)setUp +{ + [super setUp]; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + [self launchApplication]; + }); + self.testedView = self.testedApplication.otherElements[@"MainView"]; + XCTAssertTrue(self.testedView.exists); + [self.testedView resolve]; +} + +- (void)testSingleDescendantXMLRepresentation +{ + NSString *expectedType = @"XCUIElementTypeButton"; + XCUIElement *matchingElement = [[self.testedView fb_descendantsMatchingXPathQuery:[NSString stringWithFormat:@"//%@", expectedType] shouldReturnAfterFirstMatch:YES] firstObject]; + XCElementSnapshot *matchingSnapshot = matchingElement.fb_lastSnapshot; + + NSString *xmlStr = [FBXPath xmlStringWithSnapshot:matchingSnapshot]; + XCTAssertNotNil(xmlStr); + + NSString *expectedXml = [NSString stringWithFormat:@"\n<%@ type=\"%@\" name=\"%@\" label=\"%@\" enabled=\"%@\" visible=\"%@\" focused=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\"/>\n", expectedType, expectedType, matchingSnapshot.wdName, matchingSnapshot.wdLabel, matchingSnapshot.wdEnabled ? @"true" : @"false", matchingSnapshot.wdVisible ? @"true" : @"false", matchingSnapshot.wdFocused ? @"true" : @"false", [matchingSnapshot.wdRect[@"x"] stringValue], [matchingSnapshot.wdRect[@"y"] stringValue], [matchingSnapshot.wdRect[@"width"] stringValue], [matchingSnapshot.wdRect[@"height"] stringValue]]; + XCTAssertTrue([xmlStr isEqualToString: expectedXml]); +} + +- (void)testFindMatchesInElement +{ + NSArray *matchingSnapshots = [FBXPath findMatchesIn:self.testedView.fb_lastSnapshot xpathQuery:@"//XCUIElementTypeButton"]; + XCTAssertEqual([matchingSnapshots count], 4); + for (id element in matchingSnapshots) { + XCTAssertTrue([element.wdType isEqualToString:@"XCUIElementTypeButton"]); + } +} + +- (void)testFindMatchesInElementWithDotNotation +{ + NSArray *matchingSnapshots = [FBXPath findMatchesIn:self.testedView.fb_lastSnapshot xpathQuery:@".//XCUIElementTypeButton"]; + XCTAssertEqual([matchingSnapshots count], 4); + for (id element in matchingSnapshots) { + XCTAssertTrue([element.wdType isEqualToString:@"XCUIElementTypeButton"]); + } +} + +@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/Info.plist b/WebDriverAgentTests/IntegrationTests_tvOS/Info.plist new file mode 100644 index 000000000..6c40a6cd0 --- /dev/null +++ b/WebDriverAgentTests/IntegrationTests_tvOS/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCElementSnapshotHelperTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCElementSnapshotHelperTests.m new file mode 100644 index 000000000..8a27d829e --- /dev/null +++ b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCElementSnapshotHelperTests.m @@ -0,0 +1,206 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import "FBTVIntegrationTestCase.h" +#import "FBTestMacros.h" +#import "XCElementSnapshot+FBHelpers.h" +#import "XCUIElement.h" +#import "XCUIElement+FBIsVisible.h" +#import "XCUIElement+FBUtilities.h" +#import "XCUIElement+FBWebDriverAttributes.h" + +@interface TVXCElementSnapshotHelperTests : FBTVIntegrationTestCase +@property (nonatomic, strong) XCUIElement *testedView; +@end + +@implementation TVXCElementSnapshotHelperTests + +- (void)setUp +{ + [super setUp]; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + [self launchApplication]; + }); + self.testedView = self.testedApplication.otherElements[@"MainView"]; + XCTAssertTrue(self.testedView.exists); + [self.testedView resolve]; +} + +- (void)testDescendantsMatchingType +{ + NSSet *expectedLabels = [NSSet setWithArray:@[ + @"Alerts", + @"Attributes", + @"Navigation", + @"Scrolling", + ]]; + NSArray *matchingSnapshots = [self.testedView.fb_lastSnapshot fb_descendantsMatchingType:XCUIElementTypeButton]; + XCTAssertEqual(matchingSnapshots.count, expectedLabels.count); + NSArray *labels = [matchingSnapshots valueForKeyPath:@"@distinctUnionOfObjects.label"]; + XCTAssertEqualObjects([NSSet setWithArray:labels], expectedLabels); + + NSArray *types = [matchingSnapshots valueForKeyPath:@"@distinctUnionOfObjects.elementType"]; + XCTAssertEqual(types.count, 1, @"matchingSnapshots should contain only one type"); + XCTAssertEqualObjects(types.lastObject, @(XCUIElementTypeButton), @"matchingSnapshots should contain only one type"); +} + +- (void)testDescendantsMatchingXPath +{ + NSArray *matchingSnapshots = [self.testedView.fb_lastSnapshot fb_descendantsMatchingXPathQuery:@"//XCUIElementTypeButton[@label='Alerts']"]; + XCTAssertEqual(matchingSnapshots.count, 1); + XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); + XCTAssertEqualObjects(matchingSnapshots.lastObject.label, @"Alerts"); +} + +- (void)testParentMatchingType +{ + XCUIElement *button = self.testedApplication.buttons[@"Alerts"]; + XCTAssertTrue(button.exists); + [button resolve]; + XCElementSnapshot *windowSnapshot = [button.fb_lastSnapshot fb_parentMatchingType:XCUIElementTypeWindow]; + XCTAssertNotNil(windowSnapshot); + XCTAssertEqual(windowSnapshot.elementType, XCUIElementTypeWindow); +} + +@end + +@interface TVXCElementSnapshotHelperTests_AttributePage : FBTVIntegrationTestCase +@end + +@implementation TVXCElementSnapshotHelperTests_AttributePage + +- (void)setUp +{ + [super setUp]; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + [self launchApplication]; + [self goToAttributesPage]; + }); +} + +- (void)testParentMatchingOneOfTypes +{ + XCUIElement *todayPickerWheel = self.testedApplication.staticTexts[@"Text view"]; + XCTAssertTrue(todayPickerWheel.exists); + [todayPickerWheel resolve]; + XCElementSnapshot *window = [todayPickerWheel.fb_lastSnapshot fb_parentMatchingOneOfTypes:@[@(XCUIElementTypeApplication), @(XCUIElementTypeWindow)]]; + XCTAssertNotNil(window); + XCTAssertEqual(window.elementType, XCUIElementTypeWindow); +} + +- (void)testParentMatchingOneOfTypesWithXCUIElementTypeAny +{ + XCUIElement *todayPickerWheel = self.testedApplication.staticTexts[@"Text view"]; + XCTAssertTrue(todayPickerWheel.exists); + [todayPickerWheel resolve]; + XCElementSnapshot *otherSnapshot = [todayPickerWheel.fb_lastSnapshot fb_parentMatchingOneOfTypes:@[@(XCUIElementTypeAny), @(XCUIElementTypeWindow)]]; + XCTAssertNotNil(otherSnapshot); + XCTAssertEqual(otherSnapshot.elementType, XCUIElementTypeOther); +} + +- (void)testParentMatchingOneOfTypesWithAbsentParents +{ + XCUIElement *todayPickerWheel = self.testedApplication.staticTexts[@"Text view"]; + XCTAssertTrue(todayPickerWheel.exists); + [todayPickerWheel resolve]; + XCElementSnapshot *otherSnapshot = [todayPickerWheel.fb_lastSnapshot fb_parentMatchingOneOfTypes:@[@(XCUIElementTypeTab), @(XCUIElementTypeLink)]]; + XCTAssertNil(otherSnapshot); +} + +@end + +@interface TVXCElementSnapshotHelperTests_ScrollView : FBTVIntegrationTestCase +@end + +@implementation TVXCElementSnapshotHelperTests_ScrollView + +- (void)setUp +{ + [super setUp]; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + [self launchApplication]; + [self goToScrollPageWithCells:false]; + }); +} + +- (void)testParentMatchingOneOfTypesWithFilter +{ + XCUIElement *threeStaticText = self.testedApplication.staticTexts[@"3"]; + [threeStaticText resolve]; + NSArray *acceptedParents = @[ + @(XCUIElementTypeScrollView), + @(XCUIElementTypeCollectionView), + @(XCUIElementTypeTable), + ]; + XCElementSnapshot *scrollView = [threeStaticText.fb_lastSnapshot fb_parentMatchingOneOfTypes:acceptedParents + filter:^(XCElementSnapshot *snapshot) { + return [snapshot isWDVisible]; + }]; + XCTAssertEqualObjects(scrollView.identifier, @"scrollView"); +} + +- (void)testParentMatchingOneOfTypesWithFilterRetruningNo +{ + XCUIElement *threeStaticText = self.testedApplication.staticTexts[@"3"]; + [threeStaticText resolve]; + NSArray *acceptedParents = @[ + @(XCUIElementTypeScrollView), + @(XCUIElementTypeCollectionView), + @(XCUIElementTypeTable), + ]; + XCElementSnapshot *scrollView = [threeStaticText.fb_lastSnapshot fb_parentMatchingOneOfTypes:acceptedParents + filter:^(XCElementSnapshot *snapshot) { + return NO; + }]; + XCTAssertNil(scrollView); +} + +- (void)testDescendantsCellSnapshots +{ + XCUIElement *scrollView = self.testedApplication.scrollViews[@"scrollView"]; + [scrollView resolve]; + FBAssertWaitTillBecomesTrue(self.testedApplication.staticTexts[@"3"].fb_isVisible); + NSArray *cells = [scrollView.fb_lastSnapshot fb_descendantsCellSnapshots]; + XCTAssertGreaterThanOrEqual(cells.count, 10); + XCElementSnapshot *element = cells.firstObject; + XCTAssertEqualObjects(element.label, @"0"); +} + +@end + +@interface TVXCElementSnapshotHelperTests_ScrollViewCells : FBTVIntegrationTestCase +@end + +@implementation TVXCElementSnapshotHelperTests_ScrollViewCells + +- (void)setUp +{ + [super setUp]; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + [self launchApplication]; + [self goToScrollPageWithCells:YES]; + }); +} + +- (void)testParentCellSnapshot +{ + FBAssertWaitTillBecomesTrue(self.testedApplication.staticTexts[@"3"].fb_isVisible); + XCUIElement *threeStaticText = self.testedApplication.staticTexts[@"3"]; + [threeStaticText resolve]; + XCElementSnapshot *xcuiElementCell = [threeStaticText.fb_lastSnapshot fb_parentCellSnapshot]; + XCTAssertEqual(xcuiElementCell.elementType, 75); +} + +@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCElementSnapshotHitPoint.m b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCElementSnapshotHitPoint.m new file mode 100644 index 000000000..a887c2e19 --- /dev/null +++ b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCElementSnapshotHitPoint.m @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "FBTVIntegrationTestCase.h" +#import "FBMathUtils.h" +#import "XCElementSnapshot+FBHitpoint.h" +#import "XCUIElement.h" +#import "XCUIElement+FBUtilities.h" + +@interface TVXCElementSnapshotHitPoint : FBTVIntegrationTestCase +@end + +@implementation TVXCElementSnapshotHitPoint + +- (void)testAccessibilityActivationPoint +{ + [self launchApplication]; + [self goToAttributesPage]; + XCUIElement *element = self.testedApplication.otherElements[@"testView"]; + NSError *error; + FBElementHitPoint *hitpoint = [element.fb_lastSnapshot fb_hitPoint:&error]; + XCTAssertNotNil(hitpoint); + XCTAssertTrue(FBPointFuzzyEqualToPoint(hitpoint.point, CGPointMake(25, 25), 0.1)); +} + +@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIApplicationHelperTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIApplicationHelperTests.m new file mode 100644 index 000000000..97031e527 --- /dev/null +++ b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIApplicationHelperTests.m @@ -0,0 +1,80 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import "FBApplication.h" +#import "FBTVIntegrationTestCase.h" +#import "FBTestMacros.h" +#import "FBHomeboardApplication.h" +#import "XCUIApplication+FBHelpers.h" +#import "XCUIElement+FBIsVisible.h" + +@interface TVXCUIApplicationHelperTests : FBTVIntegrationTestCase +@end + +@implementation TVXCUIApplicationHelperTests + +- (void)setUp +{ + [super setUp]; + [self launchApplication]; +} + +- (void)testQueringSpringboard +{ + [self goToHeadBoardPage]; + XCTAssertTrue([FBHomeboardApplication fb_homeboard].icons[@"Settings"].exists); +} + +- (void)testTappingAppOnSpringboard +{ + [self goToHeadBoardPage]; + NSError *error; + XCTAssertTrue([[FBHomeboardApplication fb_homeboard] fb_openApplicationWithIdentifier:@"Settings" error:&error]); + XCTAssertNil(error); + XCTAssertTrue([FBApplication fb_activeApplication].cells[@"General"].exists); +} + +- (void)testWaitingForSpringboard +{ + NSError *error; + [[XCUIDevice sharedDevice] pressButton:XCUIDeviceButtonHome]; + XCTAssertTrue([[FBHomeboardApplication fb_homeboard] fb_waitUntilApplicationBoardIsVisible:&error]); + XCTAssertNil(error); + XCTAssertTrue([FBHomeboardApplication fb_homeboard].icons[@"Settings"].fb_isVisible); +} + +- (void)testApplicationTree +{ + [self.testedApplication query]; + [self.testedApplication resolve]; + XCTAssertNotNil(self.testedApplication.fb_tree); + XCTAssertNotNil(self.testedApplication.fb_accessibilityTree); +} + +- (void)testDeactivateApplication +{ + [self.testedApplication query]; + [self.testedApplication resolve]; + NSError *error; + XCTAssertTrue([self.testedApplication fb_deactivateWithDuration:1 error:&error]); + XCTAssertNil(error); + XCTAssertTrue(self.testedApplication.buttons[@"Alerts"].exists); + FBAssertWaitTillBecomesTrue(self.testedApplication.buttons[@"Alerts"].fb_isVisible); +} + +- (void)testActiveApplication +{ + XCTAssertTrue([FBApplication fb_activeApplication].buttons[@"Alerts"].fb_isVisible); + [self goToHeadBoardPage]; + XCTAssertTrue([FBApplication fb_activeApplication].icons[@"Settings"].fb_isVisible); +} + +@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIDeviceHealthCheckTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIDeviceHealthCheckTests.m new file mode 100644 index 000000000..aabff3886 --- /dev/null +++ b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIDeviceHealthCheckTests.m @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import "FBTVIntegrationTestCase.h" +#import "XCUIDevice+FBHealthCheck.h" +#import "XCUIElement.h" + +@interface TVXCUIDeviceHealthCheckTests : FBTVIntegrationTestCase +@end + +@implementation TVXCUIDeviceHealthCheckTests + +- (void)testHealthCheck +{ + [self launchApplication]; + XCTAssertTrue(self.testedApplication.exists); + XCTAssertTrue([[XCUIDevice sharedDevice] fb_healthCheckWithApplication:self.testedApplication]); +} + +@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIDeviceHelperTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIDeviceHelperTests.m new file mode 100644 index 000000000..988642f9e --- /dev/null +++ b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIDeviceHelperTests.m @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import "FBTVIntegrationTestCase.h" +#import "FBApplication.h" +#import "XCUIDevice+FBHelpers.h" + +@interface TVXCUIDeviceHelperTests : FBTVIntegrationTestCase +@end + +@implementation TVXCUIDeviceHelperTests + +- (void)setUp +{ + [super setUp]; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + [self launchApplication]; + }); +} + +- (void)testScreenshot +{ + NSError *error = nil; + NSData *screenshotData = [[XCUIDevice sharedDevice] fb_screenshotWithError:&error]; + XCTAssertNotNil([UIImage imageWithData:screenshotData]); + XCTAssertNil(error); +} + +- (void)testWifiAddress +{ + NSString *adderss = [XCUIDevice sharedDevice].fb_wifiIPAddress; + if (!adderss) { + return; + } + NSRange range = [adderss rangeOfString:@"^([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})" options:NSRegularExpressionSearch]; + XCTAssertTrue(range.location != NSNotFound); +} + +- (void)testGoToHomeScreen +{ + NSError *error; + XCTAssertTrue([[XCUIDevice sharedDevice] fb_goToHomescreenWithError:&error]); + XCTAssertNil(error); + XCTAssertTrue([FBApplication fb_activeApplication].icons[@"Settings"].exists); +} + +@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementAttributesTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementAttributesTests.m new file mode 100644 index 000000000..bd18fc6ca --- /dev/null +++ b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementAttributesTests.m @@ -0,0 +1,126 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import "FBTVIntegrationTestCase.h" +#import "XCUIElement+FBWebDriverAttributes.h" +#import "XCUIElement+FBFind.h" +#import "FBElementUtils.h" + +@interface TVXCUIElementAttributesTests : FBTVIntegrationTestCase +@property (nonatomic, strong) XCUIElement *matchingElement; +@end + +@implementation TVXCUIElementAttributesTests + +- (void)setUp +{ + [super setUp]; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + [self launchApplication]; + }); + XCUIElement *testedView = self.testedApplication.otherElements[@"MainView"]; + XCTAssertTrue(testedView.exists); + [testedView resolve]; + self.matchingElement = [[testedView fb_descendantsMatchingIdentifier:@"Alerts" shouldReturnAfterFirstMatch:YES] firstObject]; + XCTAssertNotNil(self.matchingElement); +} + +- (void)verifyGettingAttributeWithShortcut:(NSString *)shortcutName expectedValue:(id)expectedValue +{ + NSString *fullAttributeName = [NSString stringWithFormat:@"wd%@", [NSString stringWithFormat:@"%@%@", [[shortcutName substringToIndex:1] uppercaseString], [shortcutName substringFromIndex:1]]]; + id actualValue = [self.matchingElement fb_valueForWDAttributeName:fullAttributeName]; + id actualShortcutValue = [self.matchingElement fb_valueForWDAttributeName:shortcutName]; + if (nil == expectedValue) { + XCTAssertNil(actualValue); + XCTAssertNil(actualShortcutValue); + return; + } + if ([actualValue isKindOfClass:NSString.class]) { + XCTAssertTrue([actualValue isEqualToString:expectedValue]); + XCTAssertTrue([actualShortcutValue isEqualToString:expectedValue]); + } else if ([actualValue isKindOfClass:NSNumber.class]) { + XCTAssertTrue([actualValue isEqualToNumber:expectedValue]); + XCTAssertTrue([actualShortcutValue isEqualToNumber:expectedValue]); + } else { + XCTAssertEqual(actualValue, expectedValue); + XCTAssertEqual(actualShortcutValue, expectedValue); + } +} + +- (void)testGetNameAttribute +{ + [self verifyGettingAttributeWithShortcut:@"name" expectedValue:self.matchingElement.wdName]; +} + +- (void)testGetValueAttribute +{ + [self verifyGettingAttributeWithShortcut:@"value" expectedValue:self.matchingElement.wdValue]; +} + +- (void)testGetLabelAttribute +{ + [self verifyGettingAttributeWithShortcut:@"label" expectedValue:self.matchingElement.wdLabel]; +} + +- (void)testGetTypeAttribute +{ + [self verifyGettingAttributeWithShortcut:@"type" expectedValue:self.matchingElement.wdType]; +} + +- (void)testGetRectAttribute +{ + NSString *shortcutName = @"rect"; + for (NSString *key in @[@"x", @"y", @"width", @"height"]) { + NSNumber *actualValue = [self.matchingElement fb_valueForWDAttributeName:[FBElementUtils wdAttributeNameForAttributeName:shortcutName]][key]; + NSNumber *actualShortcutValue = [self.matchingElement fb_valueForWDAttributeName:shortcutName][key]; + NSNumber *expectedValue = self.matchingElement.wdRect[key]; + XCTAssertTrue([actualValue isEqualToNumber:expectedValue]); + XCTAssertTrue([actualShortcutValue isEqualToNumber:expectedValue]); + } +} + +- (void)testGetEnabledAttribute +{ + [self verifyGettingAttributeWithShortcut:@"enabled" expectedValue:[NSNumber numberWithBool:self.matchingElement.wdEnabled]]; +} + +- (void)testGetFocusedAttribute +{ + [self verifyGettingAttributeWithShortcut:@"focused" expectedValue:[NSNumber numberWithBool:self.matchingElement.wdFocused]]; +} + +- (void)testGetAccessibleAttribute +{ + [self verifyGettingAttributeWithShortcut:@"accessible" expectedValue:[NSNumber numberWithBool:self.matchingElement.wdAccessible]]; +} + +- (void)testGetUidAttribute +{ + [self verifyGettingAttributeWithShortcut:@"UID" expectedValue:@(self.matchingElement.wdUID)]; +} + +- (void)testGetVisibleAttribute +{ + [self verifyGettingAttributeWithShortcut:@"visible" expectedValue:[NSNumber numberWithBool:self.matchingElement.wdVisible]]; +} + +- (void)testGetAccessibilityContainerAttribute +{ + [self verifyGettingAttributeWithShortcut:@"accessibilityContainer" expectedValue:[NSNumber numberWithBool:self.matchingElement.wdAccessibilityContainer]]; +} + +- (void)testGetInvalidAttribute +{ + XCTAssertThrowsSpecificNamed([self verifyGettingAttributeWithShortcut:@"invalid" expectedValue:@"blabla"], NSException, FBUnknownAttributeException); +} + +@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementFBFindTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementFBFindTests.m new file mode 100644 index 000000000..55ed38c8b --- /dev/null +++ b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementFBFindTests.m @@ -0,0 +1,336 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import "FBTVIntegrationTestCase.h" +#import "FBElementUtils.h" +#import "FBTestMacros.h" +#import "XCUIElement.h" +#import "XCUIElement+FBFind.h" +#import "XCElementSnapshot+FBHelpers.h" +#import "XCUIElement+FBIsVisible.h" +#import "XCUIElement+FBClassChain.h" +#import "FBXPath.h" + +@interface TVXCUIElementFBFindTests : FBTVIntegrationTestCase +@property (nonatomic, strong) XCUIElement *testedView; +@end + +@implementation TVXCUIElementFBFindTests + +- (void)setUp +{ + [super setUp]; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + [self launchApplication]; + }); + self.testedView = self.testedApplication.otherElements[@"MainView"].otherElements.firstMatch; + XCTAssertTrue(self.testedView.exists); + [self.testedView resolve]; +} + +- (void)testDescendantsWithClassName +{ + NSSet *expectedLabels = [NSSet setWithArray:@[ + @"Alerts", + @"Attributes", + @"Navigation", + @"Scrolling", + ]]; + NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingClassName:@"XCUIElementTypeButton" shouldReturnAfterFirstMatch:NO]; + XCTAssertEqual(matchingSnapshots.count, expectedLabels.count); + NSArray *labels = [matchingSnapshots valueForKeyPath:@"@distinctUnionOfObjects.label"]; + XCTAssertEqualObjects([NSSet setWithArray:labels], expectedLabels); + + NSArray *types = [matchingSnapshots valueForKeyPath:@"@distinctUnionOfObjects.elementType"]; + XCTAssertEqual(types.count, 1, @"matchingSnapshots should contain only one type"); + XCTAssertEqualObjects(types.lastObject, @(XCUIElementTypeButton), @"matchingSnapshots should contain only one type"); +} + +- (void)testSingleDescendantWithClassName +{ + NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingClassName:@"XCUIElementTypeButton" shouldReturnAfterFirstMatch:YES]; + XCTAssertEqual(matchingSnapshots.count, 1); + XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); +} + +- (void)testDescendantsWithIdentifier +{ + NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingIdentifier:@"Alerts" shouldReturnAfterFirstMatch:NO]; + XCTAssertEqual(matchingSnapshots.count, 1); + XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); + XCTAssertEqualObjects(matchingSnapshots.lastObject.label, @"Alerts"); +} + +- (void)testSingleDescendantWithIdentifier +{ + NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingIdentifier:@"Alerts" shouldReturnAfterFirstMatch:YES]; + XCTAssertEqual(matchingSnapshots.count, 1); + XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); + XCTAssertEqualObjects(matchingSnapshots.lastObject.label, @"Alerts"); +} + +- (void)testSingleDescendantWithMissingIdentifier +{ + NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingIdentifier:@"blabla" shouldReturnAfterFirstMatch:YES]; + XCTAssertEqual(matchingSnapshots.count, 0); +} + +- (void)testDescendantsWithXPathQuery +{ + NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingXPathQuery:@"//XCUIElementTypeButton[@label='Alerts']" shouldReturnAfterFirstMatch:NO]; + XCTAssertEqual(matchingSnapshots.count, 1); + XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); + XCTAssertEqualObjects(matchingSnapshots.lastObject.label, @"Alerts"); +} + +- (void)testSelfWithXPathQuery +{ + NSArray *matchingSnapshots = [self.testedApplication fb_descendantsMatchingXPathQuery:@"//XCUIElementTypeApplication" shouldReturnAfterFirstMatch:NO]; + XCTAssertEqual(matchingSnapshots.count, 1); + XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeApplication); +} + +- (void)testSingleDescendantWithXPathQuery +{ + NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingXPathQuery:@"//XCUIElementTypeButton" shouldReturnAfterFirstMatch:YES]; + XCTAssertEqual(matchingSnapshots.count, 1); + XCUIElement *matchingSnapshot = [matchingSnapshots firstObject]; + XCTAssertNotNil(matchingSnapshot); + XCTAssertEqual(matchingSnapshot.elementType, XCUIElementTypeButton); + XCTAssertEqualObjects(matchingSnapshot.label, @"Alerts"); +} + +- (void)testSingleDescendantWithXPathQueryNoMatches +{ + XCUIElement *matchingSnapshot = [[self.testedView fb_descendantsMatchingXPathQuery:@"//XCUIElementTypeButtonnn" shouldReturnAfterFirstMatch:YES] firstObject]; + XCTAssertNil(matchingSnapshot); +} + +- (void)testSingleLastDescendantWithXPathQuery +{ + XCUIElement *matchingSnapshot = [[self.testedView fb_descendantsMatchingXPathQuery:@"(//XCUIElementTypeButton)[last()]" shouldReturnAfterFirstMatch:YES] firstObject]; + XCTAssertNotNil(matchingSnapshot); + XCTAssertEqual(matchingSnapshot.elementType, XCUIElementTypeButton); +} + +- (void)testDescendantsWithXPathQueryNoMatches +{ + NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingXPathQuery:@"//XCUIElementTypeButton[@label='Alerts1']" shouldReturnAfterFirstMatch:NO]; + XCTAssertEqual(matchingSnapshots.count, 0); +} + +- (void)testDescendantsWithComplexXPathQuery +{ + NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingXPathQuery:@"//*[@label='Scrolling']/preceding::*[boolean(string(@label))]" shouldReturnAfterFirstMatch:NO]; + XCTAssertEqual(matchingSnapshots.count, 3); +} + +- (void)testDescendantsWithWrongXPathQuery +{ + XCTAssertThrowsSpecificNamed([self.testedView fb_descendantsMatchingXPathQuery:@"//*[blabla(@label, Scrolling')]" shouldReturnAfterFirstMatch:NO], + NSException, FBInvalidXPathException); +} + +- (void)testFirstDescendantWithWrongXPathQuery +{ + XCTAssertThrowsSpecificNamed([self.testedView fb_descendantsMatchingXPathQuery:@"//*[blabla(@label, Scrolling')]" shouldReturnAfterFirstMatch:YES], + NSException, FBInvalidXPathException); +} + +- (void)testVisibleDescendantWithXPathQuery +{ + NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingXPathQuery:@"//XCUIElementTypeButton[@name='Alerts' and @enabled='true' and @visible='true']" shouldReturnAfterFirstMatch:NO]; + XCTAssertEqual(matchingSnapshots.count, 1); + XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); + XCTAssertTrue(matchingSnapshots.lastObject.isEnabled); + XCTAssertTrue(matchingSnapshots.lastObject.fb_isVisible); + XCTAssertEqualObjects(matchingSnapshots.lastObject.label, @"Alerts"); +} + +- (void)testDescendantsWithPredicateString +{ + NSPredicate *predicate = [NSPredicate predicateWithFormat:@"label = 'Alerts'"]; + NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingPredicate:predicate shouldReturnAfterFirstMatch:NO]; + XCTAssertEqual(matchingSnapshots.count, 1); + XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); + XCTAssertEqualObjects(matchingSnapshots.lastObject.label, @"Alerts"); +} + +- (void)testSelfWithPredicateString +{ + NSPredicate *predicate = [NSPredicate predicateWithFormat:@"type == 'XCUIElementTypeApplication'"]; + NSArray *matchingSnapshots = [self.testedApplication fb_descendantsMatchingPredicate:predicate shouldReturnAfterFirstMatch:NO]; + XCTAssertEqual(matchingSnapshots.count, 1); + XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeApplication); +} + +- (void)testSingleDescendantWithPredicateString +{ + NSPredicate *predicate = [NSPredicate predicateWithFormat:@"type = 'XCUIElementTypeButton'"]; + NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingPredicate:predicate shouldReturnAfterFirstMatch:YES]; + XCTAssertEqual(matchingSnapshots.count, 1); + XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); +} + +- (void)testDescendantsWithPropertyStrict +{ + NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingProperty:@"label" value:@"Alert" partialSearch:NO]; + XCTAssertEqual(matchingSnapshots.count, 0); + matchingSnapshots = [self.testedView fb_descendantsMatchingProperty:@"label" value:@"Alerts" partialSearch:NO]; + XCTAssertEqual(matchingSnapshots.count, 1); + XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); + XCTAssertEqualObjects(matchingSnapshots.lastObject.label, @"Alerts"); +} + +- (void)testGlobalWithPropertyStrict +{ + NSArray *matchingSnapshots = [self.testedApplication fb_descendantsMatchingProperty:@"label" value:@"Alert" partialSearch:NO]; + XCTAssertEqual(matchingSnapshots.count, 0); + matchingSnapshots = [self.testedApplication fb_descendantsMatchingProperty:@"label" value:@"Alerts" partialSearch:NO]; + XCTAssertEqual(matchingSnapshots.count, 1); + XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); + XCTAssertEqualObjects(matchingSnapshots.lastObject.label, @"Alerts"); +} + +- (void)testDescendantsWithPropertyPartial +{ + NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingProperty:@"label" value:@"Alerts" partialSearch:NO]; + XCTAssertEqual(matchingSnapshots.count, 1); + XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); + XCTAssertEqualObjects(matchingSnapshots.lastObject.label, @"Alerts"); +} + +- (void)testDescendantsWithClassChain +{ + NSArray *matchingSnapshots; + matchingSnapshots = [self.testedApplication fb_descendantsMatchingClassChain:@"XCUIElementTypeWindow/*/*/XCUIElementTypeButton" shouldReturnAfterFirstMatch:NO]; + XCTAssertEqual(matchingSnapshots.count, 4); + for (XCUIElement *matchingSnapshot in matchingSnapshots) { + XCTAssertEqual(matchingSnapshot.elementType, XCUIElementTypeButton); + } +} + +- (void)testDescendantsWithClassChainAndPredicates +{ + NSArray *matchingSnapshots; + matchingSnapshots = [self.testedApplication fb_descendantsMatchingClassChain:@"XCUIElementTypeWindow/*/*/XCUIElementTypeButton[`label BEGINSWITH 'A'`]" shouldReturnAfterFirstMatch:NO]; + XCTAssertEqual(matchingSnapshots.count, 2); + XCTAssertEqualObjects([matchingSnapshots firstObject].label, @"Alerts"); + XCTAssertEqualObjects([matchingSnapshots lastObject].label, @"Attributes"); +} + +- (void)testDescendantsWithIndirectClassChainAndPredicates +{ + NSArray *simpleQueryMatches = [self.testedApplication fb_descendantsMatchingClassChain:@"XCUIElementTypeWindow/*/*/XCUIElementTypeButton[`label BEGINSWITH 'A'`]" shouldReturnAfterFirstMatch:NO]; + NSArray *deepQueryMatches = [self.testedApplication fb_descendantsMatchingClassChain:@"XCUIElementTypeWindow/**/XCUIElementTypeButton[`label BEGINSWITH 'A'`]" shouldReturnAfterFirstMatch:NO]; + XCTAssertEqual(simpleQueryMatches.count, deepQueryMatches.count); + XCTAssertEqualObjects([simpleQueryMatches firstObject].label, [deepQueryMatches firstObject].label); + XCTAssertEqualObjects([simpleQueryMatches lastObject].label, [deepQueryMatches lastObject].label); +} + +- (void)testClassChainWithDescendantPredicate +{ + NSArray *simpleQueryMatches = [self.testedApplication fb_descendantsMatchingClassChain:@"XCUIElementTypeWindow/*/*/*[2]" shouldReturnAfterFirstMatch:NO]; + NSArray *predicateQueryMatches = [self.testedApplication fb_descendantsMatchingClassChain:@"XCUIElementTypeWindow/*/*/*[$type == 'XCUIElementTypeButton' AND label BEGINSWITH 'At'$]" shouldReturnAfterFirstMatch:NO]; + XCTAssertEqual(simpleQueryMatches.count, predicateQueryMatches.count); + XCTAssertEqual([simpleQueryMatches firstObject].elementType, [predicateQueryMatches firstObject].elementType); + XCTAssertEqual([simpleQueryMatches lastObject].elementType, [predicateQueryMatches lastObject].elementType); +} + +- (void)testSingleDescendantWithComplexIndirectClassChain +{ + NSArray *queryMatches = [self.testedApplication fb_descendantsMatchingClassChain:@"**/*/XCUIElementTypeButton[2]" shouldReturnAfterFirstMatch:NO]; + XCTAssertEqual(queryMatches.count, 1); + XCTAssertEqual(queryMatches.lastObject.elementType, XCUIElementTypeButton); + XCTAssertEqualObjects(queryMatches.lastObject.label, @"Attributes"); +} + +- (void)testSingleDescendantWithComplexIndirectClassChainAndZeroMatches +{ + NSArray *queryMatches = [self.testedApplication fb_descendantsMatchingClassChain:@"**/*/XCUIElementTypeWindow" shouldReturnAfterFirstMatch:NO]; + XCTAssertEqual(queryMatches.count, 0); +} + +- (void)testDescendantsWithClassChainAndPredicatesAndIndexes +{ + NSArray *matchingSnapshots; + matchingSnapshots = [self.testedApplication fb_descendantsMatchingClassChain:@"XCUIElementTypeWindow[`name != 'bla'`]/*/*/XCUIElementTypeButton[`label BEGINSWITH \"A\"`][1]" shouldReturnAfterFirstMatch:NO]; + XCTAssertEqual(matchingSnapshots.count, 1); + XCTAssertEqualObjects([matchingSnapshots firstObject].label, @"Alerts"); +} + +- (void)testSingleDescendantWithClassChain +{ + NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingClassChain:@"XCUIElementTypeButton" shouldReturnAfterFirstMatch:YES]; + + XCTAssertEqual(matchingSnapshots.count, 1); + XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); + XCTAssertTrue([matchingSnapshots.lastObject.label isEqualToString:@"Alerts"]); +} + +- (void)testSingleDescendantWithClassChainAndNegativeIndex +{ + NSArray *matchingSnapshots; + matchingSnapshots = [self.testedView fb_descendantsMatchingClassChain:@"XCUIElementTypeButton[-1]" shouldReturnAfterFirstMatch:YES]; + + XCTAssertEqual(matchingSnapshots.count, 1); + XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); + XCTAssertTrue([matchingSnapshots.lastObject.label isEqualToString:@"Scrolling"]); + + matchingSnapshots = [self.testedView fb_descendantsMatchingClassChain:@"XCUIElementTypeButton[-10]" shouldReturnAfterFirstMatch:YES]; + XCTAssertEqual(matchingSnapshots.count, 0); +} + +- (void)testInvalidQueryWithClassChain +{ + XCTAssertThrowsSpecificNamed([self.testedView fb_descendantsMatchingClassChain:@"XCUIElementTypeBlabla" shouldReturnAfterFirstMatch:YES], NSException, FBClassChainQueryParseException); +} + +- (void)testClassChainWithInvalidPredicate +{ + XCTAssertThrowsSpecificNamed([self.testedApplication fb_descendantsMatchingClassChain:@"XCUIElementTypeWindow[`bla != 'bla'`]" shouldReturnAfterFirstMatch:NO], + NSException, FBUnknownAttributeException);; +} + +@end + +@interface TVXCUIElementFBFindTests_ScrollPage : FBTVIntegrationTestCase +@end +@implementation TVXCUIElementFBFindTests_ScrollPage + +- (void)setUp +{ + [super setUp]; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + [self launchApplication]; + [self goToScrollPageWithCells:YES]; + }); +} + +- (void)testInvisibleDescendantWithXPathQuery +{ + NSArray *matchingSnapshots = [self.testedApplication fb_descendantsMatchingXPathQuery:@"//XCUIElementTypeStaticText[@visible='false']" shouldReturnAfterFirstMatch:NO]; + XCTAssertGreaterThan(matchingSnapshots.count, 1); + XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeStaticText); + XCTAssertFalse(matchingSnapshots.lastObject.fb_isVisible); +} + +- (void)testNestedQueryWithClassChain +{ + XCUIElement *table = self.testedApplication.tables.firstMatch; + NSArray *matches = [table fb_descendantsMatchingClassChain:@"XCUIElementTypeCell" shouldReturnAfterFirstMatch:NO]; + XCTAssertEqual(matches.count, 100); + XCTAssertEqual([matches firstObject].elementType, XCUIElementTypeCell); +} + +@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementHelperIntegrationTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementHelperIntegrationTests.m new file mode 100644 index 000000000..b2fcfb28f --- /dev/null +++ b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementHelperIntegrationTests.m @@ -0,0 +1,76 @@ +/** + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import +#import "XCTest/XCUIElementTypes.h" + +#import "FBTVIntegrationTestCase.h" +#import "FBTestMacros.h" +#import "FBElement.h" +#import "FBElementUtils.h" +#import "XCUIElement+FBUtilities.h" + +@interface TVXCUIElementHelperIntegrationTests : FBTVIntegrationTestCase +@end + +@implementation TVXCUIElementHelperIntegrationTests + +- (void)setUp +{ + [super setUp]; + [self launchApplication]; + [self goToAlertsPage]; +} + +- (void)testObstructionByAlert +{ + XCUIElement *showAlertButton = self.testedApplication.buttons[FBShowAlertButtonName]; + XCTAssertTrue(showAlertButton.exists); + XCTAssertFalse(showAlertButton.fb_isObstructedByAlert); + [self select:showAlertButton]; + FBAssertWaitTillBecomesTrue(self.testedApplication.alerts.count > 0); + XCTAssertTrue(showAlertButton.fb_isObstructedByAlert); +} + +- (void)testElementObstruction +{ + XCUIElement *showAlertButton = self.testedApplication.buttons[FBShowAlertButtonName]; + XCTAssertTrue(showAlertButton.exists); + [self select:showAlertButton]; + FBAssertWaitTillBecomesTrue(self.testedApplication.alerts.count > 0); + + XCUIElement *alert = self.testedApplication.alerts.element; + XCUIElement *acceptAlertButton = self.testedApplication.buttons[@"Will do"]; + XCTAssertTrue(alert.exists); + XCTAssertTrue(acceptAlertButton.exists); + + XCTAssertTrue([alert fb_obstructsElement:showAlertButton]); + XCTAssertFalse([alert fb_obstructsElement:acceptAlertButton]); +} + +- (void)testDescendantsFiltering +{ + NSArray *buttons = [self.testedApplication.buttons allElementsBoundByIndex]; + XCTAssertTrue(buttons.count > 0); + NSArray *windows = [self.testedApplication.windows allElementsBoundByIndex]; + XCTAssertTrue(windows.count > 0); + + NSMutableArray *allElements = [NSMutableArray array]; + [allElements addObjectsFromArray:buttons]; + [allElements addObjectsFromArray:windows]; + + NSMutableArray *buttonSnapshots = [NSMutableArray array]; + [buttonSnapshots addObject:[buttons.firstObject fb_lastSnapshot]]; + + NSArray *result = [self.testedApplication fb_filterDescendantsWithSnapshots:buttonSnapshots]; + XCTAssertEqual(1, result.count); + XCTAssertEqual([result.firstObject elementType], XCUIElementTypeButton); +} + +@end From 55cea027eab8ff962e9cc19caa099bc3c63d2815 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Tue, 19 Mar 2019 20:45:27 +0900 Subject: [PATCH 02/16] remove tvOS tests since currently they does not work --- WebDriverAgent.xcodeproj/project.pbxproj | 102 ---- .../IntegrationApp_tvOS/Classes/AppDelegate.h | 15 - .../IntegrationApp_tvOS/Classes/AppDelegate.m | 16 - .../Classes/FBAlertsViewController.h | 17 - .../Classes/FBAlertsViewController.m | 66 --- .../Classes/FBAttributesViewController.h | 18 - .../Classes/FBAttributesViewController.m | 23 - .../IntegrationApp_tvOS/Info.plist | 42 -- .../Resources/Base.lproj/Main.storyboard | 512 ------------------ .../Resources/Templates.storyboard | 376 ------------- .../Resources/Templates~.storyboard | 394 -------------- .../IntegrationApp_tvOS/main.m | 17 - .../IntegrationTests_tvOS/FBTVAlertTests.m | 161 ------ .../FBTVElementAttributeTests.m | 143 ----- .../FBTVElementScreenshotTests.m | 46 -- .../FBTVElementSelectTests.m | 118 ---- .../FBTVElementVisibilityTests.m | 48 -- .../FBTVFailureProofTestCaseTests.m | 45 -- .../FBTVIntegrationTestCase.h | 65 --- .../FBTVIntegrationTestCase.m | 103 ---- .../IntegrationTests_tvOS/FBTVKeyboardTests.m | 46 -- .../IntegrationTests_tvOS/FBTVTypingTest.m | 60 -- .../FBTVXPathIntegrationTests.m | 68 --- .../IntegrationTests_tvOS/Info.plist | 22 - .../TVXCElementSnapshotHelperTests.m | 206 ------- .../TVXCElementSnapshotHitPoint.m | 32 -- .../TVXCUIApplicationHelperTests.m | 80 --- .../TVXCUIDeviceHealthCheckTests.m | 28 - .../TVXCUIDeviceHelperTests.m | 56 -- .../TVXCUIElementAttributesTests.m | 126 ----- .../TVXCUIElementFBFindTests.m | 336 ------------ .../TVXCUIElementHelperIntegrationTests.m | 76 --- 32 files changed, 3463 deletions(-) delete mode 100644 WebDriverAgentTests/IntegrationApp_tvOS/Classes/AppDelegate.h delete mode 100644 WebDriverAgentTests/IntegrationApp_tvOS/Classes/AppDelegate.m delete mode 100644 WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAlertsViewController.h delete mode 100644 WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAlertsViewController.m delete mode 100644 WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAttributesViewController.h delete mode 100644 WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAttributesViewController.m delete mode 100644 WebDriverAgentTests/IntegrationApp_tvOS/Info.plist delete mode 100644 WebDriverAgentTests/IntegrationApp_tvOS/Resources/Base.lproj/Main.storyboard delete mode 100644 WebDriverAgentTests/IntegrationApp_tvOS/Resources/Templates.storyboard delete mode 100644 WebDriverAgentTests/IntegrationApp_tvOS/Resources/Templates~.storyboard delete mode 100644 WebDriverAgentTests/IntegrationApp_tvOS/main.m delete mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/FBTVAlertTests.m delete mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementAttributeTests.m delete mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementScreenshotTests.m delete mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementSelectTests.m delete mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementVisibilityTests.m delete mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/FBTVFailureProofTestCaseTests.m delete mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/FBTVIntegrationTestCase.h delete mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/FBTVIntegrationTestCase.m delete mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/FBTVKeyboardTests.m delete mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/FBTVTypingTest.m delete mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/FBTVXPathIntegrationTests.m delete mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/Info.plist delete mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/TVXCElementSnapshotHelperTests.m delete mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/TVXCElementSnapshotHitPoint.m delete mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIApplicationHelperTests.m delete mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIDeviceHealthCheckTests.m delete mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIDeviceHelperTests.m delete mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementAttributesTests.m delete mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementFBFindTests.m delete mode 100644 WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementHelperIntegrationTests.m diff --git a/WebDriverAgent.xcodeproj/project.pbxproj b/WebDriverAgent.xcodeproj/project.pbxproj index 76c6917d6..0b0e89c35 100644 --- a/WebDriverAgent.xcodeproj/project.pbxproj +++ b/WebDriverAgent.xcodeproj/project.pbxproj @@ -803,37 +803,6 @@ 641EE2CF2240BB6700173FCB /* libAccessibility.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libAccessibility.tbd; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk/usr/lib/libAccessibility.tbd; sourceTree = DEVELOPER_DIR; }; 641EE2D12240BB7D00173FCB /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/AppleTVOS.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 641EE2DA2240BBE300173FCB /* WebDriverAgentRunner_tvOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WebDriverAgentRunner_tvOS.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 641EE2E72240BE7300173FCB /* FBAttributesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBAttributesViewController.h; sourceTree = ""; }; - 641EE2E82240BE7300173FCB /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 641EE2E92240BE7300173FCB /* FBAlertsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBAlertsViewController.m; sourceTree = ""; }; - 641EE2EA2240BE7300173FCB /* FBAttributesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBAttributesViewController.m; sourceTree = ""; }; - 641EE2EB2240BE7300173FCB /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 641EE2EC2240BE7300173FCB /* FBAlertsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBAlertsViewController.h; sourceTree = ""; }; - 641EE2EF2240BE7300173FCB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 641EE2F02240BE7300173FCB /* Templates~.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = "Templates~.storyboard"; sourceTree = ""; }; - 641EE2F12240BE7300173FCB /* Templates.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Templates.storyboard; sourceTree = ""; }; - 641EE2F22240BE7300173FCB /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 641EE2F32240BE7300173FCB /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 641EE3082240BE8200173FCB /* FBTVAlertTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBTVAlertTests.m; sourceTree = ""; }; - 641EE3092240BE8200173FCB /* TVXCUIDeviceHealthCheckTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TVXCUIDeviceHealthCheckTests.m; sourceTree = ""; }; - 641EE30A2240BE8200173FCB /* TVXCElementSnapshotHelperTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TVXCElementSnapshotHelperTests.m; sourceTree = ""; }; - 641EE30B2240BE8200173FCB /* FBTVIntegrationTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBTVIntegrationTestCase.m; sourceTree = ""; }; - 641EE30C2240BE8200173FCB /* FBTVElementSelectTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBTVElementSelectTests.m; sourceTree = ""; }; - 641EE30D2240BE8200173FCB /* TVXCUIDeviceHelperTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TVXCUIDeviceHelperTests.m; sourceTree = ""; }; - 641EE30E2240BE8200173FCB /* FBTVElementScreenshotTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBTVElementScreenshotTests.m; sourceTree = ""; }; - 641EE30F2240BE8200173FCB /* FBTVKeyboardTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBTVKeyboardTests.m; sourceTree = ""; }; - 641EE3102240BE8200173FCB /* TVXCUIElementFBFindTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TVXCUIElementFBFindTests.m; sourceTree = ""; }; - 641EE3112240BE8200173FCB /* FBTVFailureProofTestCaseTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBTVFailureProofTestCaseTests.m; sourceTree = ""; }; - 641EE3122240BE8200173FCB /* TVXCUIElementAttributesTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TVXCUIElementAttributesTests.m; sourceTree = ""; }; - 641EE3132240BE8200173FCB /* FBTVTypingTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBTVTypingTest.m; sourceTree = ""; }; - 641EE3142240BE8200173FCB /* FBTVXPathIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBTVXPathIntegrationTests.m; sourceTree = ""; }; - 641EE3152240BE8200173FCB /* TVXCElementSnapshotHitPoint.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TVXCElementSnapshotHitPoint.m; sourceTree = ""; }; - 641EE3162240BE8200173FCB /* FBTVElementVisibilityTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBTVElementVisibilityTests.m; sourceTree = ""; }; - 641EE3172240BE8200173FCB /* TVXCUIApplicationHelperTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TVXCUIApplicationHelperTests.m; sourceTree = ""; }; - 641EE3182240BE8200173FCB /* FBTVElementAttributeTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBTVElementAttributeTests.m; sourceTree = ""; }; - 641EE3192240BE8200173FCB /* TVXCUIElementHelperIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TVXCUIElementHelperIntegrationTests.m; sourceTree = ""; }; - 641EE31A2240BE8200173FCB /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 641EE31B2240BE8200173FCB /* FBTVIntegrationTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBTVIntegrationTestCase.h; sourceTree = ""; }; 641EE6F82240C5CA00173FCB /* WebDriverAgentLib_tvOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WebDriverAgentLib_tvOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 641EE6F92240C5CB00173FCB /* WebDriverAgentLib copy-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "WebDriverAgentLib copy-Info.plist"; path = "/Users/kazu/GitHub/WebDriverAgent/WebDriverAgentLib copy-Info.plist"; sourceTree = ""; }; 641EE6FE2240CD4900173FCB /* XCUIApplication+FBFocused.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "XCUIApplication+FBFocused.h"; sourceTree = ""; }; @@ -1310,67 +1279,6 @@ path = Resources; sourceTree = ""; }; - 641EE2E52240BE7300173FCB /* IntegrationApp_tvOS */ = { - isa = PBXGroup; - children = ( - 641EE2E62240BE7300173FCB /* Classes */, - 641EE2ED2240BE7300173FCB /* Resources */, - 641EE2F22240BE7300173FCB /* main.m */, - 641EE2F32240BE7300173FCB /* Info.plist */, - ); - path = IntegrationApp_tvOS; - sourceTree = ""; - }; - 641EE2E62240BE7300173FCB /* Classes */ = { - isa = PBXGroup; - children = ( - 641EE2E72240BE7300173FCB /* FBAttributesViewController.h */, - 641EE2E82240BE7300173FCB /* AppDelegate.h */, - 641EE2E92240BE7300173FCB /* FBAlertsViewController.m */, - 641EE2EA2240BE7300173FCB /* FBAttributesViewController.m */, - 641EE2EB2240BE7300173FCB /* AppDelegate.m */, - 641EE2EC2240BE7300173FCB /* FBAlertsViewController.h */, - ); - path = Classes; - sourceTree = ""; - }; - 641EE2ED2240BE7300173FCB /* Resources */ = { - isa = PBXGroup; - children = ( - 641EE2EE2240BE7300173FCB /* Main.storyboard */, - 641EE2F02240BE7300173FCB /* Templates~.storyboard */, - 641EE2F12240BE7300173FCB /* Templates.storyboard */, - ); - path = Resources; - sourceTree = ""; - }; - 641EE3072240BE8200173FCB /* IntegrationTests_tvOS */ = { - isa = PBXGroup; - children = ( - 641EE3082240BE8200173FCB /* FBTVAlertTests.m */, - 641EE3092240BE8200173FCB /* TVXCUIDeviceHealthCheckTests.m */, - 641EE30A2240BE8200173FCB /* TVXCElementSnapshotHelperTests.m */, - 641EE30B2240BE8200173FCB /* FBTVIntegrationTestCase.m */, - 641EE30C2240BE8200173FCB /* FBTVElementSelectTests.m */, - 641EE30D2240BE8200173FCB /* TVXCUIDeviceHelperTests.m */, - 641EE30E2240BE8200173FCB /* FBTVElementScreenshotTests.m */, - 641EE30F2240BE8200173FCB /* FBTVKeyboardTests.m */, - 641EE3102240BE8200173FCB /* TVXCUIElementFBFindTests.m */, - 641EE3112240BE8200173FCB /* FBTVFailureProofTestCaseTests.m */, - 641EE3122240BE8200173FCB /* TVXCUIElementAttributesTests.m */, - 641EE3132240BE8200173FCB /* FBTVTypingTest.m */, - 641EE3142240BE8200173FCB /* FBTVXPathIntegrationTests.m */, - 641EE3152240BE8200173FCB /* TVXCElementSnapshotHitPoint.m */, - 641EE3162240BE8200173FCB /* FBTVElementVisibilityTests.m */, - 641EE3172240BE8200173FCB /* TVXCUIApplicationHelperTests.m */, - 641EE3182240BE8200173FCB /* FBTVElementAttributeTests.m */, - 641EE3192240BE8200173FCB /* TVXCUIElementHelperIntegrationTests.m */, - 641EE31A2240BE8200173FCB /* Info.plist */, - 641EE31B2240BE8200173FCB /* FBTVIntegrationTestCase.h */, - ); - path = IntegrationTests_tvOS; - sourceTree = ""; - }; 91F9DAE01B99DBC2001349B2 = { isa = PBXGroup; children = ( @@ -1674,8 +1582,6 @@ EE9B75F91CF7964100275851 /* WebDriverAgentTests */ = { isa = PBXGroup; children = ( - 641EE3072240BE8200173FCB /* IntegrationTests_tvOS */, - 641EE2E52240BE7300173FCB /* IntegrationApp_tvOS */, EE9B76801CF7997600275851 /* IntegrationApp */, EE9B76541CF7987300275851 /* IntegrationTests */, EE9B76561CF7987300275851 /* UnitTests */, @@ -2994,14 +2900,6 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ - 641EE2EE2240BE7300173FCB /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 641EE2EF2240BE7300173FCB /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; EE9B768C1CF7997600275851 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( diff --git a/WebDriverAgentTests/IntegrationApp_tvOS/Classes/AppDelegate.h b/WebDriverAgentTests/IntegrationApp_tvOS/Classes/AppDelegate.h deleted file mode 100644 index bf20b2f35..000000000 --- a/WebDriverAgentTests/IntegrationApp_tvOS/Classes/AppDelegate.h +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -@interface AppDelegate : UIResponder -@property (strong, nonatomic) UIWindow *window; -@end - diff --git a/WebDriverAgentTests/IntegrationApp_tvOS/Classes/AppDelegate.m b/WebDriverAgentTests/IntegrationApp_tvOS/Classes/AppDelegate.m deleted file mode 100644 index 2082d38d4..000000000 --- a/WebDriverAgentTests/IntegrationApp_tvOS/Classes/AppDelegate.m +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "AppDelegate.h" - -@interface AppDelegate () -@end - -@implementation AppDelegate -@end diff --git a/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAlertsViewController.h b/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAlertsViewController.h deleted file mode 100644 index a6ce3f25a..000000000 --- a/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAlertsViewController.h +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface FBAlertsViewController : UIViewController - -@end - -NS_ASSUME_NONNULL_END diff --git a/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAlertsViewController.m b/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAlertsViewController.m deleted file mode 100644 index f7cc19599..000000000 --- a/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAlertsViewController.m +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "FBAlertsViewController.h" -#import -#import - -@interface FBAlertsViewController () -@property (nonatomic, strong) CLLocationManager *locationManager; -@end - -@implementation FBAlertsViewController - -- (IBAction)createAppAlert:(UIButton *)sender -{ - [self presentAlertController]; -} - -- (IBAction)createAppSheet:(UIButton *)sender -{ - UIAlertController *alerController = - [UIAlertController alertControllerWithTitle:@"Magic Sheet" - message:@"Should read" - preferredStyle:UIAlertControllerStyleActionSheet]; - [self presentViewController:alerController animated:YES completion:nil]; - -} - -- (IBAction)createCameraRollAccessAlert:(UIButton *)sender -{ - [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) { - }]; -} - -- (IBAction)createGPSAccessAlert:(UIButton *)sender -{ - self.locationManager = [CLLocationManager new]; - [self.locationManager requestWhenInUseAuthorization]; -} - -- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event -{ - [super touchesMoved:touches withEvent:event]; - for (UITouch *touch in touches) { - if (fabs(touch.maximumPossibleForce - touch.force) < 0.0001) { - [self presentAlertController]; - } - } -} - -- (void)presentAlertController { - UIAlertController *alerController = - [UIAlertController alertControllerWithTitle:@"Magic" - message:@"Should read" - preferredStyle:UIAlertControllerStyleAlert]; - [alerController addAction:[UIAlertAction actionWithTitle:@"Will do" style:UIAlertActionStyleDefault handler:nil]]; - [self presentViewController:alerController animated:YES completion:nil]; -} - -@end diff --git a/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAttributesViewController.h b/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAttributesViewController.h deleted file mode 100644 index c7100fc3d..000000000 --- a/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAttributesViewController.h +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface FBAttributesViewController : UIViewController - -@end - -NS_ASSUME_NONNULL_END diff --git a/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAttributesViewController.m b/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAttributesViewController.m deleted file mode 100644 index 82acae842..000000000 --- a/WebDriverAgentTests/IntegrationApp_tvOS/Classes/FBAttributesViewController.m +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "FBAttributesViewController.h" - -@interface FBAttributesViewController () - -@end - -@implementation FBAttributesViewController - -- (IBAction)didSelectButton:(UIButton *)button -{ - button.selected = !button.selected; -} - -@end diff --git a/WebDriverAgentTests/IntegrationApp_tvOS/Info.plist b/WebDriverAgentTests/IntegrationApp_tvOS/Info.plist deleted file mode 100644 index 67be95910..000000000 --- a/WebDriverAgentTests/IntegrationApp_tvOS/Info.plist +++ /dev/null @@ -1,42 +0,0 @@ - - - - - NSLocationAlwaysAndWhenInUseUsageDescription - Yo Yo - NSPhotoLibraryUsageDescription - Yo Yo - NSLocationWhenInUseUsageDescription - Yo Yo - NSLocationUsageDescription - Yo Yo - NSLocationAlwaysUsageDescription - Yo Yo - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - arm64 - - UIUserInterfaceStyle - Automatic - - diff --git a/WebDriverAgentTests/IntegrationApp_tvOS/Resources/Base.lproj/Main.storyboard b/WebDriverAgentTests/IntegrationApp_tvOS/Resources/Base.lproj/Main.storyboard deleted file mode 100644 index 07e15fac8..000000000 --- a/WebDriverAgentTests/IntegrationApp_tvOS/Resources/Base.lproj/Main.storyboard +++ /dev/null @@ -1,512 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/WebDriverAgentTests/IntegrationApp_tvOS/Resources/Templates.storyboard b/WebDriverAgentTests/IntegrationApp_tvOS/Resources/Templates.storyboard deleted file mode 100644 index 8679b9edf..000000000 --- a/WebDriverAgentTests/IntegrationApp_tvOS/Resources/Templates.storyboard +++ /dev/null @@ -1,376 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/WebDriverAgentTests/IntegrationApp_tvOS/Resources/Templates~.storyboard b/WebDriverAgentTests/IntegrationApp_tvOS/Resources/Templates~.storyboard deleted file mode 100644 index 74058b605..000000000 --- a/WebDriverAgentTests/IntegrationApp_tvOS/Resources/Templates~.storyboard +++ /dev/null @@ -1,394 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/WebDriverAgentTests/IntegrationApp_tvOS/main.m b/WebDriverAgentTests/IntegrationApp_tvOS/main.m deleted file mode 100644 index 2b841fd81..000000000 --- a/WebDriverAgentTests/IntegrationApp_tvOS/main.m +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVAlertTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVAlertTests.m deleted file mode 100644 index 8e6e5d7f3..000000000 --- a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVAlertTests.m +++ /dev/null @@ -1,161 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import - -#import "FBTVIntegrationTestCase.h" -#import "FBTestMacros.h" - -@interface FBTVAlertTests : FBTVIntegrationTestCase -@end - -@implementation FBTVAlertTests - -- (void)setUp -{ - [super setUp]; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - [self launchApplication]; - [self goToAlertsPage]; - }); -} - -- (void)tearDown -{ - [super tearDown]; - [[FBAlert alertWithApplication:self.testedApplication] dismissWithError:nil]; -} - -- (void)showApplicationAlert -{ - [self select: self.testedApplication.buttons[FBShowAlertButtonName]]; - XCUIElementQuery* query = self.testedApplication.alerts; - FBAssertWaitTillBecomesTrue(query.count != 0); -} - -- (void)showApplicationSheet -{ - [self select: self.testedApplication.buttons[FBShowSheetAlertButtonName]]; - FBAssertWaitTillBecomesTrue(self.testedApplication.sheets.count != 0); -} - -- (void)testAlertException -{ - XCTAssertThrowsSpecificNamed([FBAlert throwRequestedItemObstructedByAlertException], NSException, FBAlertObstructingElementException); -} - -- (void)testAlertPresence -{ - FBAlert *alert = [FBAlert alertWithApplication:self.testedApplication]; - XCTAssertFalse(alert.isPresent); - [self showApplicationAlert]; - XCTAssertTrue(alert.isPresent); -} - -- (void)testAlertText -{ - FBAlert *alert = [FBAlert alertWithApplication:self.testedApplication]; - XCTAssertNil(alert.text); - [self showApplicationAlert]; - XCTAssertTrue([alert.text containsString:@"Magic"]); - XCTAssertTrue([alert.text containsString:@"Should read"]); -} - -- (void)testAlertLabels -{ - FBAlert* alert = [FBAlert alertWithApplication:self.testedApplication]; - XCTAssertNil(alert.buttonLabels); - [self showApplicationAlert]; - XCTAssertNotNil(alert.buttonLabels); - XCTAssertEqual(1, alert.buttonLabels.count); - XCTAssertEqualObjects(@"Will do", alert.buttonLabels[0]); -} - -- (void)testSelectAlertButton -{ - FBAlert* alert = [FBAlert alertWithApplication:self.testedApplication]; - XCTAssertFalse([alert clickAlertButton:@"Invalid" error:nil]); - [self showApplicationAlert]; - XCTAssertFalse([alert clickAlertButton:@"Invalid" error:nil]); - XCTAssertTrue([alert clickAlertButton:@"Will do" error:nil]); -} - -- (void)testAcceptingAlert -{ - NSError *error; - [self showApplicationAlert]; - XCTAssertTrue([[FBAlert alertWithApplication:self.testedApplication] acceptWithError:&error]); - FBAssertWaitTillBecomesTrue(self.testedApplication.alerts.count == 0); - XCTAssertNil(error); -} - -- (void)testDismissingAlert -{ - NSError *error; - [self showApplicationAlert]; - XCTAssertTrue([[FBAlert alertWithApplication:self.testedApplication] dismissWithError:&error]); - FBAssertWaitTillBecomesTrue(self.testedApplication.alerts.count == 0); - XCTAssertNil(error); -} - -- (void)testAlertElement -{ - [self showApplicationAlert]; - XCUIElement *alertElement = [FBAlert alertWithApplication:self.testedApplication].alertElement; - XCTAssertTrue(alertElement.exists); - XCTAssertTrue(alertElement.elementType == XCUIElementTypeAlert); -} - -- (void)testFilteringObstructedElements -{ - FBAlert *alert = [FBAlert alertWithApplication:self.testedApplication]; - XCUIElement *showAlertButton = self.testedApplication.buttons[FBShowAlertButtonName]; - XCUIElement *acceptAlertButton = self.testedApplication.buttons[@"Will do"]; - [self showApplicationAlert]; - - NSArray *filteredElements = [alert filterObstructedElements:@[showAlertButton, acceptAlertButton]]; - XCTAssertEqualObjects(filteredElements, @[acceptAlertButton]); -} - -- (void)testCameraRollAlert -{ - FBAlert *alert = [FBAlert alertWithApplication:self.testedApplication]; - XCTAssertNil(alert.text); - [self select: self.testedApplication.buttons[@"Create Photo Lib access Alert"]]; - FBAssertWaitTillBecomesTrue(alert.isPresent); - - XCTAssertTrue([alert.text containsString:@"Would Like to Access Your Photos"]); -} - -- (void)testGPSAccessAlert -{ - FBAlert *alert = [FBAlert alertWithApplication:self.testedApplication]; - XCTAssertNil(alert.text); - - [self select: self.testedApplication.buttons[@"Create GPS access Alert"]]; - FBAssertWaitTillBecomesTrue(alert.isPresent); - - XCTAssertTrue([alert.text containsString:@"to access your location"]); - XCTAssertTrue([alert.text containsString:@"Yo Yo"]); -} - -- (void)testSheetAlert -{ - FBAlert *alert = [FBAlert alertWithApplication:self.testedApplication]; - BOOL isIpad = [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad; - [self showApplicationSheet]; - XCUIElement *showSheetButton = self.testedApplication.buttons[FBShowSheetAlertButtonName]; - XCTAssertThrowsSpecificNamed([alert filterObstructedElements:@[showSheetButton]], NSException, FBAlertObstructingElementException, @"should throw FBAlertObstructingElementException"); - -} - -@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementAttributeTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementAttributeTests.m deleted file mode 100644 index f482231ae..000000000 --- a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementAttributeTests.m +++ /dev/null @@ -1,143 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import "FBTVIntegrationTestCase.h" -#import "FBFindElementCommands.h" -#import "XCUIElement+FBAccessibility.h" -#import "XCUIElement+FBIsVisible.h" -#import "XCUIElement+FBWebDriverAttributes.h" - -@interface FBTVElementAttributeTests : FBTVIntegrationTestCase -@end - -@implementation FBTVElementAttributeTests - -- (void)setUp -{ - [super setUp]; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - [self launchApplication]; - [self goToAttributesPage]; - }); -} - -- (void)testElementAccessibilityAttributes -{ - // "Select me" is accessibility element, and therefore isn't accessibility container - XCUIElement *buttonElement = self.testedApplication.buttons[@"Select me"]; - XCTAssertTrue(buttonElement.exists); - XCTAssertTrue(buttonElement.fb_isAccessibilityElement); - XCTAssertFalse(buttonElement.isWDAccessibilityContainer); -} - -- (void)testContainerAccessibilityAttributes -{ - // "Not accessible" isn't accessibility element, but contains accessibility elements, so it is accessibility container - XCUIElement *inaccessibleButtonElement = self.testedApplication.buttons[@"Not accessible"]; - XCTAssertTrue(inaccessibleButtonElement.exists); - XCTAssertFalse(inaccessibleButtonElement.fb_isAccessibilityElement); - XCTAssertTrue(inaccessibleButtonElement.isWDAccessibilityContainer); -} - -- (void)testIgnoredAccessibilityAttributes -{ - // Images are neither accessibility elements nor contain them, so both checks should fail - XCUIElement *imageElement = [self.testedApplication.images elementBoundByIndex:0]; - XCTAssertTrue(imageElement.exists); - XCTAssertFalse(imageElement.fb_isAccessibilityElement); - XCTAssertFalse(imageElement.isWDAccessibilityContainer); -} - -- (void)testButtonAttributes -{ - XCUIElement *element = self.testedApplication.buttons[@"Select me"]; - XCTAssertTrue(element.exists); - XCTAssertEqualObjects(element.wdType, @"XCUIElementTypeButton"); - XCTAssertEqualObjects(element.wdName, @"Select me"); - XCTAssertEqualObjects(element.wdLabel, @"Select me"); - XCTAssertNil(element.wdValue); - [self select:element]; - [element resolve]; - XCTAssertEqual(element.wdValue.boolValue, YES); -} - -- (void)testLabelAttributes -{ - XCUIElement *element = self.testedApplication.staticTexts[@"Text Field"]; - XCTAssertTrue(element.exists); - XCTAssertEqualObjects(element.wdType, @"XCUIElementTypeStaticText"); - XCTAssertEqualObjects(element.wdName, @"Text Field"); - XCTAssertEqualObjects(element.wdLabel, @"Text Field"); - XCTAssertEqualObjects(element.wdValue, @"Text Field"); -} - -- (void)testTextFieldAttributes -{ - XCUIElement *element = self.testedApplication.textFields[@"Value"]; - XCTAssertTrue(element.exists); - XCTAssertEqualObjects(element.wdType, @"XCUIElementTypeTextField"); - XCTAssertNil(element.wdName); - XCTAssertEqualObjects(element.wdLabel, @""); - XCTAssertEqualObjects(element.wdValue, @"Value"); -} - -- (void)testTextFieldWithAccessibilityIdentifiersAttributes -{ - XCUIElement *element = self.testedApplication.textFields[@"aIdentifier"]; - XCTAssertTrue(element.exists); - XCTAssertEqualObjects(element.wdType, @"XCUIElementTypeTextField"); - XCTAssertEqualObjects(element.wdName, @"aIdentifier"); - XCTAssertEqualObjects(element.wdLabel, @"aLabel"); - XCTAssertEqualObjects(element.wdValue, @"Value2"); -} - -- (void)testSegmentedControlAttributes -{ - XCUIElement *element = self.testedApplication.segmentedControls.element; - XCTAssertTrue(element.exists); - XCTAssertEqualObjects(element.wdType, @"XCUIElementTypeSegmentedControl"); - XCTAssertNil(element.wdName); - XCTAssertNil(element.wdLabel); - XCTAssertNil(element.wdValue); -} - -- (void)testActivityIndicatorAttributes -{ - XCUIElement *element = self.testedApplication.activityIndicators.element; - XCTAssertTrue(element.exists); - XCTAssertEqualObjects(element.wdType, @"XCUIElementTypeActivityIndicator"); - XCTAssertEqualObjects(element.wdName, @"Progress halted"); - XCTAssertEqualObjects(element.wdLabel, @"Progress halted"); - XCTAssertEqualObjects(element.wdValue, @"0"); -} - -- (void)testPageIndicatorAttributes -{ - XCUIElement *element = self.testedApplication.pageIndicators.element; - XCTAssertTrue(element.exists); - XCTAssertEqualObjects(element.wdType, @"XCUIElementTypePageIndicator"); - XCTAssertNil(element.wdName); - XCTAssertNil(element.wdLabel); - XCTAssertEqualObjects(element.wdValue, @"page 1 of 3"); -} - -- (void)testTextViewAttributes -{ - XCUIElement *element = self.testedApplication.textViews.element; - XCTAssertTrue(element.exists); - XCTAssertEqualObjects(element.wdType, @"XCUIElementTypeTextView"); - XCTAssertNil(element.wdName); - XCTAssertNil(element.wdLabel); - XCTAssertEqualObjects(element.wdValue, @"Text Field long text"); -} - -@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementScreenshotTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementScreenshotTests.m deleted file mode 100644 index 486c8c1ed..000000000 --- a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementScreenshotTests.m +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import "FBTVIntegrationTestCase.h" -#import "XCUIDevice+FBRotation.h" -#import "XCUIElement+FBUtilities.h" - -@interface FBTVElementScreenshotTests : FBTVIntegrationTestCase -@end - -@implementation FBTVElementScreenshotTests - -- (void)setUp -{ - [super setUp]; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - [self launchApplication]; - [self goToAlertsPage]; - }); -} - -- (void)testElementScreenshot -{ - XCUIElement *button = self.testedApplication.buttons[FBShowAlertButtonName]; - NSError *error = nil; - NSData *screenshotData = [button fb_screenshotWithError:&error]; - if (nil == screenshotData && [error.description containsString:@"available since Xcode9"]) { - return; - } - XCTAssertNotNil(screenshotData); - XCTAssertNil(error); - UIImage *image = [UIImage imageWithData:screenshotData]; - XCTAssertNotNil(image); - XCTAssertTrue(image.size.width > image.size.height); -} - -@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementSelectTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementSelectTests.m deleted file mode 100644 index 10e69dc47..000000000 --- a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementSelectTests.m +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import - -#import "FBTVIntegrationTestCase.h" -#import "FBTestMacros.h" -#import "XCUIElement+FBTVFocuse.h" - -@interface FBTVElementSelectTests : FBTVIntegrationTestCase -@end - -@implementation FBTVElementSelectTests - -- (void)setUp -{ - [super setUp]; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - [self launchApplication]; - [self goToNavigationPage]; - }); -} - -- (void)showHorizontalLayout -{ - XCUIElement *category = self.testedApplication.cells[@"horizontal_layout"]; - NSError *error; - XCTAssertTrue([category fb_selectWithError: &error]); - XCTAssertNil(error); - XCUIElement * right = self.testedApplication.buttons[@"right"]; - XCUIElement * topLeft = self.testedApplication.buttons[@"top left"]; - FBAssertWaitTillBecomesTrue(right.exists && !topLeft.exists); -} - -- (void)showGridLayout -{ - XCUIElement *category = self.testedApplication.cells[@"grid_layout"]; - NSError *error; - XCTAssertTrue([category fb_selectWithError: &error]); - XCTAssertNil(error); - FBAssertWaitTillBecomesTrue(self.testedApplication.buttons[@"top left"].exists); -} - -- (void)showCustomLayout -{ - XCUIElement *category = self.testedApplication.cells[@"custom_layout"]; - NSError *error; - XCTAssertTrue([category fb_selectWithError: &error]); - XCTAssertNil(error); - XCUIElement * topRight = self.testedApplication.buttons[@"top right"]; - XCUIElement * topLeft = self.testedApplication.buttons[@"top left"]; - FBAssertWaitTillBecomesTrue(topRight.exists && !topLeft.exists); -} - -- (void)testVerticalNavigation -{ - XCUIElement *lastElement = self.testedApplication.cells[@"custom_layout"]; - NSError *error; - XCTAssertTrue([lastElement fb_focuseWithError: &error]); - XCTAssertNil(error); - XCTAssertTrue(lastElement.hasFocus); -} - -- (void)testErrorNavigation -{ - XCUIElement *disabledElement = self.testedApplication.cells[@"disabled_layout"]; - NSError *error; - XCTAssertFalse([disabledElement fb_focuseWithError: &error]); - XCTAssertNotNil(error); - XCTAssertFalse(disabledElement.hasFocus); -} - -- (void)testHorizontalNavigation -{ - [self showHorizontalLayout]; - XCUIElement *rightElement = self.testedApplication.buttons[@"right"]; - NSError *error; - XCTAssertTrue([rightElement fb_focuseWithError: &error]); - XCTAssertNil(error); - XCTAssertTrue(rightElement.hasFocus); -} - -- (void)testGridNavigation -{ - [self showGridLayout]; - XCUIElement *rightElement = self.testedApplication.buttons[@"bottom right"]; - NSError *firstNavError; - XCTAssertTrue([rightElement fb_focuseWithError: &firstNavError]); - XCTAssertNil(firstNavError); - XCTAssertTrue(rightElement.hasFocus); - - XCUIElement *leftElement = self.testedApplication.cells[@"grid_layout"]; - NSError *secondNavError; - XCTAssertTrue([leftElement fb_focuseWithError: &secondNavError]); - XCTAssertNil(secondNavError); - XCTAssertTrue(leftElement.hasFocus); -} - -- (void)testCustomNavigation -{ - [self showCustomLayout]; - XCUIElement *rightElement = self.testedApplication.buttons[@"bottom right"]; - NSError *error; - XCTAssertTrue([rightElement fb_focuseWithError: &error]); - XCTAssertNil(error); - XCTAssertTrue(rightElement.hasFocus); -} - -@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementVisibilityTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementVisibilityTests.m deleted file mode 100644 index c28edff44..000000000 --- a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVElementVisibilityTests.m +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import "FBApplication.h" -#import "FBTVIntegrationTestCase.h" -#import "FBHomeboardApplication.h" -#import "FBTestMacros.h" -#import "FBXCodeCompatibility.h" -#import "XCUIElement+FBIsVisible.h" - -@interface FBTVElementVisibilityTests : FBTVIntegrationTestCase -@end - -@implementation FBTVElementVisibilityTests - -- (void)testHeadBoardIcons -{ - [self launchApplication]; - [self goToHeadBoardPage]; - - XCTAssertTrue(self.homeboard.icons[@"IntegrationApp_tvOS"].fb_isVisible); - XCTAssertTrue(self.homeboard.icons[@"Settings"].fb_isVisible); -} - -- (void)testTableViewCells -{ - [self launchApplication]; - [self goToScrollPageWithCells:true]; - XCUIElement *table = self.testedApplication.tables.allElementsBoundByIndex.firstObject; - for (int i = 0 ; i < 10 ; i++) { - FBAssertWaitTillBecomesTrue(table.cells.allElementsBoundByIndex[i].fb_isVisible); - FBAssertWaitTillBecomesTrue(table.staticTexts.allElementsBoundByIndex[i].fb_isVisible); - } - for (int i = 30 ; i < 40 ; i++) { - FBAssertWaitTillBecomesTrue(!table.cells.allElementsBoundByIndex[i].fb_isVisible); - FBAssertWaitTillBecomesTrue(!table.staticTexts.allElementsBoundByIndex[i].fb_isVisible); - } -} - -@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVFailureProofTestCaseTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVFailureProofTestCaseTests.m deleted file mode 100644 index 192340c85..000000000 --- a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVFailureProofTestCaseTests.m +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import "FBFailureProofTestCase.h" -#import "FBExceptionHandler.h" -#import "XCUIElement+FBTVFocuse.h" - -@interface FBTVFailureProofTestCaseTests : FBFailureProofTestCase -@end - -@implementation FBTVFailureProofTestCaseTests - -- (void)setUp -{ - [super setUp]; - [[XCUIApplication new] launch]; -} - -- (void)testPreventElementSearchFailure -{ - - [[XCUIApplication new].buttons[@"kaboom"] typeText:@"kaboom"]; -} - -- (void)testInactiveAppSearch -{ - [[XCUIDevice sharedDevice] pressButton:XCUIDeviceButtonHome]; - [[XCUIApplication new].buttons[@"kaboom"] typeText:@"kaboom"]; -} - -- (void)testPreventAssertFailure -{ - XCTAssertNotNil(nil); -} - - -@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVIntegrationTestCase.h b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVIntegrationTestCase.h deleted file mode 100644 index 9d4cf38af..000000000 --- a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVIntegrationTestCase.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import "FBHomeboardApplication.h" - -NS_ASSUME_NONNULL_BEGIN - -extern NSString *const FBShowAlertButtonName; -extern NSString *const FBShowSheetAlertButtonName; -extern NSString *const FBShowAlertForceTouchButtonName; - -/** - XCTestCase helper class used for integration tests - */ -@interface FBTVIntegrationTestCase : XCTestCase -@property (nonatomic, strong, readonly) XCUIApplication *testedApplication; -@property (nonatomic, strong, readonly, getter = homeboard) FBHomeboardApplication *homeboard; - -/** - Launches application and resets side effects of testing like orientation etc. - */ -- (void)launchApplication; - -/** - Navigates integration app to attributes page - */ -- (void)goToAttributesPage; - -/** - Navigates integration app to alerts page - */ -- (void)goToAlertsPage; - -/** - Navigates integration app to navigation page - */ -- (void)goToNavigationPage; - -/** - Navigates to HeadBoard first page - */ -- (void)goToHeadBoardPage; - -/** - Select tv element in vertical row - */ -- (void)select:(XCUIElement*) element; - -/** - Navigates integration app to scrolling page - @param showCells whether should navigate to view with cell or plain scrollview - */ -- (void)goToScrollPageWithCells:(BOOL)showCells; - -@end - -NS_ASSUME_NONNULL_END diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVIntegrationTestCase.m b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVIntegrationTestCase.m deleted file mode 100644 index 211715628..000000000 --- a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVIntegrationTestCase.m +++ /dev/null @@ -1,103 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "FBTVIntegrationTestCase.h" - -#import "FBHomeboardApplication.h" -#import "FBTestMacros.h" -#import "FBConfiguration.h" -#import "FBMacros.h" -#import "FBRunLoopSpinner.h" -#import "XCUIDevice+FBRotation.h" -#import "XCUIElement.h" -#import "XCUIElement+FBIsVisible.h" -#import "XCUIApplication+FBFocused.h" -#import "XCUIElement+FBTVFocuse.h" -#import "XCUIElement+FBUtilities.h" - -NSString *const FBShowAlertButtonName = @"Create App Alert"; -NSString *const FBShowSheetAlertButtonName = @"Create Sheet Alert"; -NSString *const FBShowAlertForceTouchButtonName = @"Create Alert (Force Touch)"; - -@interface FBTVIntegrationTestCase () -@property (nonatomic, strong) XCUIApplication *testedApplication; -@property (nonatomic, strong, getter = homeboard) FBHomeboardApplication *homeboard; -@end - -@implementation FBTVIntegrationTestCase - -- (void)setUp -{ - [super setUp]; - [FBConfiguration disableRemoteQueryEvaluation]; - [FBConfiguration disableAttributeKeyPathAnalysis]; - self.continueAfterFailure = NO; - self.testedApplication = [XCUIApplication new]; -} - -- (FBHomeboardApplication*) homeboard { - return [FBHomeboardApplication fb_homeboard]; -} - -- (void)launchApplication -{ - [self.testedApplication launch]; - FBAssertWaitTillBecomesTrue(self.testedApplication.buttons[@"Alerts"].fb_isVisible); - [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1]]; - - // Force resolving XCUIApplication - [self.testedApplication query]; - [self.testedApplication resolve]; -} - -- (void)goToAttributesPage -{ - [[XCUIRemote sharedRemote] pressButton:XCUIRemoteButtonDown]; - [[XCUIRemote sharedRemote] pressButton:XCUIRemoteButtonSelect]; - FBAssertWaitTillBecomesTrue(self.testedApplication.buttons[@"Select me"].fb_isVisible); -} - -- (void)goToNavigationPage -{ - [[XCUIRemote sharedRemote] pressButton:XCUIRemoteButtonDown]; - [[XCUIRemote sharedRemote] pressButton:XCUIRemoteButtonDown]; - [[XCUIRemote sharedRemote] pressButton:XCUIRemoteButtonSelect]; - FBAssertWaitTillBecomesTrue(self.testedApplication.staticTexts[@"Select template"].fb_isVisible); -} - -- (void)goToAlertsPage -{ - [[XCUIRemote sharedRemote] pressButton:XCUIRemoteButtonSelect]; - FBAssertWaitTillBecomesTrue(self.testedApplication.buttons[FBShowAlertButtonName].fb_isVisible); - FBAssertWaitTillBecomesTrue(self.testedApplication.buttons[FBShowSheetAlertButtonName].fb_isVisible); -} - -- (void)goToHeadBoardPage -{ - [[XCUIRemote sharedRemote] pressButton:XCUIRemoteButtonHome]; - FBAssertWaitTillBecomesTrue([FBHomeboardApplication fb_homeboard].icons[@"Settings"].exists); -} - -- (void)goToScrollPageWithCells:(BOOL)showCells -{ - [self select:self.testedApplication.buttons[@"Scrolling"]]; - FBAssertWaitTillBecomesTrue(self.testedApplication.buttons[@"TableView"].fb_isVisible); - [self select:self.testedApplication.buttons[showCells ? @"TableView": @"ScrollView"]]; - FBAssertWaitTillBecomesTrue(self.testedApplication.staticTexts[@"3"].fb_isVisible); -} - -- (void)select:(XCUIElement*) element -{ - [self.testedApplication fb_waitUntilSnapshotIsStable]; - NSError *error; - [element fb_selectWithError:&error]; - XCTAssertNil(error); -} - -@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVKeyboardTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVKeyboardTests.m deleted file mode 100644 index 2fb718314..000000000 --- a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVKeyboardTests.m +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import "FBTVIntegrationTestCase.h" -#import "FBKeyboard.h" -#import "FBRunLoopSpinner.h" - -@interface FBTVKeyboardTests : FBTVIntegrationTestCase -@end - -@implementation FBTVKeyboardTests - -- (void)setUp -{ - [super setUp]; - [self launchApplication]; - [self goToAttributesPage]; -} - -- (void)testTextTyping -{ - NSString *text = @"Happy typing"; - XCUIElement *textField = self.testedApplication.textFields[@"aIdentifier"]; - [self select: textField]; - NSError *error; - XCTAssertTrue([FBKeyboard typeText:text error:&error]); - XCTAssertNil(error); - XCTAssertEqualObjects(textField.value, text); -} - -- (void)testTypingWithoutKeyboardPresent -{ - NSError *error; - XCTAssertFalse([FBKeyboard typeText:@"This should fail" error:&error]); - XCTAssertNotNil(error); -} - -@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVTypingTest.m b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVTypingTest.m deleted file mode 100644 index 83dd0ba7c..000000000 --- a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVTypingTest.m +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import "FBTVIntegrationTestCase.h" -#import "XCUIElement+FBTyping.h" - -@interface FBTVTypingTest : FBTVIntegrationTestCase -@end - -@implementation FBTVTypingTest - -- (void)setUp -{ - [super setUp]; - [self launchApplication]; - [self goToAttributesPage]; -} - -- (void)testTextTyping -{ - NSString *text = @"Cannot automatically open keyboard"; - XCUIElement *textField = self.testedApplication.textFields[@"aIdentifier"]; - NSError *error; - XCTAssertFalse([textField fb_typeText:text error:&error]); - XCTAssertNotNil(error); -} - -- (void)testTextTypingOnFocusedElement -{ - NSString *text = @"Happy typing"; - XCUIElement *textField = self.testedApplication.textFields[@"aIdentifier"]; - [self select:textField]; - XCTAssertTrue(textField.hasKeyboardFocus); - NSError *error; - XCTAssertTrue([textField fb_typeText:text error:&error]); - XCTAssertNil(error); - XCTAssertEqualObjects(textField.value, text); -} - -- (void)testTextClearing -{ - XCUIElement *textField = self.testedApplication.textFields[@"aIdentifier"]; - [self select:textField]; - [textField typeText:@"Happy typing"]; - XCTAssertTrue([textField.value length] > 0); - NSError *error; - XCTAssertTrue([textField fb_clearTextWithError:&error]); - XCTAssertNil(error); - XCTAssertEqualObjects(textField.value, @"Hold  to dictate"); -} - -@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVXPathIntegrationTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/FBTVXPathIntegrationTests.m deleted file mode 100644 index d228ab3fc..000000000 --- a/WebDriverAgentTests/IntegrationTests_tvOS/FBTVXPathIntegrationTests.m +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import "FBTVIntegrationTestCase.h" -#import "XCUIElement.h" -#import "XCUIElement+FBFind.h" -#import "XCUIElement+FBUtilities.h" -#import "FBXPath.h" -#import "XCUIElement+FBWebDriverAttributes.h" - -@interface FBTVXPathIntegrationTests : FBTVIntegrationTestCase -@property (nonatomic, strong) XCUIElement *testedView; -@end - -@implementation FBTVXPathIntegrationTests - -- (void)setUp -{ - [super setUp]; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - [self launchApplication]; - }); - self.testedView = self.testedApplication.otherElements[@"MainView"]; - XCTAssertTrue(self.testedView.exists); - [self.testedView resolve]; -} - -- (void)testSingleDescendantXMLRepresentation -{ - NSString *expectedType = @"XCUIElementTypeButton"; - XCUIElement *matchingElement = [[self.testedView fb_descendantsMatchingXPathQuery:[NSString stringWithFormat:@"//%@", expectedType] shouldReturnAfterFirstMatch:YES] firstObject]; - XCElementSnapshot *matchingSnapshot = matchingElement.fb_lastSnapshot; - - NSString *xmlStr = [FBXPath xmlStringWithSnapshot:matchingSnapshot]; - XCTAssertNotNil(xmlStr); - - NSString *expectedXml = [NSString stringWithFormat:@"\n<%@ type=\"%@\" name=\"%@\" label=\"%@\" enabled=\"%@\" visible=\"%@\" focused=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\"/>\n", expectedType, expectedType, matchingSnapshot.wdName, matchingSnapshot.wdLabel, matchingSnapshot.wdEnabled ? @"true" : @"false", matchingSnapshot.wdVisible ? @"true" : @"false", matchingSnapshot.wdFocused ? @"true" : @"false", [matchingSnapshot.wdRect[@"x"] stringValue], [matchingSnapshot.wdRect[@"y"] stringValue], [matchingSnapshot.wdRect[@"width"] stringValue], [matchingSnapshot.wdRect[@"height"] stringValue]]; - XCTAssertTrue([xmlStr isEqualToString: expectedXml]); -} - -- (void)testFindMatchesInElement -{ - NSArray *matchingSnapshots = [FBXPath findMatchesIn:self.testedView.fb_lastSnapshot xpathQuery:@"//XCUIElementTypeButton"]; - XCTAssertEqual([matchingSnapshots count], 4); - for (id element in matchingSnapshots) { - XCTAssertTrue([element.wdType isEqualToString:@"XCUIElementTypeButton"]); - } -} - -- (void)testFindMatchesInElementWithDotNotation -{ - NSArray *matchingSnapshots = [FBXPath findMatchesIn:self.testedView.fb_lastSnapshot xpathQuery:@".//XCUIElementTypeButton"]; - XCTAssertEqual([matchingSnapshots count], 4); - for (id element in matchingSnapshots) { - XCTAssertTrue([element.wdType isEqualToString:@"XCUIElementTypeButton"]); - } -} - -@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/Info.plist b/WebDriverAgentTests/IntegrationTests_tvOS/Info.plist deleted file mode 100644 index 6c40a6cd0..000000000 --- a/WebDriverAgentTests/IntegrationTests_tvOS/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCElementSnapshotHelperTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCElementSnapshotHelperTests.m deleted file mode 100644 index 8a27d829e..000000000 --- a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCElementSnapshotHelperTests.m +++ /dev/null @@ -1,206 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import "FBTVIntegrationTestCase.h" -#import "FBTestMacros.h" -#import "XCElementSnapshot+FBHelpers.h" -#import "XCUIElement.h" -#import "XCUIElement+FBIsVisible.h" -#import "XCUIElement+FBUtilities.h" -#import "XCUIElement+FBWebDriverAttributes.h" - -@interface TVXCElementSnapshotHelperTests : FBTVIntegrationTestCase -@property (nonatomic, strong) XCUIElement *testedView; -@end - -@implementation TVXCElementSnapshotHelperTests - -- (void)setUp -{ - [super setUp]; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - [self launchApplication]; - }); - self.testedView = self.testedApplication.otherElements[@"MainView"]; - XCTAssertTrue(self.testedView.exists); - [self.testedView resolve]; -} - -- (void)testDescendantsMatchingType -{ - NSSet *expectedLabels = [NSSet setWithArray:@[ - @"Alerts", - @"Attributes", - @"Navigation", - @"Scrolling", - ]]; - NSArray *matchingSnapshots = [self.testedView.fb_lastSnapshot fb_descendantsMatchingType:XCUIElementTypeButton]; - XCTAssertEqual(matchingSnapshots.count, expectedLabels.count); - NSArray *labels = [matchingSnapshots valueForKeyPath:@"@distinctUnionOfObjects.label"]; - XCTAssertEqualObjects([NSSet setWithArray:labels], expectedLabels); - - NSArray *types = [matchingSnapshots valueForKeyPath:@"@distinctUnionOfObjects.elementType"]; - XCTAssertEqual(types.count, 1, @"matchingSnapshots should contain only one type"); - XCTAssertEqualObjects(types.lastObject, @(XCUIElementTypeButton), @"matchingSnapshots should contain only one type"); -} - -- (void)testDescendantsMatchingXPath -{ - NSArray *matchingSnapshots = [self.testedView.fb_lastSnapshot fb_descendantsMatchingXPathQuery:@"//XCUIElementTypeButton[@label='Alerts']"]; - XCTAssertEqual(matchingSnapshots.count, 1); - XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); - XCTAssertEqualObjects(matchingSnapshots.lastObject.label, @"Alerts"); -} - -- (void)testParentMatchingType -{ - XCUIElement *button = self.testedApplication.buttons[@"Alerts"]; - XCTAssertTrue(button.exists); - [button resolve]; - XCElementSnapshot *windowSnapshot = [button.fb_lastSnapshot fb_parentMatchingType:XCUIElementTypeWindow]; - XCTAssertNotNil(windowSnapshot); - XCTAssertEqual(windowSnapshot.elementType, XCUIElementTypeWindow); -} - -@end - -@interface TVXCElementSnapshotHelperTests_AttributePage : FBTVIntegrationTestCase -@end - -@implementation TVXCElementSnapshotHelperTests_AttributePage - -- (void)setUp -{ - [super setUp]; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - [self launchApplication]; - [self goToAttributesPage]; - }); -} - -- (void)testParentMatchingOneOfTypes -{ - XCUIElement *todayPickerWheel = self.testedApplication.staticTexts[@"Text view"]; - XCTAssertTrue(todayPickerWheel.exists); - [todayPickerWheel resolve]; - XCElementSnapshot *window = [todayPickerWheel.fb_lastSnapshot fb_parentMatchingOneOfTypes:@[@(XCUIElementTypeApplication), @(XCUIElementTypeWindow)]]; - XCTAssertNotNil(window); - XCTAssertEqual(window.elementType, XCUIElementTypeWindow); -} - -- (void)testParentMatchingOneOfTypesWithXCUIElementTypeAny -{ - XCUIElement *todayPickerWheel = self.testedApplication.staticTexts[@"Text view"]; - XCTAssertTrue(todayPickerWheel.exists); - [todayPickerWheel resolve]; - XCElementSnapshot *otherSnapshot = [todayPickerWheel.fb_lastSnapshot fb_parentMatchingOneOfTypes:@[@(XCUIElementTypeAny), @(XCUIElementTypeWindow)]]; - XCTAssertNotNil(otherSnapshot); - XCTAssertEqual(otherSnapshot.elementType, XCUIElementTypeOther); -} - -- (void)testParentMatchingOneOfTypesWithAbsentParents -{ - XCUIElement *todayPickerWheel = self.testedApplication.staticTexts[@"Text view"]; - XCTAssertTrue(todayPickerWheel.exists); - [todayPickerWheel resolve]; - XCElementSnapshot *otherSnapshot = [todayPickerWheel.fb_lastSnapshot fb_parentMatchingOneOfTypes:@[@(XCUIElementTypeTab), @(XCUIElementTypeLink)]]; - XCTAssertNil(otherSnapshot); -} - -@end - -@interface TVXCElementSnapshotHelperTests_ScrollView : FBTVIntegrationTestCase -@end - -@implementation TVXCElementSnapshotHelperTests_ScrollView - -- (void)setUp -{ - [super setUp]; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - [self launchApplication]; - [self goToScrollPageWithCells:false]; - }); -} - -- (void)testParentMatchingOneOfTypesWithFilter -{ - XCUIElement *threeStaticText = self.testedApplication.staticTexts[@"3"]; - [threeStaticText resolve]; - NSArray *acceptedParents = @[ - @(XCUIElementTypeScrollView), - @(XCUIElementTypeCollectionView), - @(XCUIElementTypeTable), - ]; - XCElementSnapshot *scrollView = [threeStaticText.fb_lastSnapshot fb_parentMatchingOneOfTypes:acceptedParents - filter:^(XCElementSnapshot *snapshot) { - return [snapshot isWDVisible]; - }]; - XCTAssertEqualObjects(scrollView.identifier, @"scrollView"); -} - -- (void)testParentMatchingOneOfTypesWithFilterRetruningNo -{ - XCUIElement *threeStaticText = self.testedApplication.staticTexts[@"3"]; - [threeStaticText resolve]; - NSArray *acceptedParents = @[ - @(XCUIElementTypeScrollView), - @(XCUIElementTypeCollectionView), - @(XCUIElementTypeTable), - ]; - XCElementSnapshot *scrollView = [threeStaticText.fb_lastSnapshot fb_parentMatchingOneOfTypes:acceptedParents - filter:^(XCElementSnapshot *snapshot) { - return NO; - }]; - XCTAssertNil(scrollView); -} - -- (void)testDescendantsCellSnapshots -{ - XCUIElement *scrollView = self.testedApplication.scrollViews[@"scrollView"]; - [scrollView resolve]; - FBAssertWaitTillBecomesTrue(self.testedApplication.staticTexts[@"3"].fb_isVisible); - NSArray *cells = [scrollView.fb_lastSnapshot fb_descendantsCellSnapshots]; - XCTAssertGreaterThanOrEqual(cells.count, 10); - XCElementSnapshot *element = cells.firstObject; - XCTAssertEqualObjects(element.label, @"0"); -} - -@end - -@interface TVXCElementSnapshotHelperTests_ScrollViewCells : FBTVIntegrationTestCase -@end - -@implementation TVXCElementSnapshotHelperTests_ScrollViewCells - -- (void)setUp -{ - [super setUp]; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - [self launchApplication]; - [self goToScrollPageWithCells:YES]; - }); -} - -- (void)testParentCellSnapshot -{ - FBAssertWaitTillBecomesTrue(self.testedApplication.staticTexts[@"3"].fb_isVisible); - XCUIElement *threeStaticText = self.testedApplication.staticTexts[@"3"]; - [threeStaticText resolve]; - XCElementSnapshot *xcuiElementCell = [threeStaticText.fb_lastSnapshot fb_parentCellSnapshot]; - XCTAssertEqual(xcuiElementCell.elementType, 75); -} - -@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCElementSnapshotHitPoint.m b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCElementSnapshotHitPoint.m deleted file mode 100644 index a887c2e19..000000000 --- a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCElementSnapshotHitPoint.m +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "FBTVIntegrationTestCase.h" -#import "FBMathUtils.h" -#import "XCElementSnapshot+FBHitpoint.h" -#import "XCUIElement.h" -#import "XCUIElement+FBUtilities.h" - -@interface TVXCElementSnapshotHitPoint : FBTVIntegrationTestCase -@end - -@implementation TVXCElementSnapshotHitPoint - -- (void)testAccessibilityActivationPoint -{ - [self launchApplication]; - [self goToAttributesPage]; - XCUIElement *element = self.testedApplication.otherElements[@"testView"]; - NSError *error; - FBElementHitPoint *hitpoint = [element.fb_lastSnapshot fb_hitPoint:&error]; - XCTAssertNotNil(hitpoint); - XCTAssertTrue(FBPointFuzzyEqualToPoint(hitpoint.point, CGPointMake(25, 25), 0.1)); -} - -@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIApplicationHelperTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIApplicationHelperTests.m deleted file mode 100644 index 97031e527..000000000 --- a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIApplicationHelperTests.m +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import "FBApplication.h" -#import "FBTVIntegrationTestCase.h" -#import "FBTestMacros.h" -#import "FBHomeboardApplication.h" -#import "XCUIApplication+FBHelpers.h" -#import "XCUIElement+FBIsVisible.h" - -@interface TVXCUIApplicationHelperTests : FBTVIntegrationTestCase -@end - -@implementation TVXCUIApplicationHelperTests - -- (void)setUp -{ - [super setUp]; - [self launchApplication]; -} - -- (void)testQueringSpringboard -{ - [self goToHeadBoardPage]; - XCTAssertTrue([FBHomeboardApplication fb_homeboard].icons[@"Settings"].exists); -} - -- (void)testTappingAppOnSpringboard -{ - [self goToHeadBoardPage]; - NSError *error; - XCTAssertTrue([[FBHomeboardApplication fb_homeboard] fb_openApplicationWithIdentifier:@"Settings" error:&error]); - XCTAssertNil(error); - XCTAssertTrue([FBApplication fb_activeApplication].cells[@"General"].exists); -} - -- (void)testWaitingForSpringboard -{ - NSError *error; - [[XCUIDevice sharedDevice] pressButton:XCUIDeviceButtonHome]; - XCTAssertTrue([[FBHomeboardApplication fb_homeboard] fb_waitUntilApplicationBoardIsVisible:&error]); - XCTAssertNil(error); - XCTAssertTrue([FBHomeboardApplication fb_homeboard].icons[@"Settings"].fb_isVisible); -} - -- (void)testApplicationTree -{ - [self.testedApplication query]; - [self.testedApplication resolve]; - XCTAssertNotNil(self.testedApplication.fb_tree); - XCTAssertNotNil(self.testedApplication.fb_accessibilityTree); -} - -- (void)testDeactivateApplication -{ - [self.testedApplication query]; - [self.testedApplication resolve]; - NSError *error; - XCTAssertTrue([self.testedApplication fb_deactivateWithDuration:1 error:&error]); - XCTAssertNil(error); - XCTAssertTrue(self.testedApplication.buttons[@"Alerts"].exists); - FBAssertWaitTillBecomesTrue(self.testedApplication.buttons[@"Alerts"].fb_isVisible); -} - -- (void)testActiveApplication -{ - XCTAssertTrue([FBApplication fb_activeApplication].buttons[@"Alerts"].fb_isVisible); - [self goToHeadBoardPage]; - XCTAssertTrue([FBApplication fb_activeApplication].icons[@"Settings"].fb_isVisible); -} - -@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIDeviceHealthCheckTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIDeviceHealthCheckTests.m deleted file mode 100644 index aabff3886..000000000 --- a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIDeviceHealthCheckTests.m +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import "FBTVIntegrationTestCase.h" -#import "XCUIDevice+FBHealthCheck.h" -#import "XCUIElement.h" - -@interface TVXCUIDeviceHealthCheckTests : FBTVIntegrationTestCase -@end - -@implementation TVXCUIDeviceHealthCheckTests - -- (void)testHealthCheck -{ - [self launchApplication]; - XCTAssertTrue(self.testedApplication.exists); - XCTAssertTrue([[XCUIDevice sharedDevice] fb_healthCheckWithApplication:self.testedApplication]); -} - -@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIDeviceHelperTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIDeviceHelperTests.m deleted file mode 100644 index 988642f9e..000000000 --- a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIDeviceHelperTests.m +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import "FBTVIntegrationTestCase.h" -#import "FBApplication.h" -#import "XCUIDevice+FBHelpers.h" - -@interface TVXCUIDeviceHelperTests : FBTVIntegrationTestCase -@end - -@implementation TVXCUIDeviceHelperTests - -- (void)setUp -{ - [super setUp]; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - [self launchApplication]; - }); -} - -- (void)testScreenshot -{ - NSError *error = nil; - NSData *screenshotData = [[XCUIDevice sharedDevice] fb_screenshotWithError:&error]; - XCTAssertNotNil([UIImage imageWithData:screenshotData]); - XCTAssertNil(error); -} - -- (void)testWifiAddress -{ - NSString *adderss = [XCUIDevice sharedDevice].fb_wifiIPAddress; - if (!adderss) { - return; - } - NSRange range = [adderss rangeOfString:@"^([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})" options:NSRegularExpressionSearch]; - XCTAssertTrue(range.location != NSNotFound); -} - -- (void)testGoToHomeScreen -{ - NSError *error; - XCTAssertTrue([[XCUIDevice sharedDevice] fb_goToHomescreenWithError:&error]); - XCTAssertNil(error); - XCTAssertTrue([FBApplication fb_activeApplication].icons[@"Settings"].exists); -} - -@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementAttributesTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementAttributesTests.m deleted file mode 100644 index bd18fc6ca..000000000 --- a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementAttributesTests.m +++ /dev/null @@ -1,126 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import "FBTVIntegrationTestCase.h" -#import "XCUIElement+FBWebDriverAttributes.h" -#import "XCUIElement+FBFind.h" -#import "FBElementUtils.h" - -@interface TVXCUIElementAttributesTests : FBTVIntegrationTestCase -@property (nonatomic, strong) XCUIElement *matchingElement; -@end - -@implementation TVXCUIElementAttributesTests - -- (void)setUp -{ - [super setUp]; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - [self launchApplication]; - }); - XCUIElement *testedView = self.testedApplication.otherElements[@"MainView"]; - XCTAssertTrue(testedView.exists); - [testedView resolve]; - self.matchingElement = [[testedView fb_descendantsMatchingIdentifier:@"Alerts" shouldReturnAfterFirstMatch:YES] firstObject]; - XCTAssertNotNil(self.matchingElement); -} - -- (void)verifyGettingAttributeWithShortcut:(NSString *)shortcutName expectedValue:(id)expectedValue -{ - NSString *fullAttributeName = [NSString stringWithFormat:@"wd%@", [NSString stringWithFormat:@"%@%@", [[shortcutName substringToIndex:1] uppercaseString], [shortcutName substringFromIndex:1]]]; - id actualValue = [self.matchingElement fb_valueForWDAttributeName:fullAttributeName]; - id actualShortcutValue = [self.matchingElement fb_valueForWDAttributeName:shortcutName]; - if (nil == expectedValue) { - XCTAssertNil(actualValue); - XCTAssertNil(actualShortcutValue); - return; - } - if ([actualValue isKindOfClass:NSString.class]) { - XCTAssertTrue([actualValue isEqualToString:expectedValue]); - XCTAssertTrue([actualShortcutValue isEqualToString:expectedValue]); - } else if ([actualValue isKindOfClass:NSNumber.class]) { - XCTAssertTrue([actualValue isEqualToNumber:expectedValue]); - XCTAssertTrue([actualShortcutValue isEqualToNumber:expectedValue]); - } else { - XCTAssertEqual(actualValue, expectedValue); - XCTAssertEqual(actualShortcutValue, expectedValue); - } -} - -- (void)testGetNameAttribute -{ - [self verifyGettingAttributeWithShortcut:@"name" expectedValue:self.matchingElement.wdName]; -} - -- (void)testGetValueAttribute -{ - [self verifyGettingAttributeWithShortcut:@"value" expectedValue:self.matchingElement.wdValue]; -} - -- (void)testGetLabelAttribute -{ - [self verifyGettingAttributeWithShortcut:@"label" expectedValue:self.matchingElement.wdLabel]; -} - -- (void)testGetTypeAttribute -{ - [self verifyGettingAttributeWithShortcut:@"type" expectedValue:self.matchingElement.wdType]; -} - -- (void)testGetRectAttribute -{ - NSString *shortcutName = @"rect"; - for (NSString *key in @[@"x", @"y", @"width", @"height"]) { - NSNumber *actualValue = [self.matchingElement fb_valueForWDAttributeName:[FBElementUtils wdAttributeNameForAttributeName:shortcutName]][key]; - NSNumber *actualShortcutValue = [self.matchingElement fb_valueForWDAttributeName:shortcutName][key]; - NSNumber *expectedValue = self.matchingElement.wdRect[key]; - XCTAssertTrue([actualValue isEqualToNumber:expectedValue]); - XCTAssertTrue([actualShortcutValue isEqualToNumber:expectedValue]); - } -} - -- (void)testGetEnabledAttribute -{ - [self verifyGettingAttributeWithShortcut:@"enabled" expectedValue:[NSNumber numberWithBool:self.matchingElement.wdEnabled]]; -} - -- (void)testGetFocusedAttribute -{ - [self verifyGettingAttributeWithShortcut:@"focused" expectedValue:[NSNumber numberWithBool:self.matchingElement.wdFocused]]; -} - -- (void)testGetAccessibleAttribute -{ - [self verifyGettingAttributeWithShortcut:@"accessible" expectedValue:[NSNumber numberWithBool:self.matchingElement.wdAccessible]]; -} - -- (void)testGetUidAttribute -{ - [self verifyGettingAttributeWithShortcut:@"UID" expectedValue:@(self.matchingElement.wdUID)]; -} - -- (void)testGetVisibleAttribute -{ - [self verifyGettingAttributeWithShortcut:@"visible" expectedValue:[NSNumber numberWithBool:self.matchingElement.wdVisible]]; -} - -- (void)testGetAccessibilityContainerAttribute -{ - [self verifyGettingAttributeWithShortcut:@"accessibilityContainer" expectedValue:[NSNumber numberWithBool:self.matchingElement.wdAccessibilityContainer]]; -} - -- (void)testGetInvalidAttribute -{ - XCTAssertThrowsSpecificNamed([self verifyGettingAttributeWithShortcut:@"invalid" expectedValue:@"blabla"], NSException, FBUnknownAttributeException); -} - -@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementFBFindTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementFBFindTests.m deleted file mode 100644 index 55ed38c8b..000000000 --- a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementFBFindTests.m +++ /dev/null @@ -1,336 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import "FBTVIntegrationTestCase.h" -#import "FBElementUtils.h" -#import "FBTestMacros.h" -#import "XCUIElement.h" -#import "XCUIElement+FBFind.h" -#import "XCElementSnapshot+FBHelpers.h" -#import "XCUIElement+FBIsVisible.h" -#import "XCUIElement+FBClassChain.h" -#import "FBXPath.h" - -@interface TVXCUIElementFBFindTests : FBTVIntegrationTestCase -@property (nonatomic, strong) XCUIElement *testedView; -@end - -@implementation TVXCUIElementFBFindTests - -- (void)setUp -{ - [super setUp]; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - [self launchApplication]; - }); - self.testedView = self.testedApplication.otherElements[@"MainView"].otherElements.firstMatch; - XCTAssertTrue(self.testedView.exists); - [self.testedView resolve]; -} - -- (void)testDescendantsWithClassName -{ - NSSet *expectedLabels = [NSSet setWithArray:@[ - @"Alerts", - @"Attributes", - @"Navigation", - @"Scrolling", - ]]; - NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingClassName:@"XCUIElementTypeButton" shouldReturnAfterFirstMatch:NO]; - XCTAssertEqual(matchingSnapshots.count, expectedLabels.count); - NSArray *labels = [matchingSnapshots valueForKeyPath:@"@distinctUnionOfObjects.label"]; - XCTAssertEqualObjects([NSSet setWithArray:labels], expectedLabels); - - NSArray *types = [matchingSnapshots valueForKeyPath:@"@distinctUnionOfObjects.elementType"]; - XCTAssertEqual(types.count, 1, @"matchingSnapshots should contain only one type"); - XCTAssertEqualObjects(types.lastObject, @(XCUIElementTypeButton), @"matchingSnapshots should contain only one type"); -} - -- (void)testSingleDescendantWithClassName -{ - NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingClassName:@"XCUIElementTypeButton" shouldReturnAfterFirstMatch:YES]; - XCTAssertEqual(matchingSnapshots.count, 1); - XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); -} - -- (void)testDescendantsWithIdentifier -{ - NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingIdentifier:@"Alerts" shouldReturnAfterFirstMatch:NO]; - XCTAssertEqual(matchingSnapshots.count, 1); - XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); - XCTAssertEqualObjects(matchingSnapshots.lastObject.label, @"Alerts"); -} - -- (void)testSingleDescendantWithIdentifier -{ - NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingIdentifier:@"Alerts" shouldReturnAfterFirstMatch:YES]; - XCTAssertEqual(matchingSnapshots.count, 1); - XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); - XCTAssertEqualObjects(matchingSnapshots.lastObject.label, @"Alerts"); -} - -- (void)testSingleDescendantWithMissingIdentifier -{ - NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingIdentifier:@"blabla" shouldReturnAfterFirstMatch:YES]; - XCTAssertEqual(matchingSnapshots.count, 0); -} - -- (void)testDescendantsWithXPathQuery -{ - NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingXPathQuery:@"//XCUIElementTypeButton[@label='Alerts']" shouldReturnAfterFirstMatch:NO]; - XCTAssertEqual(matchingSnapshots.count, 1); - XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); - XCTAssertEqualObjects(matchingSnapshots.lastObject.label, @"Alerts"); -} - -- (void)testSelfWithXPathQuery -{ - NSArray *matchingSnapshots = [self.testedApplication fb_descendantsMatchingXPathQuery:@"//XCUIElementTypeApplication" shouldReturnAfterFirstMatch:NO]; - XCTAssertEqual(matchingSnapshots.count, 1); - XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeApplication); -} - -- (void)testSingleDescendantWithXPathQuery -{ - NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingXPathQuery:@"//XCUIElementTypeButton" shouldReturnAfterFirstMatch:YES]; - XCTAssertEqual(matchingSnapshots.count, 1); - XCUIElement *matchingSnapshot = [matchingSnapshots firstObject]; - XCTAssertNotNil(matchingSnapshot); - XCTAssertEqual(matchingSnapshot.elementType, XCUIElementTypeButton); - XCTAssertEqualObjects(matchingSnapshot.label, @"Alerts"); -} - -- (void)testSingleDescendantWithXPathQueryNoMatches -{ - XCUIElement *matchingSnapshot = [[self.testedView fb_descendantsMatchingXPathQuery:@"//XCUIElementTypeButtonnn" shouldReturnAfterFirstMatch:YES] firstObject]; - XCTAssertNil(matchingSnapshot); -} - -- (void)testSingleLastDescendantWithXPathQuery -{ - XCUIElement *matchingSnapshot = [[self.testedView fb_descendantsMatchingXPathQuery:@"(//XCUIElementTypeButton)[last()]" shouldReturnAfterFirstMatch:YES] firstObject]; - XCTAssertNotNil(matchingSnapshot); - XCTAssertEqual(matchingSnapshot.elementType, XCUIElementTypeButton); -} - -- (void)testDescendantsWithXPathQueryNoMatches -{ - NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingXPathQuery:@"//XCUIElementTypeButton[@label='Alerts1']" shouldReturnAfterFirstMatch:NO]; - XCTAssertEqual(matchingSnapshots.count, 0); -} - -- (void)testDescendantsWithComplexXPathQuery -{ - NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingXPathQuery:@"//*[@label='Scrolling']/preceding::*[boolean(string(@label))]" shouldReturnAfterFirstMatch:NO]; - XCTAssertEqual(matchingSnapshots.count, 3); -} - -- (void)testDescendantsWithWrongXPathQuery -{ - XCTAssertThrowsSpecificNamed([self.testedView fb_descendantsMatchingXPathQuery:@"//*[blabla(@label, Scrolling')]" shouldReturnAfterFirstMatch:NO], - NSException, FBInvalidXPathException); -} - -- (void)testFirstDescendantWithWrongXPathQuery -{ - XCTAssertThrowsSpecificNamed([self.testedView fb_descendantsMatchingXPathQuery:@"//*[blabla(@label, Scrolling')]" shouldReturnAfterFirstMatch:YES], - NSException, FBInvalidXPathException); -} - -- (void)testVisibleDescendantWithXPathQuery -{ - NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingXPathQuery:@"//XCUIElementTypeButton[@name='Alerts' and @enabled='true' and @visible='true']" shouldReturnAfterFirstMatch:NO]; - XCTAssertEqual(matchingSnapshots.count, 1); - XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); - XCTAssertTrue(matchingSnapshots.lastObject.isEnabled); - XCTAssertTrue(matchingSnapshots.lastObject.fb_isVisible); - XCTAssertEqualObjects(matchingSnapshots.lastObject.label, @"Alerts"); -} - -- (void)testDescendantsWithPredicateString -{ - NSPredicate *predicate = [NSPredicate predicateWithFormat:@"label = 'Alerts'"]; - NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingPredicate:predicate shouldReturnAfterFirstMatch:NO]; - XCTAssertEqual(matchingSnapshots.count, 1); - XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); - XCTAssertEqualObjects(matchingSnapshots.lastObject.label, @"Alerts"); -} - -- (void)testSelfWithPredicateString -{ - NSPredicate *predicate = [NSPredicate predicateWithFormat:@"type == 'XCUIElementTypeApplication'"]; - NSArray *matchingSnapshots = [self.testedApplication fb_descendantsMatchingPredicate:predicate shouldReturnAfterFirstMatch:NO]; - XCTAssertEqual(matchingSnapshots.count, 1); - XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeApplication); -} - -- (void)testSingleDescendantWithPredicateString -{ - NSPredicate *predicate = [NSPredicate predicateWithFormat:@"type = 'XCUIElementTypeButton'"]; - NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingPredicate:predicate shouldReturnAfterFirstMatch:YES]; - XCTAssertEqual(matchingSnapshots.count, 1); - XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); -} - -- (void)testDescendantsWithPropertyStrict -{ - NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingProperty:@"label" value:@"Alert" partialSearch:NO]; - XCTAssertEqual(matchingSnapshots.count, 0); - matchingSnapshots = [self.testedView fb_descendantsMatchingProperty:@"label" value:@"Alerts" partialSearch:NO]; - XCTAssertEqual(matchingSnapshots.count, 1); - XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); - XCTAssertEqualObjects(matchingSnapshots.lastObject.label, @"Alerts"); -} - -- (void)testGlobalWithPropertyStrict -{ - NSArray *matchingSnapshots = [self.testedApplication fb_descendantsMatchingProperty:@"label" value:@"Alert" partialSearch:NO]; - XCTAssertEqual(matchingSnapshots.count, 0); - matchingSnapshots = [self.testedApplication fb_descendantsMatchingProperty:@"label" value:@"Alerts" partialSearch:NO]; - XCTAssertEqual(matchingSnapshots.count, 1); - XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); - XCTAssertEqualObjects(matchingSnapshots.lastObject.label, @"Alerts"); -} - -- (void)testDescendantsWithPropertyPartial -{ - NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingProperty:@"label" value:@"Alerts" partialSearch:NO]; - XCTAssertEqual(matchingSnapshots.count, 1); - XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); - XCTAssertEqualObjects(matchingSnapshots.lastObject.label, @"Alerts"); -} - -- (void)testDescendantsWithClassChain -{ - NSArray *matchingSnapshots; - matchingSnapshots = [self.testedApplication fb_descendantsMatchingClassChain:@"XCUIElementTypeWindow/*/*/XCUIElementTypeButton" shouldReturnAfterFirstMatch:NO]; - XCTAssertEqual(matchingSnapshots.count, 4); - for (XCUIElement *matchingSnapshot in matchingSnapshots) { - XCTAssertEqual(matchingSnapshot.elementType, XCUIElementTypeButton); - } -} - -- (void)testDescendantsWithClassChainAndPredicates -{ - NSArray *matchingSnapshots; - matchingSnapshots = [self.testedApplication fb_descendantsMatchingClassChain:@"XCUIElementTypeWindow/*/*/XCUIElementTypeButton[`label BEGINSWITH 'A'`]" shouldReturnAfterFirstMatch:NO]; - XCTAssertEqual(matchingSnapshots.count, 2); - XCTAssertEqualObjects([matchingSnapshots firstObject].label, @"Alerts"); - XCTAssertEqualObjects([matchingSnapshots lastObject].label, @"Attributes"); -} - -- (void)testDescendantsWithIndirectClassChainAndPredicates -{ - NSArray *simpleQueryMatches = [self.testedApplication fb_descendantsMatchingClassChain:@"XCUIElementTypeWindow/*/*/XCUIElementTypeButton[`label BEGINSWITH 'A'`]" shouldReturnAfterFirstMatch:NO]; - NSArray *deepQueryMatches = [self.testedApplication fb_descendantsMatchingClassChain:@"XCUIElementTypeWindow/**/XCUIElementTypeButton[`label BEGINSWITH 'A'`]" shouldReturnAfterFirstMatch:NO]; - XCTAssertEqual(simpleQueryMatches.count, deepQueryMatches.count); - XCTAssertEqualObjects([simpleQueryMatches firstObject].label, [deepQueryMatches firstObject].label); - XCTAssertEqualObjects([simpleQueryMatches lastObject].label, [deepQueryMatches lastObject].label); -} - -- (void)testClassChainWithDescendantPredicate -{ - NSArray *simpleQueryMatches = [self.testedApplication fb_descendantsMatchingClassChain:@"XCUIElementTypeWindow/*/*/*[2]" shouldReturnAfterFirstMatch:NO]; - NSArray *predicateQueryMatches = [self.testedApplication fb_descendantsMatchingClassChain:@"XCUIElementTypeWindow/*/*/*[$type == 'XCUIElementTypeButton' AND label BEGINSWITH 'At'$]" shouldReturnAfterFirstMatch:NO]; - XCTAssertEqual(simpleQueryMatches.count, predicateQueryMatches.count); - XCTAssertEqual([simpleQueryMatches firstObject].elementType, [predicateQueryMatches firstObject].elementType); - XCTAssertEqual([simpleQueryMatches lastObject].elementType, [predicateQueryMatches lastObject].elementType); -} - -- (void)testSingleDescendantWithComplexIndirectClassChain -{ - NSArray *queryMatches = [self.testedApplication fb_descendantsMatchingClassChain:@"**/*/XCUIElementTypeButton[2]" shouldReturnAfterFirstMatch:NO]; - XCTAssertEqual(queryMatches.count, 1); - XCTAssertEqual(queryMatches.lastObject.elementType, XCUIElementTypeButton); - XCTAssertEqualObjects(queryMatches.lastObject.label, @"Attributes"); -} - -- (void)testSingleDescendantWithComplexIndirectClassChainAndZeroMatches -{ - NSArray *queryMatches = [self.testedApplication fb_descendantsMatchingClassChain:@"**/*/XCUIElementTypeWindow" shouldReturnAfterFirstMatch:NO]; - XCTAssertEqual(queryMatches.count, 0); -} - -- (void)testDescendantsWithClassChainAndPredicatesAndIndexes -{ - NSArray *matchingSnapshots; - matchingSnapshots = [self.testedApplication fb_descendantsMatchingClassChain:@"XCUIElementTypeWindow[`name != 'bla'`]/*/*/XCUIElementTypeButton[`label BEGINSWITH \"A\"`][1]" shouldReturnAfterFirstMatch:NO]; - XCTAssertEqual(matchingSnapshots.count, 1); - XCTAssertEqualObjects([matchingSnapshots firstObject].label, @"Alerts"); -} - -- (void)testSingleDescendantWithClassChain -{ - NSArray *matchingSnapshots = [self.testedView fb_descendantsMatchingClassChain:@"XCUIElementTypeButton" shouldReturnAfterFirstMatch:YES]; - - XCTAssertEqual(matchingSnapshots.count, 1); - XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); - XCTAssertTrue([matchingSnapshots.lastObject.label isEqualToString:@"Alerts"]); -} - -- (void)testSingleDescendantWithClassChainAndNegativeIndex -{ - NSArray *matchingSnapshots; - matchingSnapshots = [self.testedView fb_descendantsMatchingClassChain:@"XCUIElementTypeButton[-1]" shouldReturnAfterFirstMatch:YES]; - - XCTAssertEqual(matchingSnapshots.count, 1); - XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeButton); - XCTAssertTrue([matchingSnapshots.lastObject.label isEqualToString:@"Scrolling"]); - - matchingSnapshots = [self.testedView fb_descendantsMatchingClassChain:@"XCUIElementTypeButton[-10]" shouldReturnAfterFirstMatch:YES]; - XCTAssertEqual(matchingSnapshots.count, 0); -} - -- (void)testInvalidQueryWithClassChain -{ - XCTAssertThrowsSpecificNamed([self.testedView fb_descendantsMatchingClassChain:@"XCUIElementTypeBlabla" shouldReturnAfterFirstMatch:YES], NSException, FBClassChainQueryParseException); -} - -- (void)testClassChainWithInvalidPredicate -{ - XCTAssertThrowsSpecificNamed([self.testedApplication fb_descendantsMatchingClassChain:@"XCUIElementTypeWindow[`bla != 'bla'`]" shouldReturnAfterFirstMatch:NO], - NSException, FBUnknownAttributeException);; -} - -@end - -@interface TVXCUIElementFBFindTests_ScrollPage : FBTVIntegrationTestCase -@end -@implementation TVXCUIElementFBFindTests_ScrollPage - -- (void)setUp -{ - [super setUp]; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - [self launchApplication]; - [self goToScrollPageWithCells:YES]; - }); -} - -- (void)testInvisibleDescendantWithXPathQuery -{ - NSArray *matchingSnapshots = [self.testedApplication fb_descendantsMatchingXPathQuery:@"//XCUIElementTypeStaticText[@visible='false']" shouldReturnAfterFirstMatch:NO]; - XCTAssertGreaterThan(matchingSnapshots.count, 1); - XCTAssertEqual(matchingSnapshots.lastObject.elementType, XCUIElementTypeStaticText); - XCTAssertFalse(matchingSnapshots.lastObject.fb_isVisible); -} - -- (void)testNestedQueryWithClassChain -{ - XCUIElement *table = self.testedApplication.tables.firstMatch; - NSArray *matches = [table fb_descendantsMatchingClassChain:@"XCUIElementTypeCell" shouldReturnAfterFirstMatch:NO]; - XCTAssertEqual(matches.count, 100); - XCTAssertEqual([matches firstObject].elementType, XCUIElementTypeCell); -} - -@end diff --git a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementHelperIntegrationTests.m b/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementHelperIntegrationTests.m deleted file mode 100644 index b2fcfb28f..000000000 --- a/WebDriverAgentTests/IntegrationTests_tvOS/TVXCUIElementHelperIntegrationTests.m +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Copyright (c) 2018-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import -#import "XCTest/XCUIElementTypes.h" - -#import "FBTVIntegrationTestCase.h" -#import "FBTestMacros.h" -#import "FBElement.h" -#import "FBElementUtils.h" -#import "XCUIElement+FBUtilities.h" - -@interface TVXCUIElementHelperIntegrationTests : FBTVIntegrationTestCase -@end - -@implementation TVXCUIElementHelperIntegrationTests - -- (void)setUp -{ - [super setUp]; - [self launchApplication]; - [self goToAlertsPage]; -} - -- (void)testObstructionByAlert -{ - XCUIElement *showAlertButton = self.testedApplication.buttons[FBShowAlertButtonName]; - XCTAssertTrue(showAlertButton.exists); - XCTAssertFalse(showAlertButton.fb_isObstructedByAlert); - [self select:showAlertButton]; - FBAssertWaitTillBecomesTrue(self.testedApplication.alerts.count > 0); - XCTAssertTrue(showAlertButton.fb_isObstructedByAlert); -} - -- (void)testElementObstruction -{ - XCUIElement *showAlertButton = self.testedApplication.buttons[FBShowAlertButtonName]; - XCTAssertTrue(showAlertButton.exists); - [self select:showAlertButton]; - FBAssertWaitTillBecomesTrue(self.testedApplication.alerts.count > 0); - - XCUIElement *alert = self.testedApplication.alerts.element; - XCUIElement *acceptAlertButton = self.testedApplication.buttons[@"Will do"]; - XCTAssertTrue(alert.exists); - XCTAssertTrue(acceptAlertButton.exists); - - XCTAssertTrue([alert fb_obstructsElement:showAlertButton]); - XCTAssertFalse([alert fb_obstructsElement:acceptAlertButton]); -} - -- (void)testDescendantsFiltering -{ - NSArray *buttons = [self.testedApplication.buttons allElementsBoundByIndex]; - XCTAssertTrue(buttons.count > 0); - NSArray *windows = [self.testedApplication.windows allElementsBoundByIndex]; - XCTAssertTrue(windows.count > 0); - - NSMutableArray *allElements = [NSMutableArray array]; - [allElements addObjectsFromArray:buttons]; - [allElements addObjectsFromArray:windows]; - - NSMutableArray *buttonSnapshots = [NSMutableArray array]; - [buttonSnapshots addObject:[buttons.firstObject fb_lastSnapshot]]; - - NSArray *result = [self.testedApplication fb_filterDescendantsWithSnapshots:buttonSnapshots]; - XCTAssertEqual(1, result.count); - XCTAssertEqual([result.firstObject elementType], XCUIElementTypeButton); -} - -@end From 8ac396a9b58b2230af4aad5319cc98fd8c9ed8fa Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Tue, 19 Mar 2019 21:42:34 +0900 Subject: [PATCH 03/16] fix screenshot --- .../Categories/XCUIApplication+FBHelpers.m | 4 +++ .../Categories/XCUIDevice+FBHelpers.m | 6 ++-- .../Categories/XCUIElement+FBIsVisible.m | 7 ++--- .../Categories/XCUIElement+FBTVFocuse.h | 8 +++-- .../Categories/XCUIElement+FBTVFocuse.m | 4 +++ .../Commands/FBElementCommands.m | 12 ++++++-- WebDriverAgentLib/FBSpringboardApplication.m | 30 ++++++++++--------- WebDriverAgentLib/Routing/FBElementUtils.h | 8 ----- WebDriverAgentLib/Utilities/FBImageUtils.h | 4 ++- WebDriverAgentLib/Utilities/FBImageUtils.m | 11 ++++++- 10 files changed, 59 insertions(+), 35 deletions(-) diff --git a/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m b/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m index ce2250def..9c63e9372 100644 --- a/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m +++ b/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m @@ -92,6 +92,10 @@ + (NSDictionary *)dictionaryForElement:(XCElementSnapshot *)snapshot recursive:( info[@"isEnabled"] = [@([snapshot isWDEnabled]) stringValue]; info[@"isVisible"] = [@([snapshot isWDVisible]) stringValue]; +#if TARGET_OS_TV + info[@"isFocused"] = [@([snapshot isWDFocused]) stringValue]; +#endif + if (!recursive) { return info.copy; } diff --git a/WebDriverAgentLib/Categories/XCUIDevice+FBHelpers.m b/WebDriverAgentLib/Categories/XCUIDevice+FBHelpers.m index 45fe5c6dd..7e2976793 100644 --- a/WebDriverAgentLib/Categories/XCUIDevice+FBHelpers.m +++ b/WebDriverAgentLib/Categories/XCUIDevice+FBHelpers.m @@ -108,16 +108,18 @@ - (BOOL)fb_unlockScreen:(NSError **)error } error:error]; } -#if !TARGET_OS_TV - (NSData *)fb_screenshotWithError:(NSError*__autoreleasing*)error { NSData* screenshotData = [self fb_rawScreenshotWithQuality:FBConfiguration.screenshotQuality rect:CGRectNull error:error]; if (nil == screenshotData) { return nil; } +#if TARGET_OS_TV + return FBAdjustScreenshotOrientationForApplication(screenshotData); +#else return FBAdjustScreenshotOrientationForApplication(screenshotData, FBApplication.fb_activeApplication.interfaceOrientation); -} #endif +} - (NSData *)fb_rawScreenshotWithQuality:(NSUInteger)quality rect:(CGRect)rect error:(NSError*__autoreleasing*)error { diff --git a/WebDriverAgentLib/Categories/XCUIElement+FBIsVisible.m b/WebDriverAgentLib/Categories/XCUIElement+FBIsVisible.m index e67c8dd9c..e75664ff7 100644 --- a/WebDriverAgentLib/Categories/XCUIElement+FBIsVisible.m +++ b/WebDriverAgentLib/Categories/XCUIElement+FBIsVisible.m @@ -193,9 +193,6 @@ - (BOOL)fb_isVisible NSArray *ancestors = self.fb_ancestors; XCElementSnapshot *parentWindow = ancestors.count > 1 ? [ancestors objectAtIndex:ancestors.count - 2] : nil; - XCElementSnapshot *appElement = ancestors.count > 0 ? [ancestors lastObject] : self; - - CGRect appFrame = appElement.frame; CGRect visibleRect = selfFrame; if (nil != parentWindow) { visibleRect = [self fb_frameInContainer:parentWindow hierarchyIntersection:nil]; @@ -205,8 +202,10 @@ - (BOOL)fb_isVisible } CGPoint midPoint = CGPointMake(visibleRect.origin.x + visibleRect.size.width / 2, visibleRect.origin.y + visibleRect.size.height / 2); +#if !TARGET_OS_TV // TV has no orientation, so it does not need to coordinate + XCElementSnapshot *appElement = ancestors.count > 0 ? [ancestors lastObject] : self; + CGRect appFrame = appElement.frame; CGRect windowFrame = nil == parentWindow ? selfFrame : parentWindow.frame; -#if !TARGET_OS_TV if ((appFrame.size.height > appFrame.size.width && windowFrame.size.height < windowFrame.size.width) || (appFrame.size.height < appFrame.size.width && windowFrame.size.height > windowFrame.size.width)) { // This is the indication of the fact that transformation is broken and coordinates should be diff --git a/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.h b/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.h index ecadb0fbd..81763ed4c 100644 --- a/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.h +++ b/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.h @@ -11,12 +11,14 @@ NS_ASSUME_NONNULL_BEGIN +#if TARGET_OS_TV @interface XCUIElement (FBTVFocuse) - -(BOOL)fb_focuseWithError:(NSError**) error; +-(BOOL)fb_focuseWithError:(NSError**) error; - -(BOOL)fb_selectWithError:(NSError**) error; +-(BOOL)fb_selectWithError:(NSError**) error; - @end +@end +#endif NS_ASSUME_NONNULL_END diff --git a/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m b/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m index a07bd6ce5..2158929be 100644 --- a/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m +++ b/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m @@ -16,6 +16,8 @@ #import "XCUIElement+FBUtilities.h" #import "XCUIElement+FBWebDriverAttributes.h" +#if TARGET_OS_TV + int const MAX_ITERATIONS_COUNT = 100; @implementation XCUIElement (FBTVFocuse) @@ -55,3 +57,5 @@ -(BOOL)fb_selectWithError:(NSError**) error return result; } @end + +#endif diff --git a/WebDriverAgentLib/Commands/FBElementCommands.m b/WebDriverAgentLib/Commands/FBElementCommands.m index d1e579799..7049e80c9 100644 --- a/WebDriverAgentLib/Commands/FBElementCommands.m +++ b/WebDriverAgentLib/Commands/FBElementCommands.m @@ -406,11 +406,14 @@ + (NSArray *)routes return FBResponseWithOK(); } -#if !TARGET_OS_TV + (id)handleGetWindowSize:(FBRouteRequest *)request { +#if TARGET_OS_TV + CGSize screenSize = request.session.activeApplication.frame.size; +#else CGRect frame = request.session.activeApplication.wdFrame; CGSize screenSize = FBAdjustDimensionsForApplication(frame.size, request.session.activeApplication.interfaceOrientation); +#endif return FBResponseWithStatus(FBCommandStatusNoError, @{ @"width": @(screenSize.width), @"height": @(screenSize.height), @@ -432,6 +435,8 @@ + (NSArray *)routes static const CGFloat DEFAULT_OFFSET = (CGFloat)0.2; +#if !TARGET_OS_TV + + (id)handleWheelSelect:(FBRouteRequest *)request { FBElementCache *elementCache = request.session.elementCache; @@ -462,8 +467,12 @@ + (NSArray *)routes return FBResponseWithOK(); } +#endif + #pragma mark - Helpers +#if !TARGET_OS_TV + + (id)handleScrollElementToVisible:(XCUIElement *)element withRequest:(FBRouteRequest *)request { NSError *error; @@ -533,7 +542,6 @@ + (XCUICoordinate *)gestureCoordinateWithCoordinate:(CGPoint)coordinate element: XCUICoordinate *appCoordinate = [[XCUICoordinate alloc] initWithElement:element normalizedOffset:CGVectorMake(0, 0)]; return [[XCUICoordinate alloc] initWithCoordinate:appCoordinate pointsOffset:CGVectorMake(coordinate.x, coordinate.y)]; } - #endif @end diff --git a/WebDriverAgentLib/FBSpringboardApplication.m b/WebDriverAgentLib/FBSpringboardApplication.m index 31709e382..73a43000e 100644 --- a/WebDriverAgentLib/FBSpringboardApplication.m +++ b/WebDriverAgentLib/FBSpringboardApplication.m @@ -19,14 +19,15 @@ #import "XCUIElement+FBUtilities.h" #import "XCUIElement+FBTap.h" #import "XCUIElement+FBScrolling.h" -#import "XCUIElement+FBTVFocuse.h" #import "XCUIElement.h" #import "XCUIElementQuery.h" -#if TARGET_OS_IOS -NSString *const SPRINGBOARD_BUNDLE_ID = @"com.apple.springboard"; -#elif TARGET_OS_TV +#if TARGET_OS_TV +#import "XCUIElement+FBTVFocuse.h" + NSString *const SPRINGBOARD_BUNDLE_ID = @"com.apple.HeadBoard"; +#else +NSString *const SPRINGBOARD_BUNDLE_ID = @"com.apple.springboard"; #endif @implementation FBSpringboardApplication @@ -41,12 +42,15 @@ + (instancetype)fb_springboard return _springboardApp; } +/** + * Returns proper identifier + **/ - (BOOL)fb_openApplicationWithIdentifier:(NSString *)identifier error:(NSError **)error { -#if TARGET_OS_IOS - return [self fb_tapApplicationWithIdentifier:identifier error:error]; +#if TARGET_OS_TV + return [self fb_selectApplicationWithIdentifier:identifier error:error]; #else - return [self fb_selectApplicationWithIdentifier:identifier error:error]; + return [self fb_tapApplicationWithIdentifier:identifier error:error]; #endif } @@ -101,12 +105,11 @@ - (BOOL)fb_tapApplicationWithIdentifier:(NSString *)identifier error:(NSError ** } #elif TARGET_OS_TV - - (BOOL)fb_selectApplicationWithIdentifier:(NSString *)identifier error:(NSError **)error { XCUIElementQuery *appElementsQuery = [[self descendantsMatchingType:XCUIElementTypeIcon] matchingIdentifier:identifier]; - NSArray *matchedAppElements = [appElementsQuery allElementsBoundByIndex]; - if (0 == matchedAppElements.count) { + NSArray *matchedAppElements = appElementsQuery.allElementsBoundByIndex; + if (matchedAppElements.count == 0) { return [[[FBErrorBuilder builder] withDescriptionFormat:@"Cannot locate Headboard icon for '%@' application", identifier] buildError:error]; @@ -144,13 +147,12 @@ - (BOOL)fb_waitUntilApplicationBoardIsVisible:(NSError **)error - (BOOL)fb_isApplicationBoardVisible { [self resolve]; - -#if TARGET_OS_IOS +#if TARGET_OS_TV + return self.collectionViews[@"GridCollectionView"].isEnabled; +#else // the dock (and other icons) don't seem to be consistently reported as // visible. esp on iOS 11 but also on 10.3.3 return self.otherElements[@"Dock"].isEnabled; -#elif TARGET_OS_TV - return self.collectionViews[@"GridCollectionView"].isEnabled; #endif } diff --git a/WebDriverAgentLib/Routing/FBElementUtils.h b/WebDriverAgentLib/Routing/FBElementUtils.h index d31b79f8e..808bfec33 100644 --- a/WebDriverAgentLib/Routing/FBElementUtils.h +++ b/WebDriverAgentLib/Routing/FBElementUtils.h @@ -55,14 +55,6 @@ extern NSString *const FBUnknownAttributeException; */ + (NSString *)uidWithAccessibilityElement:(XCAccessibilityElement *)element; -/** - Gets the unique identifier of the particular XCAccessibilityElement instance. - - @param element accessiblity element instance - @return the unique element identifier - */ -+ (NSString *)uidWithAccessibilityElement:(XCAccessibilityElement *)element; - @end NS_ASSUME_NONNULL_END diff --git a/WebDriverAgentLib/Utilities/FBImageUtils.h b/WebDriverAgentLib/Utilities/FBImageUtils.h index a3d78575f..59dc3e85a 100644 --- a/WebDriverAgentLib/Utilities/FBImageUtils.h +++ b/WebDriverAgentLib/Utilities/FBImageUtils.h @@ -15,7 +15,9 @@ BOOL FBIsJpegImage(NSData *imageData); /*! Returns YES if the data contains a PNG image */ BOOL FBIsPngImage(NSData *imageData); -#if !TARGET_OS_TV +#if TARGET_OS_TV +NSData *FBAdjustScreenshotOrientationForApplication(NSData *screenshotData); +#else /*! Fixes the screenshot orientation if necessary to match current screen orientation */ NSData *FBAdjustScreenshotOrientationForApplication(NSData *screenshotData, UIInterfaceOrientation orientation); #endif diff --git a/WebDriverAgentLib/Utilities/FBImageUtils.m b/WebDriverAgentLib/Utilities/FBImageUtils.m index 66ef7bea7..1c5450d4f 100644 --- a/WebDriverAgentLib/Utilities/FBImageUtils.m +++ b/WebDriverAgentLib/Utilities/FBImageUtils.m @@ -54,7 +54,16 @@ BOOL FBIsPngImage(NSData *imageData) return range.location != NSNotFound; } -#if !TARGET_OS_TV +#if TARGET_OS_TV +NSData *FBAdjustScreenshotOrientationForApplication(NSData *screenshotData) +{ + if (FBIsPngImage(screenshotData)) { + return screenshotData; + } + UIImage *image = [UIImage imageWithData:screenshotData]; + return (NSData *)UIImagePNGRepresentation(image); +} +#else NSData *FBAdjustScreenshotOrientationForApplication(NSData *screenshotData, UIInterfaceOrientation orientation) { UIImageOrientation imageOrientation; From c247ab2c33702eebaefdafa1ab7fb18806b8f391 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Tue, 19 Mar 2019 21:53:59 +0900 Subject: [PATCH 04/16] tweak target os tv --- WebDriverAgentLib/Commands/FBCustomCommands.m | 2 ++ WebDriverAgentLib/Commands/FBElementCommands.m | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/WebDriverAgentLib/Commands/FBCustomCommands.m b/WebDriverAgentLib/Commands/FBCustomCommands.m index d8de16abf..ad6894cad 100644 --- a/WebDriverAgentLib/Commands/FBCustomCommands.m +++ b/WebDriverAgentLib/Commands/FBCustomCommands.m @@ -48,9 +48,11 @@ + (NSArray *)routes [[FBRoute GET:@"/wda/screen"] respondWithTarget:self action:@selector(handleGetScreen:)], [[FBRoute GET:@"/wda/activeAppInfo"] respondWithTarget:self action:@selector(handleActiveAppInfo:)], [[FBRoute GET:@"/wda/activeAppInfo"].withoutSession respondWithTarget:self action:@selector(handleActiveAppInfo:)], +#if !TARGET_OS_TV // tvOS does not provide relevant APIs [[FBRoute POST:@"/wda/setPasteboard"] respondWithTarget:self action:@selector(handleSetPasteboard:)], [[FBRoute POST:@"/wda/getPasteboard"] respondWithTarget:self action:@selector(handleGetPasteboard:)], [[FBRoute GET:@"/wda/batteryInfo"] respondWithTarget:self action:@selector(handleGetBatteryInfo:)], +#endif [[FBRoute POST:@"/wda/pressButton"] respondWithTarget:self action:@selector(handlePressButtonCommand:)], [[FBRoute POST:@"/wda/siri/activate"] respondWithTarget:self action:@selector(handleActivateSiri:)], ]; diff --git a/WebDriverAgentLib/Commands/FBElementCommands.m b/WebDriverAgentLib/Commands/FBElementCommands.m index 7049e80c9..5308d903a 100644 --- a/WebDriverAgentLib/Commands/FBElementCommands.m +++ b/WebDriverAgentLib/Commands/FBElementCommands.m @@ -67,6 +67,7 @@ + (NSArray *)routes [[FBRoute GET:@"/screenshot/:uuid"] respondWithTarget:self action:@selector(handleElementScreenshot:)], [[FBRoute GET:@"/wda/element/:uuid/accessible"] respondWithTarget:self action:@selector(handleGetAccessible:)], [[FBRoute GET:@"/wda/element/:uuid/accessibilityContainer"] respondWithTarget:self action:@selector(handleGetIsAccessibilityContainer:)], +#if !TARGET_OS_TV [[FBRoute POST:@"/wda/element/:uuid/swipe"] respondWithTarget:self action:@selector(handleSwipe:)], [[FBRoute POST:@"/wda/element/:uuid/pinch"] respondWithTarget:self action:@selector(handlePinch:)], [[FBRoute POST:@"/wda/element/:uuid/doubleTap"] respondWithTarget:self action:@selector(handleDoubleTap:)], @@ -78,8 +79,9 @@ + (NSArray *)routes [[FBRoute POST:@"/wda/tap/:uuid"] respondWithTarget:self action:@selector(handleTap:)], [[FBRoute POST:@"/wda/touchAndHold"] respondWithTarget:self action:@selector(handleTouchAndHoldCoordinate:)], [[FBRoute POST:@"/wda/doubleTap"] respondWithTarget:self action:@selector(handleDoubleTapCoordinate:)], - [[FBRoute POST:@"/wda/keys"] respondWithTarget:self action:@selector(handleKeys:)], [[FBRoute POST:@"/wda/pickerwheel/:uuid/select"] respondWithTarget:self action:@selector(handleWheelSelect:)], +#endif + [[FBRoute POST:@"/wda/keys"] respondWithTarget:self action:@selector(handleKeys:)], [[FBRoute POST:@"/wda/element/:uuid/forceTouch"] respondWithTarget:self action:@selector(handleForceTouch:)], ]; } @@ -150,7 +152,6 @@ + (NSArray *)routes return FBResponseWithStatus(FBCommandStatusNoError, type); } -#if !TARGET_OS_TV + (id)handleSetValue:(FBRouteRequest *)request { FBElementCache *elementCache = request.session.elementCache; @@ -164,10 +165,12 @@ + (NSArray *)routes if ([value isKindOfClass:[NSArray class]]) { textToType = [value componentsJoinedByString:@""]; } +#if !TARGET_OS_TV if (element.elementType == XCUIElementTypePickerWheel) { [element adjustToPickerWheelValue:textToType]; return FBResponseWithOK(); } +#endif if (element.elementType == XCUIElementTypeSlider) { CGFloat sliderValue = textToType.floatValue; if (sliderValue < 0.0 || sliderValue > 1.0 ) { @@ -183,7 +186,6 @@ + (NSArray *)routes } return FBResponseWithElementUUID(elementUUID); } -#endif + (id)handleClick:(FBRouteRequest *)request { @@ -249,6 +251,7 @@ + (NSArray *)routes [pressCoordinate pressForDuration:[request.arguments[@"duration"] doubleValue]]; return FBResponseWithOK(); } +#endif + (id)handleForceTouch:(FBRouteRequest *)request { @@ -270,6 +273,7 @@ + (NSArray *)routes return FBResponseWithOK(); } +#if !TARGET_OS_TV + (id)handleScroll:(FBRouteRequest *)request { FBElementCache *elementCache = request.session.elementCache; From 40a70963cde318aab8774143bf5ec002ea8cac0a Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Thu, 21 Mar 2019 18:29:44 +0900 Subject: [PATCH 05/16] add travis --- .travis.yml | 17 +++++++++++++++++ Cartfile | 2 +- Cartfile.resolved | 2 +- Scripts/build.sh | 5 +++++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3d3383034..e77238f8b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -98,3 +98,20 @@ matrix: - os: osx osx_image: xcode10.2 env: IPHONE_MODEL="iPhone X" IPAD_MODEL="iPad Air 2" IOS_VERSION="12.2" ACTION=int_test_3 DEST=ipad TARGET=lib SDK=sim + + # Builds + - os: osx + osx_image: xcode9.2 + env: DEST=tv TV_MODEL="Apple TV" TV_VERSION="11.2" ACTION=build TARGET=tv_runner SDK=tv_sim + # Analyze + - os: osx + osx_image: xcode9.2 + env: DEST=tv TV_MODEL="Apple TV" TV_VERSION="11.2" ACTION=analyze TARGET=tv_runner SDK=tv_sim + # Builds + - os: osx + osx_image: xcode10.2 + env: DEST=tv TV_MODEL="Apple TV" TV_VERSION="12.2" ACTION=build TARGET=tv_runner SDK=tv_sim + # Analyze + - os: osx + osx_image: xcode10.2 + env: DEST=tv TV_MODEL="Apple TV" TV_VERSION="12.2" ACTION=analyze TARGET=tv_runner SDK=tv_sim diff --git a/Cartfile b/Cartfile index aae972220..ac08b28bc 100644 --- a/Cartfile +++ b/Cartfile @@ -2,7 +2,7 @@ github "appium/RoutingHTTPServer" # Used by the element cache -github "KazuCocoa/YYCache" "master" +github "KazuCocoa/YYCache" "add-tvos-support" # Used by screenshots broadcaster github "robbiehanson/CocoaAsyncSocket" diff --git a/Cartfile.resolved b/Cartfile.resolved index fa5f1e532..70fd34e63 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,3 +1,3 @@ -git "/Users/kazu/GitHub/YYCache" "06a2997117dd587e6a3206f19ad808993703b69f" +github "KazuCocoa/YYCache" "caee2af85b765738f450952a8e177571e31473ee" github "appium/RoutingHTTPServer" "v1.0.2" github "robbiehanson/CocoaAsyncSocket" "7.6.3" diff --git a/Scripts/build.sh b/Scripts/build.sh index da5b3ca75..2c44d42bb 100755 --- a/Scripts/build.sh +++ b/Scripts/build.sh @@ -16,12 +16,15 @@ function define_xc_macros() { case "$TARGET" in "lib" ) XC_TARGET="WebDriverAgentLib";; "runner" ) XC_TARGET="WebDriverAgentRunner";; + "tv_lib" ) XC_TARGET="WebDriverAgentLib_tvOS";; + "tv_runner" ) XC_TARGET="WebDriverAgentRunner_tvOS";; *) echo "Unknown TARGET"; exit 1 ;; esac case "${DEST:-}" in "iphone" ) XC_DESTINATION="-destination \"name=${IPHONE_MODEL},OS=${IOS_VERSION}\"";; "ipad" ) XC_DESTINATION="-destination \"name=${IPAD_MODEL},OS=${IOS_VERSION}\"";; + "tv" ) XC_DESTINATION="-destination \"name=${TV_MODEL},OS=${TV_VERSION}\"";; esac case "$ACTION" in @@ -40,6 +43,8 @@ function define_xc_macros() { case "$SDK" in "sim" ) XC_SDK="iphonesimulator";; "device" ) XC_SDK="iphoneos";; + "tv_sim" ) XC_SDK="appletvos";; + "tv_device" ) XC_SDK="appletvsimulator";; *) echo "Unknown SDK"; exit 1 ;; esac } From 83b5b2e0642e7ca65ea510be79c0df3af2697eb5 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Fri, 22 Mar 2019 09:15:31 +0900 Subject: [PATCH 06/16] get rid of xcode9.2 build because of no destination --- .travis.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index e77238f8b..0b411d657 100644 --- a/.travis.yml +++ b/.travis.yml @@ -100,14 +100,6 @@ matrix: env: IPHONE_MODEL="iPhone X" IPAD_MODEL="iPad Air 2" IOS_VERSION="12.2" ACTION=int_test_3 DEST=ipad TARGET=lib SDK=sim # Builds - - os: osx - osx_image: xcode9.2 - env: DEST=tv TV_MODEL="Apple TV" TV_VERSION="11.2" ACTION=build TARGET=tv_runner SDK=tv_sim - # Analyze - - os: osx - osx_image: xcode9.2 - env: DEST=tv TV_MODEL="Apple TV" TV_VERSION="11.2" ACTION=analyze TARGET=tv_runner SDK=tv_sim - # Builds - os: osx osx_image: xcode10.2 env: DEST=tv TV_MODEL="Apple TV" TV_VERSION="12.2" ACTION=build TARGET=tv_runner SDK=tv_sim From b22c2962c5fd93032a20c1c40a69b5d8c887e979 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Fri, 22 Mar 2019 18:19:19 +0900 Subject: [PATCH 07/16] update yycache to use 1.1.0 --- Cartfile | 2 +- Cartfile.resolved | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cartfile b/Cartfile index ac08b28bc..f96df7698 100644 --- a/Cartfile +++ b/Cartfile @@ -2,7 +2,7 @@ github "appium/RoutingHTTPServer" # Used by the element cache -github "KazuCocoa/YYCache" "add-tvos-support" +github "appium/YYCache" # Used by screenshots broadcaster github "robbiehanson/CocoaAsyncSocket" diff --git a/Cartfile.resolved b/Cartfile.resolved index 70fd34e63..142b5b868 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,3 +1,3 @@ -github "KazuCocoa/YYCache" "caee2af85b765738f450952a8e177571e31473ee" github "appium/RoutingHTTPServer" "v1.0.2" +github "appium/YYCache" "1.1.0" github "robbiehanson/CocoaAsyncSocket" "7.6.3" From 23c22dd16964bfabd9cbf0f46a2d50e0a7f6cbc3 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Fri, 22 Mar 2019 19:11:05 +0900 Subject: [PATCH 08/16] fix fbtvfocuse --- .../Categories/XCUIElement+FBTVFocuse.h | 16 ++++++- .../Categories/XCUIElement+FBTVFocuse.m | 45 +++++++++++-------- 2 files changed, 40 insertions(+), 21 deletions(-) diff --git a/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.h b/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.h index 81763ed4c..761c6bacf 100644 --- a/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.h +++ b/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.h @@ -14,9 +14,21 @@ NS_ASSUME_NONNULL_BEGIN #if TARGET_OS_TV @interface XCUIElement (FBTVFocuse) --(BOOL)fb_focuseWithError:(NSError**) error; +/** + Sets focuse + + @param error If there is an error, upon return contains an NSError object that describes the problem. + @return YES if the operation succeeds, otherwise NO. + */ +- (BOOL)fb_setFocusWithError:(NSError**) error; --(BOOL)fb_selectWithError:(NSError**) error; +/** + Select a focused element + + @param error If there is an error, upon return contains an NSError object that describes the problem. + @return YES if the operation succeeds, otherwise NO. + */ +- (BOOL)fb_selectWithError:(NSError**) error; @end #endif diff --git a/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m b/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m index 2158929be..c85732be1 100644 --- a/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m +++ b/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m @@ -22,35 +22,42 @@ @implementation XCUIElement (FBTVFocuse) --(BOOL)fb_focuseWithError:(NSError**) error +- (BOOL)fb_setFocusWithError:(NSError**) error { [[FBApplication fb_activeApplication] fb_waitUntilSnapshotIsStable]; - if (self.wdEnabled) { - FBTVNavigationTracker *tracker = [FBTVNavigationTracker trackerWithTargetElement:self]; - for (int i = 0; i < MAX_ITERATIONS_COUNT; i++) { - if (self.hasFocus) { - return YES; - } - if (self.exists) { - FBTVDirection direction = tracker.directionToMoveFocuse; - if(direction != FBTVDirectionNone) { - [[XCUIRemote sharedRemote] pressButton: (XCUIRemoteButton)direction]; - continue; - } + + if (!self.wdEnabled) { + if (error) { + *error = [[FBErrorBuilder.builder withDescription:@"Element could not be focused."] build]; + } + return NO; + } + + FBTVNavigationTracker *tracker = [FBTVNavigationTracker trackerWithTargetElement:self]; + for (int i = 0; i < MAX_ITERATIONS_COUNT; i++) { + if (self.hasFocus) { + return YES; + } + + if (!self.exists) { + if (error) { + *error = [[FBErrorBuilder.builder withDescription:@"Unable to reach element. Try to use XCUIRemote commands."] build]; } - [[[FBErrorBuilder builder] withDescription:@"Unable to reach element. Try to use XCUIRemote commands."] - buildError:error]; return NO; } + + FBTVDirection direction = tracker.directionToMoveFocuse; + if (direction != FBTVDirectionNone) { + [[XCUIRemote sharedRemote] pressButton: (XCUIRemoteButton)direction]; + } } - [[[FBErrorBuilder builder] withDescription:@"Element could not be focused."] - buildError:error]; + return NO; } --(BOOL)fb_selectWithError:(NSError**) error +- (BOOL)fb_selectWithError:(NSError**) error { - BOOL result = [self fb_focuseWithError: error]; + BOOL result = [self fb_setFocusWithError: error]; if (result) { [[XCUIRemote sharedRemote] pressButton:XCUIRemoteButtonSelect]; } From b78b1b7dd56cad1e554e7292930c52335055c1b4 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Fri, 22 Mar 2019 19:16:05 +0900 Subject: [PATCH 09/16] fix FBSpringboardApplication --- WebDriverAgentLib/FBSpringboardApplication.m | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/WebDriverAgentLib/FBSpringboardApplication.m b/WebDriverAgentLib/FBSpringboardApplication.m index 73a43000e..6ff4d1fee 100644 --- a/WebDriverAgentLib/FBSpringboardApplication.m +++ b/WebDriverAgentLib/FBSpringboardApplication.m @@ -42,9 +42,6 @@ + (instancetype)fb_springboard return _springboardApp; } -/** - * Returns proper identifier - **/ - (BOOL)fb_openApplicationWithIdentifier:(NSString *)identifier error:(NSError **)error { #if TARGET_OS_TV @@ -119,7 +116,6 @@ - (BOOL)fb_selectApplicationWithIdentifier:(NSString *)identifier error:(NSError if (![appElement fb_selectWithError:error]) { return NO; } - [[XCUIRemote sharedRemote] pressButton: XCUIRemoteButtonSelect]; return [[[[FBRunLoopSpinner new] interval:0.3] @@ -148,6 +144,7 @@ - (BOOL)fb_isApplicationBoardVisible { [self resolve]; #if TARGET_OS_TV + // TODO: Make sure witth inspector again return self.collectionViews[@"GridCollectionView"].isEnabled; #else // the dock (and other icons) don't seem to be consistently reported as From cd64a4c66cd321defb97e48e201e63a8e9aad4ef Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Fri, 22 Mar 2019 19:40:36 +0900 Subject: [PATCH 10/16] cache hasFocuse --- .../Categories/XCUIElement+FBWebDriverAttributes.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.m b/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.m index defea2a5f..69ff53fce 100644 --- a/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.m +++ b/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.m @@ -195,7 +195,11 @@ - (BOOL)isWDVisible - (BOOL)isWDFocused { - return self.hasFocus; + id (^getter)(void) = ^id(void) { + return @(self.hasFocus); + }; + + return [[self fb_cachedValueWithAttributeName:@"hasFocus" valueGetter:getter] boolValue]; } #endif From 9c8043b9e1692664632d7be5e7de399a848cf322 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Fri, 22 Mar 2019 19:50:35 +0900 Subject: [PATCH 11/16] fix FBTVNavigationTracker --- .../Utilities/FBTVNavigationTracker.h | 15 +++++++++++++++ .../Utilities/FBTVNavigationTracker.m | 17 +++++++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/WebDriverAgentLib/Utilities/FBTVNavigationTracker.h b/WebDriverAgentLib/Utilities/FBTVNavigationTracker.h index a82633d3d..5f068b8db 100644 --- a/WebDriverAgentLib/Utilities/FBTVNavigationTracker.h +++ b/WebDriverAgentLib/Utilities/FBTVNavigationTracker.h @@ -11,6 +11,11 @@ #import #import "FBElement.h" +#if TARGET_OS_TV + +/** + Defines directions to move focuse to. + */ typedef NS_ENUM(NSUInteger, FBTVDirection) { FBTVDirectionUp = 0, FBTVDirectionDown = 1, @@ -23,10 +28,20 @@ NS_ASSUME_NONNULL_BEGIN @interface FBTVNavigationTracker : NSObject + /** + Track the target element's point + @param targetElement A target element which will track + @return An instancce of FBTVNavigationTracker + */ +(instancetype)trackerWithTargetElement: (id) targetElement; + /** + Move focuse to the tracked target element from current focuse + */ -(FBTVDirection)directionToMoveFocuse; @end NS_ASSUME_NONNULL_END + +#endif diff --git a/WebDriverAgentLib/Utilities/FBTVNavigationTracker.m b/WebDriverAgentLib/Utilities/FBTVNavigationTracker.m index 58c2237c3..85c019569 100644 --- a/WebDriverAgentLib/Utilities/FBTVNavigationTracker.m +++ b/WebDriverAgentLib/Utilities/FBTVNavigationTracker.m @@ -15,8 +15,10 @@ #import "XCUIElement+FBUtilities.h" #import "XCUIElement+FBWebDriverAttributes.h" +#if TARGET_OS_TV + @interface FBTVNavigationItem : NSObject -@property (nonatomic, assign) NSUInteger uid; +@property (nonatomic, readonly) NSUInteger uid; @property (nonatomic, strong) NSMutableSet* directions; + (instancetype)itemWithUid:(NSUInteger) uid; @@ -75,7 +77,7 @@ - (FBTVDirection)directionToMoveFocuse CGFloat yDelta = self.targetCenter.y - focusedCenter.y; CGFloat xDelta = self.targetCenter.x - focusedCenter.x; FBTVDirection direction; - if(fabs(yDelta) > fabs(xDelta)) { + if (fabs(yDelta) > fabs(xDelta)) { direction = [self getVerticalDirectionForItem:item withDelta:yDelta]; if (direction == FBTVDirectionNone) { direction = [self getHorizontalDirectionForItem:item withDelta:xDelta]; @@ -96,8 +98,7 @@ - (FBTVDirection)directionToMoveFocuse return [FBApplication fb_activeApplication].fb_focusedElement; } --(FBTVNavigationItem*) navigationItemFromElement:(id)element - +- (FBTVNavigationItem*) navigationItemFromElement:(id)element { NSNumber *key = [NSNumber numberWithUnsignedInteger:element.wdUID]; FBTVNavigationItem* item = [self.navigationItems objectForKey: key]; @@ -109,7 +110,8 @@ -(FBTVNavigationItem*) navigationItemFromElement:(id)element return item; } -- (FBTVDirection)getHorizontalDirectionForItem:(FBTVNavigationItem *)item withDelta:(CGFloat)delta { +- (FBTVDirection)getHorizontalDirectionForItem:(FBTVNavigationItem *)item withDelta:(CGFloat)delta +{ if (delta > 0) { if(![item.directions containsObject: [NSNumber numberWithInteger: FBTVDirectionRight]]) { [item.directions addObject: [NSNumber numberWithInteger: FBTVDirectionRight]]; @@ -125,7 +127,8 @@ - (FBTVDirection)getHorizontalDirectionForItem:(FBTVNavigationItem *)item withDe return FBTVDirectionNone; } -- (FBTVDirection)getVerticalDirectionForItem:(FBTVNavigationItem *)item withDelta:(CGFloat)delta { +- (FBTVDirection)getVerticalDirectionForItem:(FBTVNavigationItem *)item withDelta:(CGFloat)delta +{ if (delta > 0) { if(![item.directions containsObject: [NSNumber numberWithInteger: FBTVDirectionDown]]) { [item.directions addObject: [NSNumber numberWithInteger: FBTVDirectionDown]]; @@ -142,3 +145,5 @@ - (FBTVDirection)getVerticalDirectionForItem:(FBTVNavigationItem *)item withDelt } @end + +#endif From 5f67634d1a91c6d3d69799cc45370e551917b109 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Sat, 23 Mar 2019 12:08:04 +0900 Subject: [PATCH 12/16] fix review --- WebDriverAgentLib copy-Info.plist | 26 ----------- .../Categories/XCUIApplication+FBFocused.h | 2 +- .../Categories/XCUIElement+FBTVFocuse.h | 2 +- .../Categories/XCUIElement+FBTVFocuse.m | 2 +- .../Categories/XCUIElement+FBTyping.m | 3 +- WebDriverAgentLib/FBSpringboardApplication.h | 1 + .../Utilities/FBTVNavigationTracker.h | 29 ++++++------ .../Utilities/FBTVNavigationTracker.m | 46 +++++++++---------- 8 files changed, 43 insertions(+), 68 deletions(-) delete mode 100644 WebDriverAgentLib copy-Info.plist diff --git a/WebDriverAgentLib copy-Info.plist b/WebDriverAgentLib copy-Info.plist deleted file mode 100644 index 1b89f4fcd..000000000 --- a/WebDriverAgentLib copy-Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - com.facebook.wda.lib - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSPrincipalClass - - - diff --git a/WebDriverAgentLib/Categories/XCUIApplication+FBFocused.h b/WebDriverAgentLib/Categories/XCUIApplication+FBFocused.h index 29f867c66..933057879 100644 --- a/WebDriverAgentLib/Categories/XCUIApplication+FBFocused.h +++ b/WebDriverAgentLib/Categories/XCUIApplication+FBFocused.h @@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN /** Return current focused element */ -- (id) fb_focusedElement; +- (id)fb_focusedElement; @end diff --git a/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.h b/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.h index 761c6bacf..6b25f9ab4 100644 --- a/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.h +++ b/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.h @@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN @interface XCUIElement (FBTVFocuse) /** - Sets focuse + Sets focus @param error If there is an error, upon return contains an NSError object that describes the problem. @return YES if the operation succeeds, otherwise NO. diff --git a/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m b/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m index c85732be1..fb0588a8b 100644 --- a/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m +++ b/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m @@ -46,7 +46,7 @@ - (BOOL)fb_setFocusWithError:(NSError**) error return NO; } - FBTVDirection direction = tracker.directionToMoveFocuse; + FBTVDirection direction = tracker.directionToFocusedElement; if (direction != FBTVDirectionNone) { [[XCUIRemote sharedRemote] pressButton: (XCUIRemoteButton)direction]; } diff --git a/WebDriverAgentLib/Categories/XCUIElement+FBTyping.m b/WebDriverAgentLib/Categories/XCUIElement+FBTyping.m index aa377b786..db07bf9c2 100644 --- a/WebDriverAgentLib/Categories/XCUIElement+FBTyping.m +++ b/WebDriverAgentLib/Categories/XCUIElement+FBTyping.m @@ -51,8 +51,7 @@ - (BOOL)fb_typeText:(NSString *)text frequency:(NSUInteger)frequency error:(NSEr // There is no ability to open text field via tap #if TARGET_OS_TV if (!self.hasKeyboardFocus) { - [[[FBErrorBuilder builder] withDescription:@"Keyboard is not opened."] buildError:error]; - return NO; + return [[[FBErrorBuilder builder] withDescription:@"Keyboard is not opened."] buildError:error]; } #else if (![self fb_prepareForTextInputWithError:error]) { diff --git a/WebDriverAgentLib/FBSpringboardApplication.h b/WebDriverAgentLib/FBSpringboardApplication.h index 75406aff1..c42ae1941 100644 --- a/WebDriverAgentLib/FBSpringboardApplication.h +++ b/WebDriverAgentLib/FBSpringboardApplication.h @@ -23,6 +23,7 @@ extern NSString *const SPRINGBOARD_BUNDLE_ID; /** Opens application on SpringBoard(HeadBoard) app with given identifier + @param identifier identifier of the application to tap @param error If there is an error, upon return contains an NSError object that describes the problem. @return YES if the operation succeeds, otherwise NO. diff --git a/WebDriverAgentLib/Utilities/FBTVNavigationTracker.h b/WebDriverAgentLib/Utilities/FBTVNavigationTracker.h index 5f068b8db..8fe90f2bc 100644 --- a/WebDriverAgentLib/Utilities/FBTVNavigationTracker.h +++ b/WebDriverAgentLib/Utilities/FBTVNavigationTracker.h @@ -28,19 +28,22 @@ NS_ASSUME_NONNULL_BEGIN @interface FBTVNavigationTracker : NSObject - /** - Track the target element's point - @param targetElement A target element which will track - @return An instancce of FBTVNavigationTracker - */ - +(instancetype)trackerWithTargetElement: (id) targetElement; - - /** - Move focuse to the tracked target element from current focuse - */ - -(FBTVDirection)directionToMoveFocuse; - - @end +/** + Track the target element's point + + @param targetElement A target element which will track + @return An instancce of FBTVNavigationTracker + */ ++ (instancetype)trackerWithTargetElement: (id) targetElement; + +/** + Move the focus to the tracked target element from the currently focused one + + @return FBTVDirection to move the focus to + */ +- (FBTVDirection)directionToFocusedElement; + +@end NS_ASSUME_NONNULL_END diff --git a/WebDriverAgentLib/Utilities/FBTVNavigationTracker.m b/WebDriverAgentLib/Utilities/FBTVNavigationTracker.m index 85c019569..b664f228b 100644 --- a/WebDriverAgentLib/Utilities/FBTVNavigationTracker.m +++ b/WebDriverAgentLib/Utilities/FBTVNavigationTracker.m @@ -19,7 +19,7 @@ @interface FBTVNavigationItem : NSObject @property (nonatomic, readonly) NSUInteger uid; -@property (nonatomic, strong) NSMutableSet* directions; +@property (nonatomic, readonly) NSMutableSet* directions; + (instancetype)itemWithUid:(NSUInteger) uid; @end @@ -69,11 +69,11 @@ - (instancetype)initWithTargetElement:(id)targetElement return self; } -- (FBTVDirection)directionToMoveFocuse +- (FBTVDirection)directionToFocusedElement { id focused = self.focusedElement; CGPoint focusedCenter = FBRectGetCenter(focused.wdFrame); - FBTVNavigationItem *item = [self navigationItemFromElement:focused]; + FBTVNavigationItem *item = [self navigationItemWithElement:focused]; CGFloat yDelta = self.targetCenter.y - focusedCenter.y; CGFloat xDelta = self.targetCenter.x - focusedCenter.x; FBTVDirection direction; @@ -98,7 +98,7 @@ - (FBTVDirection)directionToMoveFocuse return [FBApplication fb_activeApplication].fb_focusedElement; } -- (FBTVNavigationItem*) navigationItemFromElement:(id)element +- (FBTVNavigationItem*)navigationItemWithElement:(id)element { NSNumber *key = [NSNumber numberWithUnsignedInteger:element.wdUID]; FBTVNavigationItem* item = [self.navigationItems objectForKey: key]; @@ -112,34 +112,32 @@ - (FBTVNavigationItem*) navigationItemFromElement:(id)element - (FBTVDirection)getHorizontalDirectionForItem:(FBTVNavigationItem *)item withDelta:(CGFloat)delta { - if (delta > 0) { - if(![item.directions containsObject: [NSNumber numberWithInteger: FBTVDirectionRight]]) { - [item.directions addObject: [NSNumber numberWithInteger: FBTVDirectionRight]]; - return FBTVDirectionRight; - } + // GCFloat is double in 64bit. tvOS is only for arm64 + if (delta > DBL_EPSILON && + ![item.directions containsObject: [NSNumber numberWithInteger: FBTVDirectionRight]]) { + [item.directions addObject: [NSNumber numberWithInteger: FBTVDirectionRight]]; + return FBTVDirectionRight; } - if (delta < 0) { - if(![item.directions containsObject: [NSNumber numberWithInteger: FBTVDirectionLeft]]) { - [item.directions addObject: [NSNumber numberWithInteger: FBTVDirectionLeft]]; - return FBTVDirectionLeft; - } + if (delta < DBL_EPSILON && + ![item.directions containsObject: [NSNumber numberWithInteger: FBTVDirectionLeft]]) { + [item.directions addObject: [NSNumber numberWithInteger: FBTVDirectionLeft]]; + return FBTVDirectionLeft; } return FBTVDirectionNone; } - (FBTVDirection)getVerticalDirectionForItem:(FBTVNavigationItem *)item withDelta:(CGFloat)delta { - if (delta > 0) { - if(![item.directions containsObject: [NSNumber numberWithInteger: FBTVDirectionDown]]) { - [item.directions addObject: [NSNumber numberWithInteger: FBTVDirectionDown]]; - return FBTVDirectionDown; - } + // GCFloat is double in 64bit. tvOS is only for arm64 + if (delta > DBL_EPSILON && + ![item.directions containsObject: [NSNumber numberWithInteger: FBTVDirectionDown]]) { + [item.directions addObject: [NSNumber numberWithInteger: FBTVDirectionDown]]; + return FBTVDirectionDown; } - if (delta < 0) { - if(![item.directions containsObject: [NSNumber numberWithInteger: FBTVDirectionUp]]) { - [item.directions addObject: [NSNumber numberWithInteger: FBTVDirectionUp]]; - return FBTVDirectionUp; - } + if (delta < DBL_EPSILON && + ![item.directions containsObject: [NSNumber numberWithInteger: FBTVDirectionUp]]) { + [item.directions addObject: [NSNumber numberWithInteger: FBTVDirectionUp]]; + return FBTVDirectionUp; } return FBTVDirectionNone; } From 4a22b192117097aa492d83f5b31deefabe9d0f07 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Sat, 23 Mar 2019 12:15:40 +0900 Subject: [PATCH 13/16] arrange indentations, enable isWDFocused for both ios and tvos --- WebDriverAgentLib/Categories/XCUIApplication+FBFocused.h | 8 ++++---- WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m | 3 --- .../Categories/XCUIElement+FBWebDriverAttributes.m | 4 ---- WebDriverAgentLib/Routing/FBElement.h | 2 -- 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/WebDriverAgentLib/Categories/XCUIApplication+FBFocused.h b/WebDriverAgentLib/Categories/XCUIApplication+FBFocused.h index 933057879..6951e760c 100644 --- a/WebDriverAgentLib/Categories/XCUIApplication+FBFocused.h +++ b/WebDriverAgentLib/Categories/XCUIApplication+FBFocused.h @@ -14,11 +14,11 @@ NS_ASSUME_NONNULL_BEGIN @interface XCUIApplication (FBFocused) - /** - Return current focused element - */ +/** + Return current focused element + */ - (id)fb_focusedElement; - @end +@end NS_ASSUME_NONNULL_END diff --git a/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m b/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m index 9c63e9372..b0fe5f6bf 100644 --- a/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m +++ b/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m @@ -91,10 +91,7 @@ + (NSDictionary *)dictionaryForElement:(XCElementSnapshot *)snapshot recursive:( info[@"frame"] = NSStringFromCGRect(snapshot.wdFrame); info[@"isEnabled"] = [@([snapshot isWDEnabled]) stringValue]; info[@"isVisible"] = [@([snapshot isWDVisible]) stringValue]; - -#if TARGET_OS_TV info[@"isFocused"] = [@([snapshot isWDFocused]) stringValue]; -#endif if (!recursive) { return info.copy; diff --git a/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.m b/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.m index 69ff53fce..dfb67a077 100644 --- a/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.m +++ b/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.m @@ -191,8 +191,6 @@ - (BOOL)isWDVisible return [[self fb_cachedValueWithAttributeName:@"isWDVisible" valueGetter:getter] boolValue]; } -#if TARGET_OS_TV - - (BOOL)isWDFocused { id (^getter)(void) = ^id(void) { @@ -202,8 +200,6 @@ - (BOOL)isWDFocused return [[self fb_cachedValueWithAttributeName:@"hasFocus" valueGetter:getter] boolValue]; } -#endif - - (BOOL)isWDAccessible { id (^getter)(void) = ^id(void) { diff --git a/WebDriverAgentLib/Routing/FBElement.h b/WebDriverAgentLib/Routing/FBElement.h index e71c61760..9aeb550a9 100644 --- a/WebDriverAgentLib/Routing/FBElement.h +++ b/WebDriverAgentLib/Routing/FBElement.h @@ -50,10 +50,8 @@ NS_ASSUME_NONNULL_BEGIN /*! Whether element is an accessibility container (contains children of any depth that are accessible) */ @property (nonatomic, readonly, getter = isWDAccessibilityContainer) BOOL wdAccessibilityContainer; -#if TARGET_OS_TV /*! Whether element is focused */ @property (nonatomic, readonly, getter = isWDFocused) BOOL wdFocused; -#endif /** Returns value of given property specified in WebDriver Spec From d7215bdcbaf09673597ce88e0acbac81d29fa7b2 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Sat, 23 Mar 2019 18:25:56 +0900 Subject: [PATCH 14/16] arrange func names, deltas --- .../Utilities/FBTVNavigationTracker.h | 3 ++- .../Utilities/FBTVNavigationTracker.m | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/WebDriverAgentLib/Utilities/FBTVNavigationTracker.h b/WebDriverAgentLib/Utilities/FBTVNavigationTracker.h index 8fe90f2bc..e40dc294b 100644 --- a/WebDriverAgentLib/Utilities/FBTVNavigationTracker.h +++ b/WebDriverAgentLib/Utilities/FBTVNavigationTracker.h @@ -37,7 +37,8 @@ NS_ASSUME_NONNULL_BEGIN + (instancetype)trackerWithTargetElement: (id) targetElement; /** - Move the focus to the tracked target element from the currently focused one + Determine the correct direction to move the focus to the tracked target + element from the currently focused one @return FBTVDirection to move the focus to */ diff --git a/WebDriverAgentLib/Utilities/FBTVNavigationTracker.m b/WebDriverAgentLib/Utilities/FBTVNavigationTracker.m index b664f228b..bd5770955 100644 --- a/WebDriverAgentLib/Utilities/FBTVNavigationTracker.m +++ b/WebDriverAgentLib/Utilities/FBTVNavigationTracker.m @@ -78,14 +78,14 @@ - (FBTVDirection)directionToFocusedElement CGFloat xDelta = self.targetCenter.x - focusedCenter.x; FBTVDirection direction; if (fabs(yDelta) > fabs(xDelta)) { - direction = [self getVerticalDirectionForItem:item withDelta:yDelta]; + direction = [self verticalDirectionWithItem:item andDelta:yDelta]; if (direction == FBTVDirectionNone) { - direction = [self getHorizontalDirectionForItem:item withDelta:xDelta]; + direction = [self horizontalDirectionWithItem:item andDelta:xDelta]; } } else { - direction = [self getHorizontalDirectionForItem:item withDelta:xDelta]; + direction = [self horizontalDirectionWithItem:item andDelta:xDelta]; if (direction == FBTVDirectionNone) { - direction = [self getVerticalDirectionForItem:item withDelta:yDelta]; + direction = [self verticalDirectionWithItem:item andDelta:yDelta]; } } @@ -110,7 +110,7 @@ - (FBTVNavigationItem*)navigationItemWithElement:(id)element return item; } -- (FBTVDirection)getHorizontalDirectionForItem:(FBTVNavigationItem *)item withDelta:(CGFloat)delta +- (FBTVDirection)horizontalDirectionWithItem:(FBTVNavigationItem *)item andDelta:(CGFloat)delta { // GCFloat is double in 64bit. tvOS is only for arm64 if (delta > DBL_EPSILON && @@ -118,7 +118,7 @@ - (FBTVDirection)getHorizontalDirectionForItem:(FBTVNavigationItem *)item withDe [item.directions addObject: [NSNumber numberWithInteger: FBTVDirectionRight]]; return FBTVDirectionRight; } - if (delta < DBL_EPSILON && + if (delta < -DBL_EPSILON && ![item.directions containsObject: [NSNumber numberWithInteger: FBTVDirectionLeft]]) { [item.directions addObject: [NSNumber numberWithInteger: FBTVDirectionLeft]]; return FBTVDirectionLeft; @@ -126,7 +126,7 @@ - (FBTVDirection)getHorizontalDirectionForItem:(FBTVNavigationItem *)item withDe return FBTVDirectionNone; } -- (FBTVDirection)getVerticalDirectionForItem:(FBTVNavigationItem *)item withDelta:(CGFloat)delta +- (FBTVDirection)verticalDirectionWithItem:(FBTVNavigationItem *)item andDelta:(CGFloat)delta { // GCFloat is double in 64bit. tvOS is only for arm64 if (delta > DBL_EPSILON && @@ -134,7 +134,7 @@ - (FBTVDirection)getVerticalDirectionForItem:(FBTVNavigationItem *)item withDelt [item.directions addObject: [NSNumber numberWithInteger: FBTVDirectionDown]]; return FBTVDirectionDown; } - if (delta < DBL_EPSILON && + if (delta < -DBL_EPSILON && ![item.directions containsObject: [NSNumber numberWithInteger: FBTVDirectionUp]]) { [item.directions addObject: [NSNumber numberWithInteger: FBTVDirectionUp]]; return FBTVDirectionUp; From b1b1ab8653c7dac5553bd03a9129034444a577f4 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Sat, 23 Mar 2019 18:52:01 +0900 Subject: [PATCH 15/16] add self.description into error messages --- WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m | 6 ++++-- WebDriverAgentLib/FBSpringboardApplication.m | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m b/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m index fb0588a8b..0808f1bda 100644 --- a/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m +++ b/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m @@ -28,7 +28,8 @@ - (BOOL)fb_setFocusWithError:(NSError**) error if (!self.wdEnabled) { if (error) { - *error = [[FBErrorBuilder.builder withDescription:@"Element could not be focused."] build]; + *error = [[FBErrorBuilder.builder withDescription: + [NSString stringWithFormat:@"'%@' element cannot be focused because it is disabled", self.description]] build]; } return NO; } @@ -41,7 +42,8 @@ - (BOOL)fb_setFocusWithError:(NSError**) error if (!self.exists) { if (error) { - *error = [[FBErrorBuilder.builder withDescription:@"Unable to reach element. Try to use XCUIRemote commands."] build]; + *error = [[FBErrorBuilder.builder withDescription: + [NSString stringWithFormat:@"'%@' element is not reachable because it is not existed. Try to use XCUIRemote commands.", self.description]] build]; } return NO; } diff --git a/WebDriverAgentLib/FBSpringboardApplication.m b/WebDriverAgentLib/FBSpringboardApplication.m index 6ff4d1fee..470d9d83d 100644 --- a/WebDriverAgentLib/FBSpringboardApplication.m +++ b/WebDriverAgentLib/FBSpringboardApplication.m @@ -144,7 +144,7 @@ - (BOOL)fb_isApplicationBoardVisible { [self resolve]; #if TARGET_OS_TV - // TODO: Make sure witth inspector again + // TODO: Make sure the precise locator has been selected return self.collectionViews[@"GridCollectionView"].isEnabled; #else // the dock (and other icons) don't seem to be consistently reported as From 8832197eac75f8fe8867d742343af9bd66ca8377 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Sat, 23 Mar 2019 21:21:18 +0900 Subject: [PATCH 16/16] tweak message --- WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m b/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m index 0808f1bda..99ab92a5b 100644 --- a/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m +++ b/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m @@ -43,7 +43,7 @@ - (BOOL)fb_setFocusWithError:(NSError**) error if (!self.exists) { if (error) { *error = [[FBErrorBuilder.builder withDescription: - [NSString stringWithFormat:@"'%@' element is not reachable because it is not existed. Try to use XCUIRemote commands.", self.description]] build]; + [NSString stringWithFormat:@"'%@' element is not reachable because it does not exist. Try to use XCUIRemote commands.", self.description]] build]; } return NO; }