calabash andoird + calabash ios

25
Calabash Andoird + Calabash iOS automated testing of mobile applications

Upload: anadeainc

Post on 10-Apr-2017

323 views

Category:

Software


2 download

TRANSCRIPT

Calabash Andoird + Calabash iOSautomated testing of mobile applications

Is it time to automate?

Tools

Android iOS

Calabash Android Calabash iOS

MonkeyTalk Frank

Robotium UIAutomation

Selendroid KeepItFunctional

UIAutomator ios-driver

Which tool to choose?

Which tool to choose?

The key factors

● Ruby on Rails server● Cross-platform support (Android, iOS)● framework updatability● running on real devices

Calabash. Adavantages.

● Calabash Android● Calabash iOS● Ruby● Gherkin Syntax (Cucumber style)● Calabash Android last updated - 26 days ago● Calabash iOS last updated - a month ago● Testing on the real devices

Calabash iOS. Installation

# Install calabash ios gem

$ gem install calabash-cucumber

# Generate a features dir

$ bundle exec calabash-ios gen

# Install calabash.framework to .xcodeproj

$ calabash-ios setup

calabash-ios gen

calabash-ios setup

● Generates calabash scheme for iOS project.● Connects calabash.framework to our project (testing

server)

Runnig tests. iOS

To run on physical device:

● BUNDLE_ID=com.anadea.***● DEVICE_ENDPOINT=http://192.168.100.85:37265

The launch command:

$ bundle exec cucumber

Calabash Android. Installation

# Install calabash Android gem

$ gem install calabash-android

# Generate a features dir

$ bundle exec calabash-android gen

calabash-android gen

Running tests. Android

The launch command:

$ bundle exec calabash-android run <path_to_apk>

Duplicate ourselves

iOS

sign_up.feature

sign_up_steps.rb

sign_up_screen.rb

Android

sign_up.feature

sign_up_steps.rb

sign_up_screen.rb

Design of the applications

iOS Android

WTF...

What to do?

● install gems on the server side● split PageObject into moduls● stick together calabash-ios & calabash-android launchers

Stick

Split into moduls

Modified scheme

iOS + Android

sign_up.feature

sign_up_steps.rb

ios

sign_up_screen.rb

android

sign_up_screen.rb

The launch commands

iOS

cucumber CLIENT_PLATFORM=IOS

Android

calabash-android run <path_to_apk> CLIENT_PLATFORM=Android

The advantages of implementation

● there is no duplicate code (*.feature, *_steps.rb)● possibility of easy access to objects via ActiveRecord● emulation of the second client working on the server side

The disadvantages of implementation

● different launch commands (cucumber, calabash-android run)● it is not possible to work in the debug mode, provided by calabash (remedy is

binding.pry :) )

Getting rid of disadvantages

CALABASHER(include calabash-ios & calabash-android)

Visit our blog for more great tips: anadea.info/blog