Last active
February 11, 2016 03:37
-
-
Save matthewreagan/b009cb2daf1256a3853b to your computer and use it in GitHub Desktop.
Waiting for XCUIElement to exist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Usage example: | |
//XCUIElement *newFileButton = self.app.windows.buttons[@"New File"]; | |
//[self waitForElementToExist:newFileButton timeout:20.0]; | |
//[newFileButton click]; | |
- (void)waitForElementToExist:(XCUIElement *)element timeout:(NSTimeInterval)timeout | |
{ | |
NSPredicate *existsPredicate = [NSPredicate predicateWithFormat:@"exists == 1"]; | |
[self expectationForPredicate:existsPredicate evaluatedWithObject:element handler:nil]; | |
[self waitForExpectationsWithTimeout:timeout handler:nil]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment