如何在XCTestCase
中输入UITextView
? UITextView
是第一个响应者,因此它已经拥有焦点并且键盘已经启动。如何在XCTestCase中键入UITextView
我已经试过:
app.typeText("footer")
app.textViews.element(boundBy: 0).typeText("foobar")
app.links.element(boundBy: 0).typeText("foobar")
出于某种原因app.textViews.count
总是返回0
?
您的文本视图在容器视图内吗?什么是视图层次结构? – Oletha
@Oletha,它在堆栈中。堆栈是最顶层的视图。 – Mystic