2
これは、UITestsでUITextFields
とUITextViews
をクリアする方法です。使用のUITestの下のUITextViewの最後にカーソルを置きます。
extension XCUIElement {
func clear() {
tap()
while (value as! String).characters.count > 0 {
XCUIApplication().keys["delete"].tap()
}
}
}
例:
descriptionTextView.type("Something about Room.")
descriptionTextView.clear()
私はUITestsを実行した場合、それは常にUITextViewの先頭にタップします。
最後にタップする方法は?