GithubHelp home page GithubHelp logo

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 and load the iCuke step definitions in a cucumber support file:

require ‘icuke/cucumber’

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.

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.

Contributors

  • Nigel Taylor

  • Aslak Hellesøy

  • Dominic Baggott

  • Jeff Morgan

  • Luke Redpath

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 © 2010 Unboxed Consulting. See LICENSE for details.

icuke's People

Contributors

cheezy avatar lukeredpath avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

icuke's Issues

iPhone4 Simulator

The sample feature using the Universal application fails if the simulator->Hardware->Device is set to iPhone4.

Background:                                                        
Given "app/Universal.xcodeproj" is loaded in the iphone simulator 
Scenario: Scrolling                                                 
When I tap "Show Test Modal"                                 

These both pass and the app starts. The tap on "Show Test Modal" seems to kill the Universal app, but this may be iCuke killing the app on a test failure (see below)?

Then I should see "Lorem ipsum dolor"                    
  Content "Lorem ipsum dolor" not found in: <screen>
    <frame x="0.000000" y="20.000000" width="320.000000" height="460.000000"/>
    <UIWindow>
      <UILayoutContainerView>

Build problems

By the lack of a mailing list I file my problem here. Got a fresh clone of my own repo (forked from cheezy) and ran rake features. Some advice on how to proceed would be fab. Here is the output:

