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
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 iOS
UIAutomation can also be automated now with instruments
, but the fact that you can now run your UI tests with OCUnit makes it less interesting.
Have a look at FoneMonkey by Gorilla Logic. This might be what you are looking for.
精彩评论