如何将 iOS UI 测试设置为构建依赖项,如 OCUnit?
我想以与 OCUnit 测试相同的方式将 UI 测试添加到 iOS 项目中。 我知道有 Instruments + UIAutomation JavaScript 方法,但我不知道它如何适合自动化构建工作流程。例如,您可以将 Instruments + UIAutomation 脚本设置为构建依赖项吗?
其次,我宁愿用与其余代码相同的语言编写 UI 测试...... 有什么替代方案/我缺少的东西吗?
谢谢。
马丁
I'd like to add UI tests to an iOS project, in the same manner as OCUnit tests.
I know there is the Instruments + UIAutomation JavaScript approach, but I don't see how that fits into an automated build workflow. Can you setup Instruments + UIAutomation scripts as build dependency for example?
Secondly, I'd rather write the UI tests in the same language as the rest of the code...
Are there any alternatives / things I'm missing?
Thanks.
Martijn
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您实际上可以使用 OCUnit 进行 UI 测试。
如果您已经熟悉 OCUnit,那么这段代码是一个好的开始:
如何做 UI使用 OCUnit 测试 iOS 应用程序
然后,您可以使用
xcodebuild
自动运行这些测试。这并不简单,但值得付出额外的努力。我建议看看这篇文章: Xcode4:在 iOS 中从命令行运行应用程序测试UIAutomation 现在也可以使用
instruments
实现自动化,但事实上,您现在可以使用以下命令运行 UI 测试OCUnit 让它变得不那么有趣。You can actually use OCUnit for UI testing.
If you're already familiar with OCUnit, this piece of code is a good start:
How to do UI Testing of iOS Applications Using OCUnit
You can then run these tests automatically with
xcodebuild
. It's not straightforward, but worth the extra work. I recommend to take a look at this post: Xcode4: Running Application Tests From The Command Line in iOSUIAutomation can also be automated now with
instruments
, but the fact that you can now run your UI tests with OCUnit makes it less interesting.看看 Gorilla Logic 的 FoneMonkey。这可能就是您正在寻找的。
Have a look at FoneMonkey by Gorilla Logic. This might be what you are looking for.