通常,我发现几乎所有我最重要的 iPhone 开发测试用例都围绕 UI 测试,而不是业务逻辑或数据测试.我对 XCode 环境中的自动化 UI 测试不是很熟悉.有人能指点我一个好的教程或书籍吗?
Typically I find that nearly all my most important test cases for iPhone development revolve around UI testing rather than business logic or data testing. I'm not very familiar with automated UI testing in the XCode environment. Can someone point me to a good tutorial or book?
更新
这个问题是几年前写的,从那时起 UI 测试已经走了很长一段路.使用 UI 自动化仍然是一种选择,但 KIF 框架 是功能测试更好的解决方案现在,海事组织.
UPDATE
This question was written several years ago and UI testing has come a long way since then. Using the UI Automation is still an option, but the KIF Framework is a much better solution for functional testing now, IMO.
来自 KIF 的 github 页面:
From KIF's github page:
KIF,代表 Keep It Functional,是一个 iOS 集成测试框架.它通过利用操作系统为具有以下功能的人提供的可访问性属性视力障碍.
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 使用标准 XCTest 测试构建和执行测试目标.测试在主线程中同步进行(运行运行循环强制时间流逝)允许更复杂逻辑和组成.这也使 KIF 能够利用Xcode 5 Test Navigator、命令行构建工具和 Bot 测试报告.
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 自动化工具.可以编写脚本来测试用户界面的许多方面.
Your best bet will be to use the UI Automation instrument that debuted with iOS 4.0. This can be scripted to test out many aspects of your user interface.
Apple 在 WWDC 2010 会议 306 - "Automating使用仪器进行用户界面测试".我在我的高级 iOS 开发课程 在 iTunes U 上.可以在此处.
Apple provides a great introduction to this tool in the video for the WWDC 2010 session 306 - "Automating User Interface Testing with Instruments". I demonstrate how to set up scripts and do testing in the video for the "Testing" session of my advanced iOS development course on iTunes U. My notes on UI Automation from that class, including sample scripts, can be found here.
此外,您可能还想看看 James Turner 的文章如何使用 UIAutomation 来创建 iPhone UI 测试" 和 Alex Vollmer 的 "使用 UIAutomation".
Additionally, you might want to look at James Turner's article "How to use UIAutomation to create iPhone UI tests" and Alex Vollmer's "Working with UIAutomation".
这篇关于可可触控自动化UI测试有没有好的教程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!