diff --git a/WebDriverAgentLib/Commands/FBSessionCommands.m b/WebDriverAgentLib/Commands/FBSessionCommands.m index c70465073..0522633fd 100644 --- a/WebDriverAgentLib/Commands/FBSessionCommands.m +++ b/WebDriverAgentLib/Commands/FBSessionCommands.m @@ -101,7 +101,6 @@ + (NSArray *)routes } [FBConfiguration resetSessionSettings]; - [FBConfiguration setShouldUseTestManagerForVisibilityDetection:[capabilities[FB_CAP_USE_TEST_MANAGER_FOR_VISIBLITY_DETECTION] boolValue]]; if (capabilities[FB_SETTING_USE_COMPACT_RESPONSES]) { [FBConfiguration setShouldUseCompactResponses:[capabilities[FB_SETTING_USE_COMPACT_RESPONSES] boolValue]]; } @@ -345,7 +344,6 @@ + (NSArray *)routes FB_SETTING_REDUCE_MOTION: @([FBConfiguration reduceMotionEnabled]), FB_SETTING_DEFAULT_ACTIVE_APPLICATION: request.session.defaultActiveApplication, FB_SETTING_ACTIVE_APP_DETECTION_POINT: FBActiveAppDetectionPoint.sharedInstance.stringCoordinates, - FB_SETTING_INCLUDE_NON_MODAL_ELEMENTS: @([FBConfiguration includeNonModalElements]), FB_SETTING_ACCEPT_ALERT_BUTTON_SELECTOR: FBConfiguration.acceptAlertButtonSelector, FB_SETTING_DISMISS_ALERT_BUTTON_SELECTOR: FBConfiguration.dismissAlertButtonSelector, FB_SETTING_AUTO_CLICK_ALERT_SELECTOR: FBConfiguration.autoClickAlertSelector, @@ -428,13 +426,6 @@ + (NSArray *)routes traceback:nil]); } } - if (nil != [settings objectForKey:FB_SETTING_INCLUDE_NON_MODAL_ELEMENTS]) { - if ([XCUIElement fb_supportsNonModalElementsInclusion]) { - [FBConfiguration setIncludeNonModalElements:[[settings objectForKey:FB_SETTING_INCLUDE_NON_MODAL_ELEMENTS] boolValue]]; - } else { - [FBLogger logFmt:@"'%@' settings value cannot be assigned, because non modal elements inclusion is not supported by the current iOS SDK", FB_SETTING_INCLUDE_NON_MODAL_ELEMENTS]; - } - } if (nil != [settings objectForKey:FB_SETTING_ACCEPT_ALERT_BUTTON_SELECTOR]) { [FBConfiguration setAcceptAlertButtonSelector:(NSString *)[settings objectForKey:FB_SETTING_ACCEPT_ALERT_BUTTON_SELECTOR]]; } diff --git a/WebDriverAgentLib/Utilities/FBCapabilities.h b/WebDriverAgentLib/Utilities/FBCapabilities.h index d1339c7a6..649a227ce 100644 --- a/WebDriverAgentLib/Utilities/FBCapabilities.h +++ b/WebDriverAgentLib/Utilities/FBCapabilities.h @@ -8,8 +8,6 @@ #import -/** Whether to use alternative elements visivility detection method */ -extern NSString* const FB_CAP_USE_TEST_MANAGER_FOR_VISIBLITY_DETECTION; /** Set the maximum amount of characters that could be typed within a minute (60 by default) */ extern NSString* const FB_CAP_MAX_TYPING_FREQUENCY; /** this setting was needed for some legacy stuff */ diff --git a/WebDriverAgentLib/Utilities/FBCapabilities.m b/WebDriverAgentLib/Utilities/FBCapabilities.m index 351f23e68..4693fc8a2 100644 --- a/WebDriverAgentLib/Utilities/FBCapabilities.m +++ b/WebDriverAgentLib/Utilities/FBCapabilities.m @@ -8,7 +8,6 @@ #import "FBCapabilities.h" -NSString* const FB_CAP_USE_TEST_MANAGER_FOR_VISIBLITY_DETECTION = @"shouldUseTestManagerForVisibilityDetection"; NSString* const FB_CAP_MAX_TYPING_FREQUENCY = @"maxTypingFrequency"; NSString* const FB_CAP_USE_SINGLETON_TEST_MANAGER = @"shouldUseSingletonTestManager"; NSString* const FB_CAP_DISABLE_AUTOMATIC_SCREENSHOTS = @"disableAutomaticScreenshots"; diff --git a/WebDriverAgentLib/Utilities/FBConfiguration.h b/WebDriverAgentLib/Utilities/FBConfiguration.h index 35fbf165a..e8c7754bf 100644 --- a/WebDriverAgentLib/Utilities/FBConfiguration.h +++ b/WebDriverAgentLib/Utilities/FBConfiguration.h @@ -18,10 +18,6 @@ extern NSString *const FBSnapshotMaxDepthKey; */ @interface FBConfiguration : NSObject -/*! If set to YES will ask TestManagerDaemon for element visibility */ -+ (void)setShouldUseTestManagerForVisibilityDetection:(BOOL)value; -+ (BOOL)shouldUseTestManagerForVisibilityDetection; - /*! If set to YES will use compact (standards-compliant) & faster responses */ + (void)setShouldUseCompactResponses:(BOOL)value; + (BOOL)shouldUseCompactResponses; @@ -276,17 +272,6 @@ typedef NS_ENUM(NSInteger, FBConfigurationKeyboardPreference) { + (void)setAnimationCoolOffTimeout:(NSTimeInterval)timeout; + (NSTimeInterval)animationCoolOffTimeout; -/** - Enforces the page hierarchy to include non modal elements, - like Contacts. By default such elements are not present there. - See https://github.com/appium/appium/issues/13227 - - @param isEnabled Set to YES in order to enable non modal elements inclusion. - Setting this value to YES will have no effect if the current iOS SDK does not support such feature. - */ -+ (void)setIncludeNonModalElements:(BOOL)isEnabled; -+ (BOOL)includeNonModalElements; - /** Sets custom class chain locators for accept/dismiss alert buttons location. This might be useful if the default buttons detection algorithm fails to determine alert buttons properly diff --git a/WebDriverAgentLib/Utilities/FBConfiguration.m b/WebDriverAgentLib/Utilities/FBConfiguration.m index e6ce8d52f..dcd1a62e3 100644 --- a/WebDriverAgentLib/Utilities/FBConfiguration.m +++ b/WebDriverAgentLib/Utilities/FBConfiguration.m @@ -33,7 +33,6 @@ static NSString *const FBKeyboardPredictionKey = @"KeyboardPrediction"; static NSString *const axSettingsClassName = @"AXSettings"; -static BOOL FBShouldUseTestManagerForVisibilityDetection = NO; static BOOL FBShouldUseSingletonTestManager = YES; static BOOL FBShouldRespectSystemAlerts = NO; @@ -48,7 +47,6 @@ static NSUInteger FBScreenshotQuality; static BOOL FBShouldUseFirstMatch; static BOOL FBShouldBoundElementsByIndex; -static BOOL FBIncludeNonModalElements; static NSString *FBAcceptAlertButtonSelector; static NSString *FBDismissAlertButtonSelector; static NSString *FBAutoClickAlertSelector; @@ -188,16 +186,6 @@ + (BOOL)verboseLoggingEnabled return [NSProcessInfo.processInfo.environment[@"VERBOSE_LOGGING"] boolValue]; } -+ (void)setShouldUseTestManagerForVisibilityDetection:(BOOL)value -{ - FBShouldUseTestManagerForVisibilityDetection = value; -} - -+ (BOOL)shouldUseTestManagerForVisibilityDetection -{ - return FBShouldUseTestManagerForVisibilityDetection; -} - + (void)setShouldUseCompactResponses:(BOOL)value { FBShouldUseCompactResponses = value; @@ -426,16 +414,6 @@ + (BOOL)boundElementsByIndex return FBShouldBoundElementsByIndex; } -+ (void)setIncludeNonModalElements:(BOOL)isEnabled -{ - FBIncludeNonModalElements = isEnabled; -} - -+ (BOOL)includeNonModalElements -{ - return FBIncludeNonModalElements; -} - + (void)setAcceptAlertButtonSelector:(NSString *)classChainSelector { FBAcceptAlertButtonSelector = classChainSelector; @@ -542,9 +520,6 @@ + (void)resetSessionSettings FBScreenshotQuality = 3; FBShouldUseFirstMatch = NO; FBShouldBoundElementsByIndex = NO; - // This is diabled by default because enabling it prevents the accessbility snapshot to be taken - // (it always errors with kxIllegalArgument error) - FBIncludeNonModalElements = NO; FBAcceptAlertButtonSelector = @""; FBDismissAlertButtonSelector = @""; FBAutoClickAlertSelector = @""; diff --git a/WebDriverAgentLib/Utilities/FBSettings.h b/WebDriverAgentLib/Utilities/FBSettings.h index 08d8a7963..c1fc6e346 100644 --- a/WebDriverAgentLib/Utilities/FBSettings.h +++ b/WebDriverAgentLib/Utilities/FBSettings.h @@ -28,7 +28,6 @@ extern NSString* const FB_SETTING_BOUND_ELEMENTS_BY_INDEX; extern NSString* const FB_SETTING_REDUCE_MOTION; extern NSString* const FB_SETTING_DEFAULT_ACTIVE_APPLICATION; extern NSString* const FB_SETTING_ACTIVE_APP_DETECTION_POINT; -extern NSString* const FB_SETTING_INCLUDE_NON_MODAL_ELEMENTS; extern NSString* const FB_SETTING_DEFAULT_ALERT_ACTION; extern NSString* const FB_SETTING_ACCEPT_ALERT_BUTTON_SELECTOR; extern NSString* const FB_SETTING_DISMISS_ALERT_BUTTON_SELECTOR; diff --git a/WebDriverAgentLib/Utilities/FBSettings.m b/WebDriverAgentLib/Utilities/FBSettings.m index 65c6ed82f..d333c58f1 100644 --- a/WebDriverAgentLib/Utilities/FBSettings.m +++ b/WebDriverAgentLib/Utilities/FBSettings.m @@ -24,7 +24,6 @@ NSString* const FB_SETTING_REDUCE_MOTION = @"reduceMotion"; NSString* const FB_SETTING_DEFAULT_ACTIVE_APPLICATION = @"defaultActiveApplication"; NSString* const FB_SETTING_ACTIVE_APP_DETECTION_POINT = @"activeAppDetectionPoint"; -NSString* const FB_SETTING_INCLUDE_NON_MODAL_ELEMENTS = @"includeNonModalElements"; NSString* const FB_SETTING_DEFAULT_ALERT_ACTION = @"defaultAlertAction"; NSString* const FB_SETTING_ACCEPT_ALERT_BUTTON_SELECTOR = @"acceptAlertButtonSelector"; NSString* const FB_SETTING_DISMISS_ALERT_BUTTON_SELECTOR = @"dismissAlertButtonSelector"; diff --git a/WebDriverAgentLib/Utilities/FBXCodeCompatibility.h b/WebDriverAgentLib/Utilities/FBXCodeCompatibility.h index 75d1ee203..247f056bd 100644 --- a/WebDriverAgentLib/Utilities/FBXCodeCompatibility.h +++ b/WebDriverAgentLib/Utilities/FBXCodeCompatibility.h @@ -61,17 +61,10 @@ NS_ASSUME_NONNULL_BEGIN @interface XCUIElement (FBCompatibility) -/** - Determines whether current iOS SDK supports non modal elements inlusion into snapshots - - @return Either YES or NO - */ -+ (BOOL)fb_supportsNonModalElementsInclusion; - /** Retrieves element query - @return Element query property extended with non modal elements depending on the actual configuration + @return Element query */ - (XCUIElementQuery *)fb_query; diff --git a/WebDriverAgentLib/Utilities/FBXCodeCompatibility.m b/WebDriverAgentLib/Utilities/FBXCodeCompatibility.m index f2cf03a24..5f88ccb56 100644 --- a/WebDriverAgentLib/Utilities/FBXCodeCompatibility.m +++ b/WebDriverAgentLib/Utilities/FBXCodeCompatibility.m @@ -45,21 +45,9 @@ - (XCUIElement *)fb_firstMatch @implementation XCUIElement (FBCompatibility) -+ (BOOL)fb_supportsNonModalElementsInclusion -{ - static dispatch_once_t hasIncludingNonModalElements; - static BOOL result; - dispatch_once(&hasIncludingNonModalElements, ^{ - result = [XCUIApplication.fb_systemApplication.query respondsToSelector:@selector(includingNonModalElements)]; - }); - return result; -} - - (XCUIElementQuery *)fb_query { - return FBConfiguration.includeNonModalElements && self.class.fb_supportsNonModalElementsInclusion - ? self.query.includingNonModalElements - : self.query; + return self.query; } @end diff --git a/WebDriverAgentLib/Vendor/CocoaAsyncSocket/GCDAsyncSocket.m b/WebDriverAgentLib/Vendor/CocoaAsyncSocket/GCDAsyncSocket.m index 56508e809..cfb23e41e 100755 --- a/WebDriverAgentLib/Vendor/CocoaAsyncSocket/GCDAsyncSocket.m +++ b/WebDriverAgentLib/Vendor/CocoaAsyncSocket/GCDAsyncSocket.m @@ -7104,23 +7104,6 @@ - (void)ssl_startTLS return; } -#if !TARGET_OS_IPHONE && (__MAC_OS_X_VERSION_MIN_REQUIRED < 1080) - - // Note from Apple's documentation: - // - // It is only necessary to call SSLSetEnableCertVerify on the Mac prior to OS X 10.8. - // On OS X 10.8 and later setting kSSLSessionOptionBreakOnServerAuth always disables the - // built-in trust evaluation. All versions of iOS behave like OS X 10.8 and thus - // SSLSetEnableCertVerify is not available on that platform at all. - - status = SSLSetEnableCertVerify(sslContext, NO); - if (status != noErr) - { - [self closeWithError:[self otherError:@"Error in SSLSetEnableCertVerify"]]; - return; - } - -#endif } // Configure SSLContext from given settings @@ -7384,21 +7367,12 @@ - (void)ssl_startTLS value = [tlsSettings objectForKey:GCDAsyncSocketSSLALPN]; if ([value isKindOfClass:[NSArray class]]) { - if (@available(iOS 11.0, macOS 10.13, tvOS 11.0, *)) - { - CFArrayRef protocols = (__bridge CFArrayRef)((NSArray *) value); - status = SSLSetALPNProtocols(sslContext, protocols); - if (status != noErr) - { - [self closeWithError:[self otherError:@"Error in SSLSetALPNProtocols"]]; - return; - } - } - else + CFArrayRef protocols = (__bridge CFArrayRef)((NSArray *) value); + status = SSLSetALPNProtocols(sslContext, protocols); + if (status != noErr) { - NSAssert(NO, @"Security option unavailable - GCDAsyncSocketSSLALPN" - @" - iOS 11.0, macOS 10.13 required"); - [self closeWithError:[self otherError:@"Security option unavailable - GCDAsyncSocketSSLALPN"]]; + [self closeWithError:[self otherError:@"Error in SSLSetALPNProtocols"]]; + return; } } else if (value) diff --git a/lib/types.ts b/lib/types.ts index 57524388d..4a724161d 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -18,7 +18,6 @@ export interface WDASettings { reduceMotion?: boolean; defaultActiveApplication?: string; activeAppDetectionPoint?: string; - includeNonModalElements?: boolean; defaultAlertAction?: 'accept' | 'dismiss'; acceptAlertButtonSelector?: string; dismissAlertButtonSelector?: string; @@ -42,7 +41,6 @@ export interface WDACapabilities { environment?: Record; eventloopIdleDelaySec?: number; shouldWaitForQuiescence?: boolean; - shouldUseTestManagerForVisibilityDetection?: boolean; maxTypingFrequency?: number; shouldUseSingletonTestManager?: boolean; waitForIdleTimeout?: number; @@ -100,8 +98,6 @@ export interface AppleDevice { udid: string; simctl?: any; devicectl?: any; - /** @deprecated We'll stop supporting idb */ - idb?: any; [key: string]: any; } diff --git a/lib/utils.ts b/lib/utils.ts index bf48f998c..5f8fbe271 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -292,7 +292,7 @@ export async function resetTestProcesses(udid: string, isSimulator: boolean): Pr const processPatterns = [`xcodebuild.*${udid}`]; if (isSimulator) { processPatterns.push(`${udid}.*XCTRunner`); - // The pattern to find in case idb was used + // Some XCTest launches might not include xcodebuild in their command line processPatterns.push(`xctest.*${udid}`); } log.debug(`Killing running processes '${processPatterns.join(', ')}' for the device ${udid}...`); diff --git a/test/unit/webdriveragent-specs.ts b/test/unit/webdriveragent-specs.ts index 1499c8077..d311c12e8 100644 --- a/test/unit/webdriveragent-specs.ts +++ b/test/unit/webdriveragent-specs.ts @@ -15,7 +15,6 @@ const fakeConstructorArgs: WebDriverAgentArgs = { udid: 'some-sim-udid', simctl: {}, devicectl: {}, - idb: null, }, platformVersion: '9', host: 'me',