Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions WebDriverAgentLib/Commands/FBSessionCommands.m
Original file line number Diff line number Diff line change
Expand Up @@ -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]];
}
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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]];
}
Expand Down
2 changes: 0 additions & 2 deletions WebDriverAgentLib/Utilities/FBCapabilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

#import <Foundation/Foundation.h>

/** 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 */
Expand Down
1 change: 0 additions & 1 deletion WebDriverAgentLib/Utilities/FBCapabilities.m
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
15 changes: 0 additions & 15 deletions WebDriverAgentLib/Utilities/FBConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
25 changes: 0 additions & 25 deletions WebDriverAgentLib/Utilities/FBConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -426,16 +414,6 @@ + (BOOL)boundElementsByIndex
return FBShouldBoundElementsByIndex;
}

+ (void)setIncludeNonModalElements:(BOOL)isEnabled
{
FBIncludeNonModalElements = isEnabled;
}

+ (BOOL)includeNonModalElements
{
return FBIncludeNonModalElements;
}

+ (void)setAcceptAlertButtonSelector:(NSString *)classChainSelector
{
FBAcceptAlertButtonSelector = classChainSelector;
Expand Down Expand Up @@ -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 = @"";
Expand Down
1 change: 0 additions & 1 deletion WebDriverAgentLib/Utilities/FBSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion WebDriverAgentLib/Utilities/FBSettings.m
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
9 changes: 1 addition & 8 deletions WebDriverAgentLib/Utilities/FBXCodeCompatibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
14 changes: 1 addition & 13 deletions WebDriverAgentLib/Utilities/FBXCodeCompatibility.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 5 additions & 31 deletions WebDriverAgentLib/Vendor/CocoaAsyncSocket/GCDAsyncSocket.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export interface WDASettings {
reduceMotion?: boolean;
defaultActiveApplication?: string;
activeAppDetectionPoint?: string;
includeNonModalElements?: boolean;
defaultAlertAction?: 'accept' | 'dismiss';
acceptAlertButtonSelector?: string;
dismissAlertButtonSelector?: string;
Expand All @@ -42,7 +41,6 @@ export interface WDACapabilities {
environment?: Record<string, string>;
eventloopIdleDelaySec?: number;
shouldWaitForQuiescence?: boolean;
shouldUseTestManagerForVisibilityDetection?: boolean;
maxTypingFrequency?: number;
shouldUseSingletonTestManager?: boolean;
waitForIdleTimeout?: number;
Expand Down Expand Up @@ -100,8 +98,6 @@ export interface AppleDevice {
udid: string;
simctl?: any;
devicectl?: any;
/** @deprecated We'll stop supporting idb */
idb?: any;
[key: string]: any;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}...`);
Expand Down
1 change: 0 additions & 1 deletion test/unit/webdriveragent-specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const fakeConstructorArgs: WebDriverAgentArgs = {
udid: 'some-sim-udid',
simctl: {},
devicectl: {},
idb: null,
},
platformVersion: '9',
host: 'me',
Expand Down
Loading