From 484d856a20e71497aea1c4163b63db8041dd4649 Mon Sep 17 00:00:00 2001 From: Mykola Mokhnach Date: Wed, 7 Aug 2024 10:19:43 +0200 Subject: [PATCH] feta: Add idleTimeoutMs param to the openUrl call --- WebDriverAgentLib/Commands/FBSessionCommands.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/WebDriverAgentLib/Commands/FBSessionCommands.m b/WebDriverAgentLib/Commands/FBSessionCommands.m index 97baab7a1..e544aa1be 100644 --- a/WebDriverAgentLib/Commands/FBSessionCommands.m +++ b/WebDriverAgentLib/Commands/FBSessionCommands.m @@ -67,6 +67,7 @@ + (NSArray *)routes return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:@"URL is required" traceback:nil]); } NSString* bundleId = request.arguments[@"bundleId"]; + NSNumber* idleTimeoutMs = request.arguments[@"idleTimeoutMs"]; NSError *error; if (nil == bundleId) { if (![XCUIDevice.sharedDevice fb_openUrl:urlString error:&error]) { @@ -76,6 +77,10 @@ + (NSArray *)routes if (![XCUIDevice.sharedDevice fb_openUrl:urlString withApplication:bundleId error:&error]) { return FBResponseWithUnknownError(error); } + if (idleTimeoutMs.doubleValue > 0) { + XCUIApplication *app = [[XCUIApplication alloc] initWithBundleIdentifier:bundleId]; + [app fb_waitUntilStableWithTimeout:idleTimeoutMs.doubleValue / 1000.0]; + } } return FBResponseWithOK(); }