My name is Jake Marsh.
I'm a developer, designer, and writer.

Subscribed via Push Notifications. You can also subscribe via RSS or Twitter.

Subscribe via RSS or Twitter.

Subscribe via Push Notifications, RSS or Twitter.

▸ Zucchini: iOS Testing Written in Ruby & CoffeeScript

Zucchini is an awesome cucumber-like visual testing framework for iOS. It works in a pretty awesome way by compiling CoffeeScript down to UIAutomation-compliant Javascript, and then running the test with Instruments.app's command-line tool.

Also, As their site describes further, the whole system works very much like Cucumber, the popular ruby/rails testing gem:

A Zucchini feature file consists of sections bound to contexts of different application screens. Every screen you proceed to needs to be backed up by a CoffeeScript class describing all UI elements you want Zucchini to interact with as well as custom actions you feel like performing on that screen.

Here's an example of one such class:

class PostScreen extends Screen
  anchor: -> view.navigationBars()["Post"]

  constructor: ->
    super 'post'

    extend @elements,
    'Post': -> view.navigationBars()["Post"].buttons()["Post"]

    extend @actions,
    'Type "([^"]*)"$': (text) ->
      messageArea = view.elements()['Message Text Area']
      messageArea.setValue text

Zucchini has an impressive set of features including:

Zucchini only runs on Mac OS X 10.6 and 10.7 and requires XCode 4.2 as well as Ruby (at least 1.8.7).

The Zucchini site is full of really helpful links and installation instructions, so check it out, you can also find the Zucchini project on Github here.

Vote on Hacker News