【发布时间】:2016-09-30 09:54:20
【问题描述】:
有时在 Xcode 中的 UITests 下,编译器会在加载和呈现按钮之前尝试点击按钮。然后出现no matched found for...之类的问题。
但是解决这个问题的简单方法是:
sleep(1) //wait 1 second and give `mybutton` time to load and be accessible for uitests
mybutton.tap()
但这太可怕了,因为我不能把0.1 作为参数放在那里。在很多按钮之前等待 1 秒让我很烦。
有没有办法等到它对 uitests 可见?
【问题讨论】:
标签: ios swift xcode-ui-testing