4

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

Martijn Thé
  • 4,674
  • 3
  • 29
  • 42

2 Answers2

1

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.

Vincent Tourraine
  • 801
  • 14
  • 23
  • Actually, this is a pretty starting point for a good answer. I managed to figure this out through brute force and wish I had found this first! Now, having said that, the problem I have is that I have not been able to find a way to synchronize the UI with OCUnit. I have to "poll" for the current view or wait MAX time for a RESTful response. Not ideal, but I could not get a semaphore or other traditional approach to be event-driven. – mobibob May 11 '12 at 13:45
0

Have a look at FoneMonkey by Gorilla Logic. This might be what you are looking for.

Claus Broch
  • 9,212
  • 2
  • 29
  • 38