SlideShare a Scribd company logo
1 of 32
CALABASH
For iPhone Apps
By Chathura Palihakkara.
ROAD MAP
• What is calabash
• Main Components
• Simple demo
• Q&A
• Getting started
WHAT IS CALABASH
• Framework that enables you to write and execute
automated acceptance tests for mobile apps.
• Supporting cross-platform, Android and iOS native apps.
• Free and open source.
• Behavior-driven developing(BDD) with natural language.

• Supports continuous integration.
• By Karl Krukow and Joshua Moody
CALABASH ARCHITECTURE

Step Definitions
Step Definitions
Step Definitions

Feature Files
Feature Files
Feature Files

Dev PC / Build server

Calabash iOS
Client

JVM

Ruby
Gems

Device / Simulator

HTTP

Calabash HTTP
server
MAIN COMPONENTS
• Feature files

• Contains the sequential actions for the test.
• Step definitions
• Contains the steps definitions written in Ruby.
• Support files

• Contains project configurations (Build path).
FEATURE FILES
FEATURE
•
•
•
•

Abstract Description of the Test Case <name of feature>
In order to <meet some goal>
As a <type of role>
I want <a feature>

SCENARIO
•
•
•

Gestures
Touches or gestures (e.g., tap, swipe and rotate).
Assertions
There should be a "Login" button or I should see a Alert message.
Screenshots
Screen dump the current view on the current device model

Note: There is no place like HOME.
Always start from HOME and come back to it.
FEATURE FILES
Feature: Validate user login
As a registered user
In order to see user details
I want be able to sign in to the App with correct credentials
Scenario: User logged in and see user details
Given I go to the Home Screen
When I touch “My account” button
Then I wait to see Login Screen
Then I enter "my_username" into text field number 1
Then I wait
Then I enter "my_password" into text field number 2
Then I wait
when I touch "Sign In" button
Then I wait to see My account screen
Then I should see "my_username” label
Then I should see ”072-3354020” label
when I touch "Sign Out" button
Then I wait to see Home Screen
Then I finish the test
STEP DEFINITIONS
Then I touch the ”Sign In" button

