Skip to content
Closed
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
25 changes: 14 additions & 11 deletions WebDriverAgentLib/Commands/FBSessionCommands.m
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,20 @@ + (NSArray *)routes
_XCTSetApplicationStateTimeout(defaultTimeout);
}
}
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"17.0") && [bundleID isEqualToString:FB_SAFARI_BUNDLE_ID]) {
// Opening the default URL in Safari instead of an empty page helps
// the remote debugger to avoid issues while looking for active web views
FBWebServerParams *wsParams = FBWebServerParams.sharedInstance;
NSString *healthEndpoint = [NSString stringWithFormat:@"http://127.0.0.1:%@/health", wsParams.port];
id<FBResponsePayload> errorResponse = [self openDeepLink:healthEndpoint
withApplication:bundleID
timeout:capabilities[FB_CAP_APP_LAUNCH_STATE_TIMEOUT_SEC]];
if (nil != errorResponse) {
NSLog(@"Was not able to open the default URL %@ in Safari", healthEndpoint);
}
// Opening a new page in Safari via deeplink as part of new session request could cause
// content load failure and non-response behavior after the new session request for now.
// i.e. https://github.com/appium/appium-xcuitest-driver/pull/2447#issuecomment-2272735187
// if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"17.0") && [bundleID isEqualToString:FB_SAFARI_BUNDLE_ID]) {
// // Opening the default URL in Safari instead of an empty page helps
// // the remote debugger to avoid issues while looking for active web views
// FBWebServerParams *wsParams = FBWebServerParams.sharedInstance;
// NSString *healthEndpoint = [NSString stringWithFormat:@"http://127.0.0.1:%@/health", wsParams.port];
// id<FBResponsePayload> errorResponse = [self openDeepLink:healthEndpoint
// withApplication:bundleID
// timeout:capabilities[FB_CAP_APP_LAUNCH_STATE_TIMEOUT_SEC]];
// if (nil != errorResponse) {
// NSLog(@"Was not able to open the default URL %@ in Safari", healthEndpoint);
// }
}
}
if (!app.running) {
Expand Down
Loading