我正在使用 bwoken 进行 iOS UI 测试,它在后台使用 UIAutomation 来运行所有测试。
我已经设置了一个非常简单的示例应用程序,在启动时有两个按钮和一个 1.5 秒的小动画——我测试的只是查看两个按钮在视图中是否实际可用。
这个简单的测试用例大约有 1/3 的测试运行失败。
请参阅我附加的测试用例:
#import "../../../../tuneup/tuneup.js"
test "Initial screen has two buttons", (target, app) ->
target.delay(2) # wait until animation is over
window = app.mainWindow()
assertNotNull window.elements()["buttonA"], "buttonA is missing"
assertNotNull window.elements()["buttonB"], "buttonB is missing"
关于为什么会这样的任何想法?
我检查了常见错误:
- 无障碍标签设置正确
- 即使禁用启动时的动画,测试也会失败
- 添加/删除延迟不会改变问题