我正在新的Xcode 7 UI测试框架下用swift编写UI文本.要求是测试系统键盘是否显示在应用程序中.谁能给我一个如何做到的线索?谢谢
试试这个检查:
let app = XCUIApplication() XCTAssert(app.keyboards.count > 0, "The keyboard is not shown")
或检查特定的键盘键,如:
let app = XCUIApplication() XCTAssert(app.keyboards.buttons["Next:"].exists, "The keyboard has no Next button")
您还可以控制键盘上的交互:
let app = XCUIApplication() app.keyboards.buttons["Next:"].tap()