Then /^I touch the "([^"]*)" button$/ do |name|
If elements_exist( ["button marked:'#{name}'”])
touch("button marked:'#{name}'")
sleep(STEP_PAUSE)
else
screenshot_and_raise "'#{name}' Button isnt exsist.”
end
end
UI QUERY
• How you can find the current visible components in the iPhone/
simulator screen.
• Open ruby console to write UI Query
• In mac terminal type “calabash-ios console”
Ex:
1. query("view:'UIButton'",:accessibilityLabel)
[
[0] "icon rewards new",
[1] "icon my receipts new",
[2] "icon my account",
[3] "icon order@2x",
[4] "icon check in"
]
2. element_exists("button marked:'Delivery'”)
false
STEP DEFINITIONS
COMBINED STEPS

Then /^I delete order from checkout screen$/ do
steps %{
Then I should see a "Delete" button
Then I touch the "Delete" button after it appears
Then I wait for 1 seconds
Then I see an alert with "Are you sure you want to delete this order?" text

Then I touch the "YES" button
Then I wait for 1 seconds
Then I go Home Screen
}
end
REPORTS
Several types of detailed calabash repots
DEMO
USER LOG-IN WITH CORRECT CREDENTIALS
Feature: User log-in with correct credentials
In order to use LeapsetApp
As a Registerd user
I want to be able to successfully log-in
file_name: demo_login.feature

Test Case: IPA-21

Scenario: User log-in with correct credentials
Given I start from the Home Screen
When I touch MyAccount button

Then I should see login screen
Then I sign In with name "calabash@leapset.com" pass "chathura123"
And I wait until UIActivityIndicator is gone
Then I should see myAccount screen
Then I see the text "calabash@leapset.com"
Then I see the text "Take rode, My Street, Owk city, AL, 55555”
When I touch Sign Out button
Then I should see home screen
DIRECTORY STRUCTURE
Project root

Features folder

Step_definition folder
RUN
Use Terminal and go to Project directory

Launch the app in the simulator and come to the home page
Then run the command

Now it runs the test on the simulator
Create a result as a HTML page in side the root directory
RESULT
Q&A
GETTING STARTED
• Setup calabash environment

• Set up iOS project and configure it for calabash
• Run calabash tests for iPhone app
• Start writing test features

Set up https://github.com/calabash/calabash-ios
PREREQUISITES
1. Macintosh PC.

2. Xcode 4.x.x or above Installed.
3. Xcode command line tools Installed.
4. iPhone SDK 6.0 and iPhone simulator 6.0 installed.
5. JAVA JRE 1.6 or above installed
6. Ruby v1.9 or above installed
7. Stable Internet connection.
CONFIGURE LEAPSET iPhone
CONSUMER APP
•

Checkout project source using terminal
$ svn co svn+ssh://checkout url

•

Open project using Xcode make sure the app run on the iPhone simulator

•

Install calabash-cucumber ruby gem using terminal
$ sudo gem install calabash-cucumber

•

Select Leapset project in XCode and select your product target for your
app.

•

Right click (or two-finger tap) your target and select "Duplicate target”
Select "Duplicate only" (not transition to iPad)
Configure iPhone App
•

Rename your new target from ”ProjectName" to "ProjectName-cal”.

•

From the menu select Scheme and select manage schemes Rename the
new scheme from "ProjectName copy" to "ProjectName-cal”.

•

From the menu select Scheme and select Edit schemes set build
configurations to Staging on ProjectName-cal target.(if you have “Staging”
scheme else select your scheme correctly).
Configure iPhone App
• Download the latest version of calabash-ios at
https://s3.amazonaws.com/calabashapp/Calabash.zip
• Unzip the file and Drag calabash.framework folder into you project's
Frameworks folder in xcode navigation pane.
• Make sure that

(i)Copy items into destination group's folder (if needed) is
checked
(ii) only your "-cal " target is checked in Add to targets
Configure iPhone App
You should see like this.
Configure iPhone App
• Target Build Settings
•
•
•

Click on your project and select your new ”ProjectName-cal"
target. Select "Build Settings"
Ensure that "All" and not "Basic" settings are selected in "build
settings”.
Find "Product name" (you can type "Product name" in the search field).
Set the Product name to Productname-cal
Configure iPhone App
•

Find "Valid Architectures" in Build Settings and Add "i386" for the new target.
Configure iPhone App
Find "Other Linker Flags" in Build Settings and set flags

(i)-lxml2 $(inherited)
(ii)-force_load "$(SRCROOT)/calabash.framework/calabash"
(iii)-lstdc++
Configure iPhone App
• In Xcode select your ”ProjectName-cal" scheme and then run you app
on 6.0 simulator once.

• Allow location services by pressing "OK" for the location services alert
if present.
Configure iPhone App
• Open Terminal and direct it to the project root
$ cd /User/Desktop/release-1.081/ProjectName

•

Generate features folder in side the project root using terminal Type

•
•
•

$ calabash-ios gen
Press "Return(Enter)" again to confirm the action
This will create the default folder structure for calabash

Features directory created
ADD CURRENT TEST TO THE PROJECT
• In the project root add a new calabash feature file in to “features"
folder and Launch the app in simulator
• Run the tests using command (since app is already launch in the
simulator and running)
•
•

NO_LAUNCH=1 cucumber --format html --out result.html features/<file
name>.feature
You can get help form type cucumber –help

• Open the result.html To see the results.
•

Remember feature files ended with extinction “.feature”

• Install eclipse and import and open “features” folder as a project to
write new test cases or Net beans have more support with a plugin.
https://github.com/QuBiT/cucumber-netbeans-plugin/wiki/Install
Q&A

More Related Content

What's hot

Exposing Salesforce REST Services Using Swagger
Exposing Salesforce REST Services Using SwaggerExposing Salesforce REST Services Using Swagger
Exposing Salesforce REST Services Using SwaggerSalesforce Developers
 
CUCUMBER - Making BDD Fun
CUCUMBER - Making BDD FunCUCUMBER - Making BDD Fun
CUCUMBER - Making BDD FunSQABD
 
Mobile Automation with Appium
Mobile Automation with AppiumMobile Automation with Appium
Mobile Automation with AppiumManoj Kumar Kumar
 
"I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more."I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more.Fabio Milano
 
BDD testing with cucumber
BDD testing with cucumberBDD testing with cucumber
BDD testing with cucumberDaniel Kummer
 
Enterprise Strength Mobile JavaScript
Enterprise Strength Mobile JavaScriptEnterprise Strength Mobile JavaScript
Enterprise Strength Mobile JavaScriptTroy Miles
 
Mobile Test Automation at eBay
Mobile Test Automation at eBayMobile Test Automation at eBay
Mobile Test Automation at eBayDominik Dary
 
Mobile WebDriver Selendroid
Mobile WebDriver SelendroidMobile WebDriver Selendroid
Mobile WebDriver SelendroidDominik Dary
 
Continuous delivery for native apps
Continuous delivery for native appsContinuous delivery for native apps
Continuous delivery for native appsNiels Frydenholm
 
Deploy your app with one Slack command
Deploy your app with one Slack commandDeploy your app with one Slack command
Deploy your app with one Slack commandFabio Milano
 
Observability and Troubleshooting in Forge
Observability and Troubleshooting in ForgeObservability and Troubleshooting in Forge
Observability and Troubleshooting in ForgeAtlassian
 
Getting started with appium
Getting started with appiumGetting started with appium
Getting started with appiumPratik Patel
 
Selenium Testing on Chrome - Google DevFest Armenia 2015
Selenium Testing on Chrome - Google DevFest Armenia 2015Selenium Testing on Chrome - Google DevFest Armenia 2015
Selenium Testing on Chrome - Google DevFest Armenia 2015Sargis Sargsyan
 
Android Test Automation – one year later
Android Test Automation – one year laterAndroid Test Automation – one year later
Android Test Automation – one year laterDominik Dary
 
Nakal think test_2015
Nakal think test_2015Nakal think test_2015
Nakal think test_2015Rajdeep Varma
 
Selendroid in Action
Selendroid in ActionSelendroid in Action
Selendroid in ActionDominik Dary
 
Designing Forge UI: A Story of Designing an App UI System
Designing Forge UI: A Story of Designing an App UI SystemDesigning Forge UI: A Story of Designing an App UI System
Designing Forge UI: A Story of Designing an App UI SystemAtlassian
 
Selendroid - Selenium for Android
Selendroid - Selenium for AndroidSelendroid - Selenium for Android
Selendroid - Selenium for AndroidDominik Dary
 
Fashionable XCUITest for iOS Apps by Shashikant Jagtap
Fashionable XCUITest for iOS Apps by Shashikant JagtapFashionable XCUITest for iOS Apps by Shashikant Jagtap
Fashionable XCUITest for iOS Apps by Shashikant JagtapSauce Labs
 
Automation testing on ios platform using appium
Automation testing on ios platform using appiumAutomation testing on ios platform using appium
Automation testing on ios platform using appiumAmbreen Khan
 

What's hot (20)

Exposing Salesforce REST Services Using Swagger
Exposing Salesforce REST Services Using SwaggerExposing Salesforce REST Services Using Swagger
Exposing Salesforce REST Services Using Swagger
 
CUCUMBER - Making BDD Fun
CUCUMBER - Making BDD FunCUCUMBER - Making BDD Fun
CUCUMBER - Making BDD Fun
 
Mobile Automation with Appium
Mobile Automation with AppiumMobile Automation with Appium
Mobile Automation with Appium
 
"I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more."I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more.
 
BDD testing with cucumber
BDD testing with cucumberBDD testing with cucumber
BDD testing with cucumber
 
Enterprise Strength Mobile JavaScript
Enterprise Strength Mobile JavaScriptEnterprise Strength Mobile JavaScript
Enterprise Strength Mobile JavaScript
 
Mobile Test Automation at eBay
Mobile Test Automation at eBayMobile Test Automation at eBay
Mobile Test Automation at eBay
 
Mobile WebDriver Selendroid
Mobile WebDriver SelendroidMobile WebDriver Selendroid
Mobile WebDriver Selendroid
 
Continuous delivery for native apps
Continuous delivery for native appsContinuous delivery for native apps
Continuous delivery for native apps
 
Deploy your app with one Slack command
Deploy your app with one Slack commandDeploy your app with one Slack command
Deploy your app with one Slack command
 
Observability and Troubleshooting in Forge
Observability and Troubleshooting in ForgeObservability and Troubleshooting in Forge
Observability and Troubleshooting in Forge
 
Getting started with appium
Getting started with appiumGetting started with appium
Getting started with appium
 
Selenium Testing on Chrome - Google DevFest Armenia 2015
Selenium Testing on Chrome - Google DevFest Armenia 2015Selenium Testing on Chrome - Google DevFest Armenia 2015
Selenium Testing on Chrome - Google DevFest Armenia 2015
 
Android Test Automation – one year later
Android Test Automation – one year laterAndroid Test Automation – one year later
Android Test Automation – one year later
 
Nakal think test_2015
Nakal think test_2015Nakal think test_2015
Nakal think test_2015
 
Selendroid in Action
Selendroid in ActionSelendroid in Action
Selendroid in Action
 
Designing Forge UI: A Story of Designing an App UI System
Designing Forge UI: A Story of Designing an App UI SystemDesigning Forge UI: A Story of Designing an App UI System
Designing Forge UI: A Story of Designing an App UI System
 
Selendroid - Selenium for Android
Selendroid - Selenium for AndroidSelendroid - Selenium for Android
Selendroid - Selenium for Android
 
Fashionable XCUITest for iOS Apps by Shashikant Jagtap
Fashionable XCUITest for iOS Apps by Shashikant JagtapFashionable XCUITest for iOS Apps by Shashikant Jagtap
Fashionable XCUITest for iOS Apps by Shashikant Jagtap
 
Automation testing on ios platform using appium
Automation testing on ios platform using appiumAutomation testing on ios platform using appium
Automation testing on ios platform using appium
 

Similar to Calabash for iPhone apps

Getting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingGetting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingBitbar
 
FI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsPetr Dvorak
 
Continous Integration for iOS Projects
Continous Integration for iOS ProjectsContinous Integration for iOS Projects
Continous Integration for iOS ProjectsCiprian Redinciuc
 
Google Map Implementation with offline feature.
Google Map Implementation with offline feature.Google Map Implementation with offline feature.
Google Map Implementation with offline feature.Jayanta Sinhamahapatra
 
iOS Development Survival Guide for the .NET Guy
iOS Development Survival Guide for the .NET GuyiOS Development Survival Guide for the .NET Guy
iOS Development Survival Guide for the .NET GuyNick Landry
 
Intro to Continuous Integration at SoundCloud
Intro to Continuous Integration at SoundCloudIntro to Continuous Integration at SoundCloud
Intro to Continuous Integration at SoundCloudgarriguv
 
Appium Meetup #2 - Mobile Web Automation Introduction
Appium Meetup #2 - Mobile Web Automation IntroductionAppium Meetup #2 - Mobile Web Automation Introduction
Appium Meetup #2 - Mobile Web Automation Introductionsnevesbarros
 
MFF UK - Introduction to iOS
MFF UK - Introduction to iOSMFF UK - Introduction to iOS
MFF UK - Introduction to iOSPetr Dvorak
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopmentgillygize
 
Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]Sentinel Solutions Ltd
 
Telerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT ConferenceTelerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT ConferenceJen Looper
 
Build Your First Android App Session #1
Build Your First Android App Session #1Build Your First Android App Session #1
Build Your First Android App Session #1Troy Miles
 
Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...Niels Frydenholm
 
Getting started with Appcelerator Titanium
Getting started with Appcelerator TitaniumGetting started with Appcelerator Titanium
Getting started with Appcelerator TitaniumTechday7
 
Bluemix and DevOps workshop lab
Bluemix and DevOps workshop labBluemix and DevOps workshop lab
Bluemix and DevOps workshop labbenm4nn
 
Getting started with titanium
Getting started with titaniumGetting started with titanium
Getting started with titaniumNaga Harish M
 
Cordova: Making Native Mobile Apps With Your Web Skills
Cordova: Making Native Mobile Apps With Your Web SkillsCordova: Making Native Mobile Apps With Your Web Skills
Cordova: Making Native Mobile Apps With Your Web SkillsClay Ewing
 

Similar to Calabash for iPhone apps (20)

Getting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingGetting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App Testing
 
Intro to appcelerator
Intro to appceleratorIntro to appcelerator
Intro to appcelerator
 
SpringBoot
SpringBootSpringBoot
SpringBoot
 
FI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS Basics
 
Continous Integration for iOS Projects
Continous Integration for iOS ProjectsContinous Integration for iOS Projects
Continous Integration for iOS Projects
 
Google Map Implementation with offline feature.
Google Map Implementation with offline feature.Google Map Implementation with offline feature.
Google Map Implementation with offline feature.
 
iOS Development Survival Guide for the .NET Guy
iOS Development Survival Guide for the .NET GuyiOS Development Survival Guide for the .NET Guy
iOS Development Survival Guide for the .NET Guy
 
Intro to Continuous Integration at SoundCloud
Intro to Continuous Integration at SoundCloudIntro to Continuous Integration at SoundCloud
Intro to Continuous Integration at SoundCloud
 
Appium Meetup #2 - Mobile Web Automation Introduction
Appium Meetup #2 - Mobile Web Automation IntroductionAppium Meetup #2 - Mobile Web Automation Introduction
Appium Meetup #2 - Mobile Web Automation Introduction
 
MFF UK - Introduction to iOS
MFF UK - Introduction to iOSMFF UK - Introduction to iOS
MFF UK - Introduction to iOS
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopment
 
Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]
 
Telerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT ConferenceTelerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT Conference
 
Build Your First Android App Session #1
Build Your First Android App Session #1Build Your First Android App Session #1
Build Your First Android App Session #1
 
Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Getting started with Appcelerator Titanium
Getting started with Appcelerator TitaniumGetting started with Appcelerator Titanium
Getting started with Appcelerator Titanium
 
Bluemix and DevOps workshop lab
Bluemix and DevOps workshop labBluemix and DevOps workshop lab
Bluemix and DevOps workshop lab
 
Getting started with titanium
Getting started with titaniumGetting started with titanium
Getting started with titanium
 
Cordova: Making Native Mobile Apps With Your Web Skills
Cordova: Making Native Mobile Apps With Your Web SkillsCordova: Making Native Mobile Apps With Your Web Skills
Cordova: Making Native Mobile Apps With Your Web Skills
 

Recently uploaded

Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterMateoGardella
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 

Recently uploaded (20)

Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 

Calabash for iPhone apps

  • 1. CALABASH For iPhone Apps By Chathura Palihakkara.
  • 2. ROAD MAP • What is calabash • Main Components • Simple demo • Q&A • Getting started
  • 3. WHAT IS CALABASH • Framework that enables you to write and execute automated acceptance tests for mobile apps. • Supporting cross-platform, Android and iOS native apps. • Free and open source. • Behavior-driven developing(BDD) with natural language. • Supports continuous integration. • By Karl Krukow and Joshua Moody
  • 4. CALABASH ARCHITECTURE Step Definitions Step Definitions Step Definitions Feature Files Feature Files Feature Files Dev PC / Build server Calabash iOS Client JVM Ruby Gems Device / Simulator HTTP Calabash HTTP server
  • 5. MAIN COMPONENTS • Feature files • Contains the sequential actions for the test. • Step definitions • Contains the steps definitions written in Ruby. • Support files • Contains project configurations (Build path).
  • 6. FEATURE FILES FEATURE • • • • Abstract Description of the Test Case <name of feature> In order to <meet some goal> As a <type of role> I want <a feature> SCENARIO • • • Gestures Touches or gestures (e.g., tap, swipe and rotate). Assertions There should be a "Login" button or I should see a Alert message. Screenshots Screen dump the current view on the current device model Note: There is no place like HOME. Always start from HOME and come back to it.
  • 7. FEATURE FILES Feature: Validate user login As a registered user In order to see user details I want be able to sign in to the App with correct credentials Scenario: User logged in and see user details Given I go to the Home Screen When I touch “My account” button Then I wait to see Login Screen Then I enter "my_username" into text field number 1 Then I wait Then I enter "my_password" into text field number 2 Then I wait when I touch "Sign In" button Then I wait to see My account screen Then I should see "my_username” label Then I should see ”072-3354020” label when I touch "Sign Out" button Then I wait to see Home Screen Then I finish the test
  • 8. STEP DEFINITIONS Then I touch the ”Sign In" button Then /^I touch the "([^"]*)" button$/ do |name| If elements_exist( ["button marked:'#{name}'”]) touch("button marked:'#{name}'") sleep(STEP_PAUSE) else screenshot_and_raise "'#{name}' Button isnt exsist.” end end
  • 9. UI QUERY • How you can find the current visible components in the iPhone/ simulator screen. • Open ruby console to write UI Query • In mac terminal type “calabash-ios console” Ex: 1. query("view:'UIButton'",:accessibilityLabel) [ [0] "icon rewards new", [1] "icon my receipts new", [2] "icon my account", [3] "icon order@2x", [4] "icon check in" ] 2. element_exists("button marked:'Delivery'”) false
  • 10. STEP DEFINITIONS COMBINED STEPS Then /^I delete order from checkout screen$/ do steps %{ Then I should see a "Delete" button Then I touch the "Delete" button after it appears Then I wait for 1 seconds Then I see an alert with "Are you sure you want to delete this order?" text Then I touch the "YES" button Then I wait for 1 seconds Then I go Home Screen } end
  • 11. REPORTS Several types of detailed calabash repots
  • 12. DEMO
  • 13. USER LOG-IN WITH CORRECT CREDENTIALS Feature: User log-in with correct credentials In order to use LeapsetApp As a Registerd user I want to be able to successfully log-in file_name: demo_login.feature Test Case: IPA-21 Scenario: User log-in with correct credentials Given I start from the Home Screen When I touch MyAccount button Then I should see login screen Then I sign In with name "calabash@leapset.com" pass "chathura123" And I wait until UIActivityIndicator is gone Then I should see myAccount screen Then I see the text "calabash@leapset.com" Then I see the text "Take rode, My Street, Owk city, AL, 55555” When I touch Sign Out button Then I should see home screen
  • 14. DIRECTORY STRUCTURE Project root Features folder Step_definition folder
  • 15. RUN Use Terminal and go to Project directory Launch the app in the simulator and come to the home page Then run the command Now it runs the test on the simulator Create a result as a HTML page in side the root directory
  • 17. Q&A
  • 18. GETTING STARTED • Setup calabash environment • Set up iOS project and configure it for calabash • Run calabash tests for iPhone app • Start writing test features Set up https://github.com/calabash/calabash-ios
  • 19. PREREQUISITES 1. Macintosh PC. 2. Xcode 4.x.x or above Installed. 3. Xcode command line tools Installed. 4. iPhone SDK 6.0 and iPhone simulator 6.0 installed. 5. JAVA JRE 1.6 or above installed 6. Ruby v1.9 or above installed 7. Stable Internet connection.
  • 20. CONFIGURE LEAPSET iPhone CONSUMER APP • Checkout project source using terminal $ svn co svn+ssh://checkout url • Open project using Xcode make sure the app run on the iPhone simulator • Install calabash-cucumber ruby gem using terminal $ sudo gem install calabash-cucumber • Select Leapset project in XCode and select your product target for your app. • Right click (or two-finger tap) your target and select "Duplicate target” Select "Duplicate only" (not transition to iPad)
  • 21. Configure iPhone App • Rename your new target from ”ProjectName" to "ProjectName-cal”. • From the menu select Scheme and select manage schemes Rename the new scheme from "ProjectName copy" to "ProjectName-cal”. • From the menu select Scheme and select Edit schemes set build configurations to Staging on ProjectName-cal target.(if you have “Staging” scheme else select your scheme correctly).
  • 22.
  • 23. Configure iPhone App • Download the latest version of calabash-ios at https://s3.amazonaws.com/calabashapp/Calabash.zip • Unzip the file and Drag calabash.framework folder into you project's Frameworks folder in xcode navigation pane. • Make sure that (i)Copy items into destination group's folder (if needed) is checked (ii) only your "-cal " target is checked in Add to targets
  • 24.
  • 25. Configure iPhone App You should see like this.
  • 26. Configure iPhone App • Target Build Settings • • • Click on your project and select your new ”ProjectName-cal" target. Select "Build Settings" Ensure that "All" and not "Basic" settings are selected in "build settings”. Find "Product name" (you can type "Product name" in the search field). Set the Product name to Productname-cal
  • 27. Configure iPhone App • Find "Valid Architectures" in Build Settings and Add "i386" for the new target.
  • 28. Configure iPhone App Find "Other Linker Flags" in Build Settings and set flags (i)-lxml2 $(inherited) (ii)-force_load "$(SRCROOT)/calabash.framework/calabash" (iii)-lstdc++
  • 29. Configure iPhone App • In Xcode select your ”ProjectName-cal" scheme and then run you app on 6.0 simulator once. • Allow location services by pressing "OK" for the location services alert if present.
  • 30. Configure iPhone App • Open Terminal and direct it to the project root $ cd /User/Desktop/release-1.081/ProjectName • Generate features folder in side the project root using terminal Type • • • $ calabash-ios gen Press "Return(Enter)" again to confirm the action This will create the default folder structure for calabash Features directory created
  • 31. ADD CURRENT TEST TO THE PROJECT • In the project root add a new calabash feature file in to “features" folder and Launch the app in simulator • Run the tests using command (since app is already launch in the simulator and running) • • NO_LAUNCH=1 cucumber --format html --out result.html features/<file name>.feature You can get help form type cucumber –help • Open the result.html To see the results. • Remember feature files ended with extinction “.feature” • Install eclipse and import and open “features” folder as a project to write new test cases or Net beans have more support with a plugin. https://github.com/QuBiT/cucumber-netbeans-plugin/wiki/Install
  • 32. Q&A

Editor's Notes

  1. Calabash iOS consists of two parts: a client library written in Ruby, and calabash.framework, a server framework written in Objective-C (a Clojure/JVM version of the client is coming too). To use calabash you make a special test target in XCode that links with calabash.framework. The application is otherwise unchanged. The server framework will start an HTTP server inside your app that listens for requests from the client library.The cucumber tool executes your feature files which contain steps that are defined either in predefined or custom (user defined) steps definitions. Custom steps are written using the API that the client library exposes. The API methods make HTTP requests to the server, which does things like finding components in the UI and taking actions on them. Here is an illustration: