Reputation: 61774
XCTAssertTrue(app.keyboards.elementBoundByIndex(0).exists)
causes crash. How to do this then? Is it possible to check whether keaboard exists at all?
Upvotes: 1
Views: 1624
Reputation: 48085
Another way is to check if the textField contains Keyboard Focused
let emailTextField = app.textFields.element(boundBy: 0)
XCTAssertTrue(emailTextField.debugDescription.contains("Keyboard Focused")))
Upvotes: 0
Reputation: 61774
XCTAssertEqual(app.keyboards.count, 1)
- keyboard exists.
XCTAssertEqual(app.keyboards.count, 0)
- keyboard doesn't exists.
Upvotes: 5