Step by step Cordova calabash-ios automation

Step by step guide about how to integrate calabash-ios with Cordova in an automated way without opening Apple Xcode.

Note: First try steps given on https://github.com/calabash/calabash-ios.
If those steps aren’t working for you then try following steps. For me only manual steps given on above link worked.
Also this script doesn’t create separate target same as “calabsh-ios setup” command.

I also presume that you have already setup your cordova project and nodejs.
  1. sudo gem install calabash-cucumber If you get any error then try using following command
    sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install calabash-cucumber
    reference
  2. Go inside your Cordova project directory npm install xcode
    npm install fs-extra
    npm install underscore
  3. Download script “cordova-calabash-ios.js” from here and paste it inside your cordova project at www level (not inside www).
    (Note: This is very primitive script you can modify it according to your need. Let me know also know when you modify it. I will update your link here)
  4. Downlaod calabsh.framework.

    You may want to modify path to calabash.framework inside above downloaded script. I have added calabash.framework in https://github.com/bharatpatil/cordova-calabash-ios however it is good if you get updated version.
  5. cordova platform add ios
    if not already added.
  6. node cordova-calabash-ios.js
  7. cordova compile ios
  8. APP_BUNDLE_PATH=”platforms/ios/build/emulator/Your ProjectName.app” DEVICE_TARGET=’iPad – Simulator – iOS 7.0′ DEVICE=”ipad” POST_START_BREAK=0 calabash-ios console

    You should be seeing something like
    Running irb…
    irb(main):001:0>
  9. start_test_server_in_background

    This will attempt to start iOS simulator and your app. Wait until it starts simulator and your app.
  10. query(“webView”)

    In output of above command you should be able to see string containing “class” => “UIWebView”.
    Further you can go through https://github.com/calabash/calabash-ios/wiki/06-WebView-Support
If you have any issues please comment below.

Comments

Popular posts from this blog

How to get local time from UTC using Moment.JS

6 steps to create local copy of your live WordPress site

Partially rendering Handlerbars from Backbone view