Created
July 10, 2017 23:40
-
-
Save CollectiveHealth-gists/d7266487a5fd8560fc86cf282b85f06c to your computer and use it in GitHub Desktop.
Testing iOS at Collective Health: Checking if an element exists
This file contains 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
func assertExists(element: XCUIElement, timeout: NSTimeInterval = 10) { | |
expectationForPredicate(NSPredicate(format: "exists == 1"), | |
evaluatedWithObject: element, handler: nil) | |
waitForExpectationsWithTimeout(timeout, handler: nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment