Created
June 20, 2018 11:18
-
-
Save cupnoodle/eaf20be54af0fff7fe74246d74175338 to your computer and use it in GitHub Desktop.
Swift unit test with delay to wait the UI to present
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
let alertExpectation = XCTestExpectation(description: "testAlertShouldAppear") | |
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0, execute: { | |
XCTAssertTrue(loginVC.presentedViewController is UIAlertController) | |
alertExpectation.fulfill() | |
}) | |
wait(for: [alertExpectation], timeout: 1.5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment