GithubHelp home page GithubHelp logo

cheezy / icuke Goto Github PK

View Code? Open in Web Editor NEW

This project forked from unboxed/icuke

7.0 2.0 1.0 1.02 MB

Integration testing for iPhone applications with Cucumber

License: MIT License

Ruby 16.07% C 20.49% Objective-C 63.45%

icuke's Introduction

iCuke

iCuke allows you to test an iPhone application with cucumber. It provides a selection of step definitions similar to those provided for testing web applications.

Usage

Install the gem, require it, and extend your cucumber World object with the iCuke step definitions, in a cucumber support file:

require 'icuke/cucumber'
World(ICukeWorld)

Write some scenarios like:

Background:
  Given "iCuke" from "app/iCuke/iCuke.xcodeproj" is loaded in the simulator

Scenario: User views the About screen
  When I tap "About"
  Then I should see "Author:"

How it works

iCuke launches your application into the iPhone Simulator. A preload library is used to add a HTTP server into your application.

The HTTP server allows us to see an XML version of the iPhone's screen, and to emulate taps/swipes etc.

iCuke should not require any code changes to your application to work, however, it relies on accessibility information to function sensibly. If your accessibility information is not accurate, iCuke may not work as expected.

Compatibility Mode

By default iCuke adds methods to the World object in which cucumber scenarios run.

This makes it easy to do things like this in your step definitions:

Given /^the user is logged in$/ do
  type "username", "test_user"
  type "password", "test_password"
end

In adding things to the World object, however, you may end up stomping on methods that come from other places. For example, Capybara defines a #drag method for the World object, and so does ICuke. This makes it impossbile to use them together. Another example is the #tap method in ICuke which conflicts with Ruby 1.9.X's Object#tap method.

In order to solve this instead of:

require 'icuke/cucumber'
World(ICukeWorld)

do

require 'icuke/cucumber_compat'
World(ICukeWorld)

By doing this each of the methods provided by the api will be scoped to an icuke_driver object. #tap becomes icuke_driver.tap, #drag becomes icuke_driver.drag, #type becomes icuke_driver.type etc. The example above would become:

Given /^the user is logged in$/ do
  icuke_driver.type "username", "test_user"
  icuke_driver.type "password", "test_password"
end

Bugs

iCuke does not support testing applications on real devices, because I don't know of a way get a preload library to load on the device.

iCuke does not support pinches yet. They'll be here soon!

iCuke compiles against the latest 3.1 and 4.0 SDKs it can find. Compiling against 3.2 is not currently supported as Apple have released two versions with different ABIs.

Future development

The initial development of iCuke was sponsored by Unboxed Consulting. That sponsorship has now ended. In order to help support the future development of iCuke please consider donating.

Click here to lend your support to: iCuke and make a donation at www.pledgie.com !

Contributors

  • Nigel Taylor
  • Aslak Hellesøy
  • Dominic Baggott
  • Jeff Morgan
  • Luke Redpath
  • Grant McInnes

Thanks

Thanks go to the people who's work iCuke is based on:

  • Matt Gallagher
  • Ian Dees
  • Felipe Barreto

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.

Copyright

Copyright (c) 2010 Unboxed Consulting. See LICENSE for details.

icuke's People

Contributors

cheezy avatar gmcinnes avatar lukeredpath avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

aslakhellesoy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.