我正在为应用程序编写单元测试,并想检查 aUIAlertController
是否出现在特定场景中。
-(void)testBadLogin {
// enter username and password in UITextFields
self.viewController.usernameField.text = @"test@test.com";
self.viewController.passwordField.text = @"incorrect_pass";
[loginButton sendActionsForControlEvents: UIControlEventTouchUpInside];
// this isn't right
XCTAssertNotNil([self.viewController alertController], @"alertController should appear");
}
如何检查 aUIAlertController
是否已显示在当前视图之上?