Code Monkey home page Code Monkey logo

calabashautomation's Introduction

x-platform-example

Example of cross-platform BDD with Cucumber and Calabash.

There is a companion talk given at CukeUp'13:

Cross-platform for Mobile

And a companion Article which explains the idea:

Test Architecture for Cross-platform

Getting Started

The example uses the open source WordPress apps for iOS and Android. Since the Android app is licensed as GPL, we do not distribute the app with this project.

You can download the apps by doing the following.

First ensure subversion is installed by typing svn --version in a command prompt.

Download and Build: Android

Ensure you ant and have Android API 13 installed. To install API 13:

$ANDROID_HOME/tools/android #now install android-13

Ensure you have Calabash Android installed in version 0.4.4.

Download and build

mkdir -p android-source
cd android-source
svn co http://android.svn.wordpress.org/tags/2.2.7/

You should now have a directory: 2.2.7 containing the source code for Android.

Finally build the .apk file

cd 2.7.7
ant debug

This should produce a file bin/Dashboard-debug.apk.

Download and Build: iOS

Ensure you have XCode (4.5+) and XCode Command Line tools installed.

Ensure you have Calabash iOS version 0.9.144 installed.

From the root directory (the one containing android-source),

mkdir -p ios-source
cd ios-source
svn co http://iphone.svn.wordpress.org/tags/3.3.1/

Setup Calabash iOS

cd 3.3.1
calabash-ios setup

Just select the default target (WordPress).

Now open the WordPress XCode workspace: open WordPress.xcworkspace

Run this xcode incantation to build:

xcodebuild build -workspace WordPress.xcworkspace -scheme WordPress-cal -configuration Debug -sdk iphonesimulator6.1 DEPLOYMENT_LOCATION=YES DSTROOT=build TARGETED_DEVICE_FAMILY=1 

(If it complains about a missing WordPress-cal scheme then just create it from XCode and make sure you select the target: WordPress-cal.)

Being Safe with Bundler

While this step is not strictly required, we recommend that you use the bundler tool to manage Ruby gem dependencies. Bundler will ensure that you're always running an explicitly defined set of Ruby gem versions.

Check that you have bundler installed by running bundle version.

If bundler is not installed run gem install bundler to install it.

Now run

`bundle install`    

Running the tests

Plug in an Android phone (or for the patient, start an Android emulator). Run the login feature on Android phone:

bundle exec calabash-android run android-source/2.2.7/bin/Dashboard-debug.apk -p android features/login.feature

You should see

No test server found for this combination of app and calabash version. Recreating test server.
Done signing the test server. Moved it to test_servers/80b8b6c0a44b6e16d2bd7f4aeba0d2ac_0.4.4.apk
Using the android profile...
Feature: Login
...

Now run the login feature on iPhone:

bundle exec cucumber -p ios features/login.feature

Hopefully that works out well :)

calabashautomation's People

Contributors

saikrishna321 avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

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.