ios – 有可可触摸自动UI测试的好教程吗?

通常我发现几乎所有我最重要的iPhone开发测试用例都围绕UI测试而不是业务逻辑或数据测试.我不太熟悉XCode环境中的自动化UI测试.有人可以指点一个好的教程或书吗?

UPDATE
这个问题是几年前写的,UI测试从那以后已经走了很长的路.使用UI自动化仍然是一个选择,但KIF Framework是现在功能测试的更好的解决方案,IMO.

从KIF的github页面:

KIF,which stands for Keep It Functional,is an iOS integration test
framework. It allows for easy automation of iOS apps by leveraging the
accessibility attributes that the OS makes available for those with
visual disabilities.

KIF builds and performs the tests using a standard XCTest testing
target. Testing is conducted synchronously in the main thread (running
the run loop to force the passage of time) allowing for more complex
logic and composition. This also allows KIF to take advantage of the
Xcode 5 Test Navigator,command line build tools,and Bot test
reports.

解决方法

您最好的选择是使用iOS 4.0发布的UI自动化仪器.这可以脚本来测试用户界面的许多方面.

苹果在WWDC 2010会议306的视频(“用仪器自动化用户界面测试”)中为该工具提供了一个很好的介绍.我演示了如何在视频中设置脚本并在我的高级iOS开发课程on iTunes U的“测试”会话中进行测试.我可以在here中找到我从该课程中介绍的UI Automation的注释,包括示例脚本.

此外,您可能需要查看James Turner的文章“How to use UIAutomation to create iPhone UI tests”和Alex Vollmer的“Working with UIAutomation”.

以上是来客网为你收集整理的ios – 有可可触摸自动UI测试的好教程吗?全部内容,希望文章能够帮你解决ios – 有可可触摸自动UI测试的好教程吗?所遇到的程序开发问题。

如果觉得来客网网站内容还不错,欢迎将来客网网站推荐给程序员好友。