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
14 changes: 4 additions & 10 deletions WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m
Original file line number Diff line number Diff line change
Expand Up @@ -621,23 +621,17 @@ + (BOOL)fb_switchToSystemApplicationWithError:(NSError **)error
{
XCUIApplication *systemApp = self.fb_systemApplication;
@try {
if (!systemApp.running) {
[systemApp launch];
} else {
if (systemApp.running) {
[systemApp activate];
} else {
[systemApp launch];
}
} @catch (NSException *e) {
return [[[FBErrorBuilder alloc]
withDescription:nil == e ? @"Cannot open the home screen" : e.reason]
buildError:error];
}
return [[[[FBRunLoopSpinner new]
timeout:5]
timeoutErrorMessage:@"Timeout waiting until the home screen is visible"]
spinUntilTrue:^BOOL{
return [systemApp fb_isSameAppAs:self.fb_activeApplication];
}
error:error];
return YES;
}

- (BOOL)fb_isSameAppAs:(nullable XCUIApplication *)otherApp
Expand Down
2 changes: 1 addition & 1 deletion WebDriverAgentLib/Utilities/FBScreenshot.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

NSString *formatTimeInterval(NSTimeInterval interval) {
NSUInteger milliseconds = (NSUInteger)(interval * 1000);
return [NSString stringWithFormat:@"%ld ms", milliseconds];
return [NSString stringWithFormat:@"%lu ms", milliseconds];
}

@implementation FBScreenshot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ - (void)testGoToHomeScreen
NSError *error;
XCTAssertTrue([[XCUIDevice sharedDevice] fb_goToHomescreenWithError:&error]);
XCTAssertNil(error);
XCTAssertTrue([XCUIApplication fb_activeApplication].icons[@"Safari"].exists);
FBAssertWaitTillBecomesTrue([XCUIApplication fb_activeApplication].icons[@"Safari"].exists);
}

- (void)testLockUnlockScreen
Expand Down
Loading