【发布时间】:2017-11-04 05:39:39
【问题描述】:
如何在XCTestCase 中输入UITextView? UITextView 是第一响应者,因此它已经获得焦点并且键盘已启动。
我试过了:
app.typeText("footer")
app.textViews.element(boundBy: 0).typeText("foobar")
app.links.element(boundBy: 0).typeText("foobar")
出于某种原因app.textViews.count 总是返回0?
【问题讨论】:
-
您的文本视图是否在容器视图中?视图层次结构是什么样的?
-
@Oletha,它在堆栈中。堆栈是最顶层的视图。
标签: ios swift xctest xcode-ui-testing