you achieve automated acceptance testing* for an iOS app • It uses iOS accessibility labels, Cucumber, UISpec and a little embedded web app to get its thing done • Cucumber is a so-called BDD test framework for Ruby • UISpec is a so-called BDD test framework for iOS, writting Objective C - it’s like Rspec http://testingwithfrank.com/getting_started.html * answers the question - “are we done yet?” Wednesday 10 October 12
UISpec on the sim • The binding happens through a mini web-app that lives in your app • So you compile it in - frankifying your app tests cucumber frank driver frankly protocol frank UIspec app https://github.com/moredip/Frank/wiki/Frankifying-your-app-in-XCode-4 Wednesday 10 October 12
Cucumber DSL style, with a selection of Frank- specific extensions. You get tests that looks a bit like this. • You can write your own steps Wednesday 10 October 12
the test will drive and from where it will read state. • “select an UIImageView with accessibility label small-check in UITableViewCell that is the parent of a UITableViewCell that has a label marked with the accessibility label Milk” srsly, it all makes more sense here: http://testingwithfrank.com/selector_syntax.html Wednesday 10 October 12
It’s fantastic for showing the view hierarchy and what is going on where. • It has a live part too, so you can watch interactions as you take them in the sim. • You can drill into the view properties Wednesday 10 October 12
fine on the simulator, apparently its terrifically messy to run on the device - I didn’t go that far. • Gestures not supported. • It’s compiled in. Your Frankified app is a new target in Xcode. You could probably make sure that it doesn’t get compiled into you production code. Wednesday 10 October 12
Symbiote a bit - thought it was great, but obviously the Cucumber stuff had to die. • Luckily the Frankly protocol is a simple HTTP/JSON thing, so it should be simple to write a new driver... BUT • I started thinking about why one tests. Mostly, it’s 1: To prove you are done. 2: To allow you to change stuff with confidence. • With apps, sometimes all you want is 1 - and then, is it worth going through the setup here? Maybe if you re-use enough UI artifacts, it is. Discuss. Wednesday 10 October 12