bekk-00264a1d1d4c:icuke aslakhellesoy$ rake features
(in /Users/aslakhellesoy/scm/icuke)
/Users/aslakhellesoy/.rvm/gems/ruby-1.8.7-p249/gems/jeweler-1.4.0/lib/jeweler/commands/check_dependencies.rb:13:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010.  Use #requirement
All dependencies seem to be installed.
cd ext/iCuke && rake
(in /Users/aslakhellesoy/scm/icuke/ext/iCuke)
/Users/aslakhellesoy/.rvm/rubies/ruby-1.8.7-p249/bin/ruby -I "/Users/aslakhellesoy/.rvm/gems/ruby-1.8.7-p249/gems/cucumber-0.7.3/lib:lib" "/Users/aslakhellesoy/.rvm/gems/ruby-1.8.7-p249/gems/cucumber-0.7.3/bin/cucumber" 
Feature: iPhone integration tests
  In order to test my iphone application
  As a tester
  I want cucumber to be able to drive the simulator

  Background:                                                  # features/uicatalog.feature:6
    Given "app/UICatalog.xcodeproj" is loaded in the simulator # lib/icuke/cucumber.rb:198
      CommandError
            OSERROR: -1719
            MESSAGE: Access for assistive devices is disabled.
            OFFENDING OBJECT: app("/System/Library/CoreServices/System Events.app").application_processes["Xcode"].windows[1]
            COMMAND: app("/System/Library/CoreServices/System Events.app").application_processes["Xcode"].windows[1].static_texts[0].value.get()
       (Appscript::CommandError)
      ./features/support/../../lib/icuke/xcode.rb:39:in `status'
      ./features/support/../../lib/icuke/xcode.rb:47:in `installing_app?'
      ./features/support/../../lib/icuke/xcode.rb:113:in `launch'
      ./features/support/../../lib/icuke/xcode.rb:58:in `with_settings'
      ./features/support/../../lib/icuke/xcode.rb:104:in `launch'
      ./features/support/../../lib/icuke/cucumber.rb:16:in `launch'
      ./features/support/../../lib/icuke/cucumber.rb:199:in `/^(?:"([^\"]*)" from )?"([^\"]*)" is loaded in the simulator(?: using sdk (.*))?$/'
      features/uicatalog.feature:7:in `Given "app/UICatalog.xcodeproj" is loaded in the simulator'

  Scenario: Navigating through the application                 # features/uicatalog.feature:9
    When I tap "Buttons"                                       # lib/icuke/cucumber.rb:212
    And I tap "Back"                                           # lib/icuke/cucumber.rb:212
    And I tap "Controls"                                       # lib/icuke/cucumber.rb:212
    And I tap "Back"                                           # lib/icuke/cucumber.rb:212
    And I tap "TextFields"                                     # lib/icuke/cucumber.rb:212
    And I tap "Back"                                           # lib/icuke/cucumber.rb:212
    And I tap "SearchBar"                                      # lib/icuke/cucumber.rb:212
    And I tap "Back"                                           # lib/icuke/cucumber.rb:212
    And I tap "TextView"                                       # lib/icuke/cucumber.rb:212
    And I tap "Back"                                           # lib/icuke/cucumber.rb:212
    And I tap "Images"                                         # lib/icuke/cucumber.rb:212
    And I tap "Back"                                           # lib/icuke/cucumber.rb:212
    And I tap "Web"                                            # lib/icuke/cucumber.rb:212
    And I tap "Back"                                           # lib/icuke/cucumber.rb:212
    And I tap "Segment"                                        # lib/icuke/cucumber.rb:212
    And I tap "Back"                                           # lib/icuke/cucumber.rb:212
    And I scroll down                                          # lib/icuke/cucumber.rb:224
    And I tap "Toolbar"                                        # lib/icuke/cucumber.rb:212
    And I tap "Back"                                           # lib/icuke/cucumber.rb:212
    And I tap "Alerts"                                         # lib/icuke/cucumber.rb:212
    And I tap "Back"                                           # lib/icuke/cucumber.rb:212
    And I tap "Transitions"                                    # lib/icuke/cucumber.rb:212
    And I tap "Back"                                           # lib/icuke/cucumber.rb:212

  Scenario: Scrolling up and down                              # features/uicatalog.feature:34
    When I tap "Buttons"                                       # lib/icuke/cucumber.rb:212
    And I scroll down                                          # lib/icuke/cucumber.rb:224
    And I scroll up                                            # lib/icuke/cucumber.rb:224
    And I tap "Back"                                           # lib/icuke/cucumber.rb:212
    And I scroll down                                          # lib/icuke/cucumber.rb:224
    And I tap "Transitions"                                    # lib/icuke/cucumber.rb:212

  Scenario: Pressing buttons                                   # features/uicatalog.feature:42
    When I tap "Buttons"                                       # lib/icuke/cucumber.rb:212
    And I tap "Gray"                                           # lib/icuke/cucumber.rb:212
    And I tap "Right pointing arrow"                           # lib/icuke/cucumber.rb:212
    And I tap "Rounded"                                        # lib/icuke/cucumber.rb:212
    And I scroll down                                          # lib/icuke/cucumber.rb:224
    And I tap "More info"                                      # lib/icuke/cucumber.rb:212
    And I tap "Add contact"                                    # lib/icuke/cucumber.rb:212

  Scenario: Switches and sliders                               # features/uicatalog.feature:51
    When I tap "Controls"                                      # lib/icuke/cucumber.rb:212
    And I tap "Standard switch"                                # lib/icuke/cucumber.rb:212
    Then show me the screen                                    # lib/icuke/cucumber.rb:236

  Scenario: Finding text                                                                        # features/uicatalog.feature:56
    When I tap "TextView"                                                                       # lib/icuke/cucumber.rb:212
    Then I should see "Now is the time for all good developers to come to serve their country." # lib/icuke/cucumber.rb:204

  Scenario: Entering text                                               # features/uicatalog.feature:60
    When I tap "TextFields"                                             # lib/icuke/cucumber.rb:212
    And I type "A string with symb0ls $!@ and spaces in it" in "Normal" # lib/icuke/cucumber.rb:216
    And I type "cucumber for iphone" in "Rounded"                       # lib/icuke/cucumber.rb:216
    And I type "secret" in "Secure"                                     # lib/icuke/cucumber.rb:216
    Then I should see "A string with symb0ls $!@ and spaces in it"      # lib/icuke/cucumber.rb:204
    And I should see "cucumber for iphone"                              # lib/icuke/cucumber.rb:204

  Scenario: Segment                                            # features/uicatalog.feature:68
    When I tap "Segment"                                       # lib/icuke/cucumber.rb:212
    And I tap "Check"                                          # lib/icuke/cucumber.rb:212
    And I tap "Search"                                         # lib/icuke/cucumber.rb:212
    And I tap "Tools"                                          # lib/icuke/cucumber.rb:212

  Scenario: Web                                                # features/uicatalog.feature:74
    When I tap "Web"                                           # lib/icuke/cucumber.rb:212
    And I tap "Clear text"                                     # lib/icuke/cucumber.rb:212
    And I type "http://www.leandog.com" in "URL entry"         # lib/icuke/cucumber.rb:216

  Scenario: Toolbar                                            # features/uicatalog.feature:79
    When I scroll down                                         # lib/icuke/cucumber.rb:224
    And I tap "Toolbar"                                        # lib/icuke/cucumber.rb:212
    And I tap "Black"                                          # lib/icuke/cucumber.rb:212
    And I tap "Translucent"                                    # lib/icuke/cucumber.rb:212
    And I tap "Default"                                        # lib/icuke/cucumber.rb:212
    And I tap "Tinted"                                         # lib/icuke/cucumber.rb:212
    And I tap "Bordered"                                       # lib/icuke/cucumber.rb:212
    And I tap "Plain"                                          # lib/icuke/cucumber.rb:212
    And I tap "Item"                                           # lib/icuke/cucumber.rb:212
    And I tap "Done"                                           # lib/icuke/cucumber.rb:212

  Scenario: Transitions                                        # features/uicatalog.feature:91
    When I scroll down                                         # lib/icuke/cucumber.rb:224
    And I tap "Transitions"                                    # lib/icuke/cucumber.rb:212
    And I tap "Flip Image"                                     # lib/icuke/cucumber.rb:212
    And I tap "Flip Image"                                     # lib/icuke/cucumber.rb:212
    And I tap "Curl Image"                                     # lib/icuke/cucumber.rb:212
    And I tap "Curl Image"                                     # lib/icuke/cucumber.rb:212

  Scenario: Draging                                            # features/uicatalog.feature:99
    And I tap "Controls"                                       # lib/icuke/cucumber.rb:212
    When I drag from 258,285 to 319,285                        # lib/icuke/cucumber.rb:220
    And I drag from 244,439 to 319,439                         # lib/icuke/cucumber.rb:220
    And I tap "Back"                                           # lib/icuke/cucumber.rb:212
    And I scroll down                                          # lib/icuke/cucumber.rb:224
    And I tap "Toolbar"                                        # lib/icuke/cucumber.rb:212
    And I drag from 97,400 to 97,233                           # lib/icuke/cucumber.rb:220
    And I tap "Back"                                           # lib/icuke/cucumber.rb:212

  Scenario: Alerts                                             # features/uicatalog.feature:109
    When I scroll down                                         # lib/icuke/cucumber.rb:224
    And I tap "Alerts"                                         # lib/icuke/cucumber.rb:212
    Then show me the screen                                    # lib/icuke/cucumber.rb:236

