Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CollectiveHealth-gists/d7266487a5fd8560fc86cf282b85f06c to your computer and use it in GitHub Desktop.
Save CollectiveHealth-gists/d7266487a5fd8560fc86cf282b85f06c to your computer and use it in GitHub Desktop.
Testing iOS at Collective Health: Checking if an element exists
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