June 1st, 2010 Add Your Comments

Tonight I decided to give iCuke a try but I couldn’t find any good getting started guides.  iCuke is a BDD gem for cucumber that enables integration testing for the iPhone.  I’m familiar with using cucumber with Rails so getting going wasn’t terribly difficult but thought the pre-reqs should be a little more clear.

Here are five simple steps for getting started:

Step 1: Setup directories

$ cd path/to/your/iphone/app
$ mkdir features
$ cd features
$ mkdir support step_definitions

Step 2: Create cucumber.yml with the following content:
default: -r support -r step_definitions .

Step 3: Create support/iphone.rb with the following content:
require 'icuke/cucumber'

Step 4: Enable the iPhone Simulator Accessibility Inspector in System Preferences
Step 5:  Create app.feature with the following content:

Background:  Given "MyApp" from "../MyApp.xcodeproj" is loaded in the simulator
Scenario: User views the Home screen When I tap "Home"   Then I should see "Welcome"