Failing Scenarios:
cucumber features/uicatalog.feature:9 # Scenario: Navigating through the application

12 scenarios (1 failed, 11 skipped)
93 steps (1 failed, 92 skipped)
0m1.930s
rake aborted!
Command failed with status (1): [/Users/aslakhellesoy/.rvm/rubies/ruby-1.8....]

problem with scroll_to

scroll_to is not granular enough. It often scrolls past the item you are scrolling to.

project status?

Is this project still being maintained? I noticed it hasn't been updated in a long time and the has open issues from months ago.

Scrolling large lists

Hey fellas,
First off, great work on this project. My team is building a pretty sophisticated iphone app and the automated testing (and integration testing) we get by integrating iCuke is amazing. Thanks!

I would like to ask about scrolling large lists. We would like to click on every item in a list of 200+ items but we cannot seem to find a way to scroll through the list such that we can access each item in order, one at a time. My take on the current state of scrolling is that you need a label to scroll to, is that correct? If we do not know the labels to scroll to in advance is there a way to accomplish what we want?

BTW, I have folks here who would be very interested in contributing if you are looking for contributors.

UIDatePicker hangs executable

I've noticed that the presence of a UIDatePicker anywhere in the view hierarchy seems to cause my application to hang during Cucumber tests.

You can reproduce the issue in Universal.app by adding the following line to the end of -[TestViewController_Shared viewDidLoad]:

[self.view addSubview:[[[UIDatePicker alloc] init] autorelease]];

Then recompile and run cucumber in the project root. The app will hang in Simulator, and the test suite will fail with a trace showing a timeout exception.

undefined method `closed?'

I am trying to run a simple feature, and while iCuke does launch the iPhone simulator when I invoke cucumber, I get the following error message:

Background: # features/example.feature:6
Given "foo.xcodeproj" is loaded in the iphone simulator # rprise-edition/2010.01/lib/ruby/gems/1.8/gems/iCuke-0.6.3/lib/icuke/cucumber.rb:197
undefined method closed?' for nil:NilClass (NoMethodError) /usr/local/Cellar/ruby-enterprise-edition/2010.01/lib/ruby/1.8/net/http.rb:1060:inrequest'
/usr/local/Cellar/ruby-enterprise-edition/2010.01/lib/ruby/1.8/timeout.rb:62:in timeout' features/example.feature:7:inGiven "foo.xcodeproj" is loaded in the iphone simulator'

I am using Ruby Enterprise Edition (http://www.rubyenterpriseedition.com/) Thoughts?

Any luck running this on iOS5?

Has anyone had any luck getting iCuke to run with iOS5?

Seems like a great tool -- I'd love to see it brought up to date!

"iCuke does not currently support version 5.1 of the iPhone SDK" error

Hi @ALL,

I was trying to run the command "rake features" after installing icuke on my Mac and I got the following error:

iCuke does not currently support version 5.1 of the iPhone SDK, skipping

I am running this on my Xcode version 4.3.3.

Is there a way to fix this problem?. Please help me.

Kamal

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.