SlideShare a Scribd company logo
1 of 64
Download to read offline
Acceptance Testing 
with Calabash 
@roland9 
roland@intercom.io 
Xcake Dublin, 9th Dec 2014
What is Calabash?
What is Calabash? 
• Automated acceptance testing of mobile apps
What is Calabash? 
• Automated acceptance testing of mobile apps 
• Cross-platform (Android & iOS)
What is Calabash? 
• Automated acceptance testing of mobile apps 
• Cross-platform (Android & iOS) 
• Open source - Company called Xamarin 
backing it
What is Calabash? 
• Automated acceptance testing of mobile apps 
• Cross-platform (Android & iOS) 
• Open source - Company called Xamarin 
backing it 
• https://github.com/calabash/calabash-ios
What is Calabash? 
• Automated acceptance testing of mobile apps 
• Cross-platform (Android & iOS) 
• Open source - Company called Xamarin 
backing it 
• https://github.com/calabash/calabash-ios 
• https://github.com/calabash/calabash-android
Others 
• Frank, KIF, Zucchini, UIAutomation, iCuke, …
Why would I do it?
Why would I do it?
Why would I do it?
Other Testing Methods 
• Unit Tests 
• Integration Tests 
• Acceptance Tests
Unit Tests 
• Tests smallest unit of functionality 
public void TestPhoneValidator() 
{ 
string goodPhone = "(123) 555-1212"; 
string badPhone = "555 12" 
PhoneValidator validator = new PhoneValidator(); 
Assert.IsTrue(validator.IsValid(goodPhone)); 
Assert.IsFalse(validator.IsValid(badPhone)); 
} 
• Mocks and Stubs to simulate behaviour of other 
objects
Integration Tests 
• Verify that combined modules function correctly
Acceptance Tests 
• Performing tests on the full system (e.g. using 
your web page via a web browser) 
• Described in plain English
How does it work? 
• http://blog.lesspainful.com/2012/03/07/Calabash-iOS/
Install
Install 
• ruby -v -> recommended version 2.0+
Install 
• ruby -v -> recommended version 2.0+ 
• gem install calabash-cucumber
Install 
• ruby -v -> recommended version 2.0+ 
• gem install calabash-cucumber 
• cd path-to-my-ios-project
Install 
• ruby -v -> recommended version 2.0+ 
• gem install calabash-cucumber 
• cd path-to-my-ios-project 
• calabash-ios setup
Install 
• ruby -v -> recommended version 2.0+ 
• gem install calabash-cucumber 
• cd path-to-my-ios-project 
• calabash-ios setup 
• calabash-ios gen
Install 
• ruby -v -> recommended version 2.0+ 
• gem install calabash-cucumber 
• cd path-to-my-ios-project 
• calabash-ios setup 
• calabash-ios gen 
• in Xcode, build -cal scheme
Install 
• ruby -v -> recommended version 2.0+ 
• gem install calabash-cucumber 
• cd path-to-my-ios-project 
• calabash-ios setup 
• calabash-ios gen 
• in Xcode, build -cal scheme 
• cucumber
If all goes well: 
• LPSimpleExample[11298:13703] HTTPServer: 
Started HTTP server on port 37265
Build Directory 
• export APP_BUNDLE_PATH=/Users/rolandgr/ 
<…>/Build/Products/Debug-iphonesimulator/ 
<…>-cal.app
Gherkin 
• https://github.com/calabash/calabash-ios/wiki/01-Getting-started-guide
• Given … 
• When … 
• Then … 
• And …
Useful Stuff
Useful Stuff 
• export DEVICE_TARGET="iPhone 5s (7.1 Simulator)"
Useful Stuff 
• export DEVICE_TARGET="iPhone 5s (7.1 Simulator)" 
• cucumber NO_STOP=1
Useful Stuff 
• export DEVICE_TARGET="iPhone 5s (7.1 Simulator)" 
• cucumber NO_STOP=1 
• cucumber -t @current
Useful Stuff 
• export DEVICE_TARGET="iPhone 5s (7.1 Simulator)" 
• cucumber NO_STOP=1 
• cucumber -t @current 
• cucumber -t @~excludedtag
Useful Stuff 
• export DEVICE_TARGET="iPhone 5s (7.1 Simulator)" 
• cucumber NO_STOP=1 
• cucumber -t @current 
• cucumber -t @~excludedtag 
• calabash-ios console
Useful Stuff 
• export DEVICE_TARGET="iPhone 5s (7.1 Simulator)" 
• cucumber NO_STOP=1 
• cucumber -t @current 
• cucumber -t @~excludedtag 
• calabash-ios console 
• > start_test_server_in_background
Query Syntax 
• query(“button") 
=> [ 
{"class"=>"UIRoundedRectButton", "frame"=>{"y"=>287, 
"width"=>72, "x"=>100, "height"=>37}, "UIType"=>"UIControl", 
"description"=>"<UIRoundedRectButton: 0x7d463d0; frame = 
(100 287; 72 37); opaque = NO; autoresize = RM+BM; layer = 
<CALayer: 0x7d46ae0>>"}, 
{"class"=>"UIRoundedRectButton", "frame"=>{"y"=>215, 
"width"=>73, "x"=>109, "height"=>37}, "UIType"=>"UIControl", 
"description"=>"<UIRoundedRectButton: 0x7d3a760; frame = 
(109 215; 73 37); opaque = NO; autoresize = RM+BM; layer = 
<CALayer: 0x7d3a8a0>>”} 
]
• query("button index:0 label”) 
"find the first button, and then inside of that find all 
labels”. 
• query("button index:0 label", :text)
• touch("tabBarButton index:1")
accessibilityLabel 
accessibilityIdentifier
Custom Steps - Ruby API
Custom Steps - Ruby API 
• https://github.com/calabash/calabash-ios/wiki/03.5-Calabash-iOS- 
Ruby-API
Custom Steps - Ruby API 
• https://github.com/calabash/calabash-ios/wiki/03.5-Calabash-iOS- 
Ruby-API 
• query, check for existence of elements, wait for elements to exist
Custom Steps - Ruby API 
• https://github.com/calabash/calabash-ios/wiki/03.5-Calabash-iOS- 
Ruby-API 
• query, check for existence of elements, wait for elements to exist 
• keyboard
Custom Steps - Ruby API 
• https://github.com/calabash/calabash-ios/wiki/03.5-Calabash-iOS- 
Ruby-API 
• query, check for existence of elements, wait for elements to exist 
• keyboard 
• scroll
Custom Steps - Ruby API 
• https://github.com/calabash/calabash-ios/wiki/03.5-Calabash-iOS- 
Ruby-API 
• query, check for existence of elements, wait for elements to exist 
• keyboard 
• scroll 
• rotate
Custom Steps - Ruby API 
• https://github.com/calabash/calabash-ios/wiki/03.5-Calabash-iOS- 
Ruby-API 
• query, check for existence of elements, wait for elements to exist 
• keyboard 
• scroll 
• rotate 
• backdoor -> call method in iOS app (implement in app delegate)
Custom Steps - Ruby API 
• https://github.com/calabash/calabash-ios/wiki/03.5-Calabash-iOS- 
Ruby-API 
• query, check for existence of elements, wait for elements to exist 
• keyboard 
• scroll 
• rotate 
• backdoor -> call method in iOS app (implement in app delegate) 
• macro -> call other step definitions
http://www.slideshare.net/mobiletestsummit/ios-automated-testing-with-calabash-tips-and-tricks? 
qid=0afecec1-fe64-4168-bb69-a548bd01b832&v=default&b=&from_search=8
Tips and Tricks
Tips and Tricks 
• Resetting app data between scenarios
Tips and Tricks 
• Resetting app data between scenarios 
• Avoid sleep - use wait instead:
Tips and Tricks 
• Resetting app data between scenarios 
• Avoid sleep - use wait instead: 
And I wait to see "send button"
Tips and Tricks 
• Resetting app data between scenarios 
• Avoid sleep - use wait instead: 
And I wait to see "send button" 
• Wait before you interact with any element
Tips and Tricks 
• Resetting app data between scenarios 
• Avoid sleep - use wait instead: 
And I wait to see "send button" 
• Wait before you interact with any element 
• Wait after every action to finish
Tips and Tricks 
• Resetting app data between scenarios 
• Avoid sleep - use wait instead: 
And I wait to see "send button" 
• Wait before you interact with any element 
• Wait after every action to finish 
• Escape quotes…
Tips and Tricks 
• Resetting app data between scenarios 
• Avoid sleep - use wait instead: 
And I wait to see "send button" 
• Wait before you interact with any element 
• Wait after every action to finish 
• Escape quotes… 
• https://groups.google.com/forum/#!forum/calabash-ios
Optional: Compare Images 
• gem install imagemagick-binaries 
• check you have compare: $ which compare
Optional: Compare Images 
• gem install imagemagick-binaries 
• check you have compare: $ which compare
Continuous Integration
Code Coverage
Other Info 
• UIKonf talk ‘Unit Testing on iOS’ by Tim 
Brückmann https://speakerdeck.com/tibr/unit-testing- 
on-ios 
• http://calaba.sh 
• https://github.com/calabash/calabash-ios 
• http://developer.xamarin.com/guides/testcloud/ 
calabash/introduction-to-calabash/
Summary 
• Automated Testing - investment that pays off 
• Together with unit testing etc: make changes 
with confidence (still, manual QA required) 
• Cross-platform mature toolset 
• Continuous integration / code coverage
Acceptance Testing 
with Calabash 
@roland9 
roland@intercom.io 
Xcake Dublin, 9th Dec 2014

More Related Content

What's hot

Automated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/CalabashAutomated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/CalabashNiels Frydenholm
 
Getting Predictable - Pragmatic Approach for Mobile Development - Devday.lk ...
Getting Predictable - Pragmatic Approach for Mobile Development  - Devday.lk ...Getting Predictable - Pragmatic Approach for Mobile Development  - Devday.lk ...
Getting Predictable - Pragmatic Approach for Mobile Development - Devday.lk ...Anjana Somathilake
 
Test Driven Development - Workshop
Test Driven Development - WorkshopTest Driven Development - Workshop
Test Driven Development - WorkshopAnjana Somathilake
 
Experiences building apps with React Native @DomCode 2016
Experiences building apps with React Native @DomCode 2016Experiences building apps with React Native @DomCode 2016
Experiences building apps with React Native @DomCode 2016Adrian Philipp
 
Using JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot appsUsing JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot appsYakov Fain
 
Selenium and Sauce Labs
Selenium and Sauce LabsSelenium and Sauce Labs
Selenium and Sauce Labshugs
 
Nakal think test_2015
Nakal think test_2015Nakal think test_2015
Nakal think test_2015Rajdeep Varma
 
Best Practices in Mobile CI (webinar)
Best Practices in Mobile CI (webinar)Best Practices in Mobile CI (webinar)
Best Practices in Mobile CI (webinar)Sauce Labs
 
Espresso testing
Espresso testingEspresso testing
Espresso testingvodqancr
 
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
 
Mobile test automation with Selenium, Selendroid and ios-driver
Mobile test automation with Selenium, Selendroid and ios-driverMobile test automation with Selenium, Selendroid and ios-driver
Mobile test automation with Selenium, Selendroid and ios-driverMichael Palotas
 
Experiences building apps with React Native @UtrechtJS May 2016
Experiences building apps with React Native @UtrechtJS May 2016Experiences building apps with React Native @UtrechtJS May 2016
Experiences building apps with React Native @UtrechtJS May 2016Adrian Philipp
 
Mobile WebDriver Selendroid
Mobile WebDriver SelendroidMobile WebDriver Selendroid
Mobile WebDriver SelendroidDominik Dary
 
Tutorial 1: Your First Science App - Araport Developer Workshop
Tutorial 1: Your First Science App - Araport Developer WorkshopTutorial 1: Your First Science App - Araport Developer Workshop
Tutorial 1: Your First Science App - Araport Developer WorkshopVivek Krishnakumar
 
Mobile Automation Using Appium - vodQA Bangalore 2015
Mobile Automation Using Appium - vodQA Bangalore 2015Mobile Automation Using Appium - vodQA Bangalore 2015
Mobile Automation Using Appium - vodQA Bangalore 2015Thoughtworks
 
10+ Deploys Per Day: Dev and Ops Cooperation at Flickr
10+ Deploys Per Day: Dev and Ops Cooperation at Flickr10+ Deploys Per Day: Dev and Ops Cooperation at Flickr
10+ Deploys Per Day: Dev and Ops Cooperation at FlickrJohn Allspaw
 
Simplify CI with the Updated Jenkins Plugin for Sauce Labs
Simplify CI with the Updated Jenkins Plugin for Sauce LabsSimplify CI with the Updated Jenkins Plugin for Sauce Labs
Simplify CI with the Updated Jenkins Plugin for Sauce LabsSauce Labs
 
Selendroid in Action
Selendroid in ActionSelendroid in Action
Selendroid in ActionDominik Dary
 
Espresso workshop
Espresso workshopEspresso workshop
Espresso workshopKetan Soni
 

What's hot (20)

Automated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/CalabashAutomated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/Calabash
 
Getting Predictable - Pragmatic Approach for Mobile Development - Devday.lk ...
Getting Predictable - Pragmatic Approach for Mobile Development  - Devday.lk ...Getting Predictable - Pragmatic Approach for Mobile Development  - Devday.lk ...
Getting Predictable - Pragmatic Approach for Mobile Development - Devday.lk ...
 
Test Driven Development - Workshop
Test Driven Development - WorkshopTest Driven Development - Workshop
Test Driven Development - Workshop
 
Experiences building apps with React Native @DomCode 2016
Experiences building apps with React Native @DomCode 2016Experiences building apps with React Native @DomCode 2016
Experiences building apps with React Native @DomCode 2016
 
Using JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot appsUsing JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot apps
 
Selenium and Sauce Labs
Selenium and Sauce LabsSelenium and Sauce Labs
Selenium and Sauce Labs
 
Nakal think test_2015
Nakal think test_2015Nakal think test_2015
Nakal think test_2015
 
Best Practices in Mobile CI (webinar)
Best Practices in Mobile CI (webinar)Best Practices in Mobile CI (webinar)
Best Practices in Mobile CI (webinar)
 
Espresso testing
Espresso testingEspresso testing
Espresso testing
 
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
 
Mobile test automation with Selenium, Selendroid and ios-driver
Mobile test automation with Selenium, Selendroid and ios-driverMobile test automation with Selenium, Selendroid and ios-driver
Mobile test automation with Selenium, Selendroid and ios-driver
 
Experiences building apps with React Native @UtrechtJS May 2016
Experiences building apps with React Native @UtrechtJS May 2016Experiences building apps with React Native @UtrechtJS May 2016
Experiences building apps with React Native @UtrechtJS May 2016
 
Mobile WebDriver Selendroid
Mobile WebDriver SelendroidMobile WebDriver Selendroid
Mobile WebDriver Selendroid
 
Tutorial 1: Your First Science App - Araport Developer Workshop
Tutorial 1: Your First Science App - Araport Developer WorkshopTutorial 1: Your First Science App - Araport Developer Workshop
Tutorial 1: Your First Science App - Araport Developer Workshop
 
Mobile Automation Using Appium - vodQA Bangalore 2015
Mobile Automation Using Appium - vodQA Bangalore 2015Mobile Automation Using Appium - vodQA Bangalore 2015
Mobile Automation Using Appium - vodQA Bangalore 2015
 
Subversion and bugtracker
Subversion and bugtrackerSubversion and bugtracker
Subversion and bugtracker
 
10+ Deploys Per Day: Dev and Ops Cooperation at Flickr
10+ Deploys Per Day: Dev and Ops Cooperation at Flickr10+ Deploys Per Day: Dev and Ops Cooperation at Flickr
10+ Deploys Per Day: Dev and Ops Cooperation at Flickr
 
Simplify CI with the Updated Jenkins Plugin for Sauce Labs
Simplify CI with the Updated Jenkins Plugin for Sauce LabsSimplify CI with the Updated Jenkins Plugin for Sauce Labs
Simplify CI with the Updated Jenkins Plugin for Sauce Labs
 
Selendroid in Action
Selendroid in ActionSelendroid in Action
Selendroid in Action
 
Espresso workshop
Espresso workshopEspresso workshop
Espresso workshop
 

Viewers also liked

Calabash, an open-source automated testing technology for native mobile, by K...
Calabash, an open-source automated testing technology for native mobile, by K...Calabash, an open-source automated testing technology for native mobile, by K...
Calabash, an open-source automated testing technology for native mobile, by K...Codemotion
 
Android testing calabash
Android testing calabashAndroid testing calabash
Android testing calabashkellinreaver
 
Behavior driven development with calabash for android
Behavior driven development with calabash for androidBehavior driven development with calabash for android
Behavior driven development with calabash for androidTeresa Holfeld
 
Android automation tools
Android automation toolsAndroid automation tools
Android automation toolsSSGMCE SHEGAON
 
Android UI Testing with uiautomator
Android UI Testing with uiautomatorAndroid UI Testing with uiautomator
Android UI Testing with uiautomatorJana Moudrá
 
Automated Testing with Ruby
Automated Testing with RubyAutomated Testing with Ruby
Automated Testing with RubyKeith Pitty
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with AppiumLuke Maung
 
Android Automation Testing with Selendroid
Android Automation Testing with SelendroidAndroid Automation Testing with Selendroid
Android Automation Testing with SelendroidVikas Thange
 
Introduction to Selenium and Ruby
Introduction to Selenium and RubyIntroduction to Selenium and Ruby
Introduction to Selenium and RubyYnon Perek
 
Appium: Automation for Mobile Apps
Appium: Automation for Mobile AppsAppium: Automation for Mobile Apps
Appium: Automation for Mobile AppsSauce Labs
 

Viewers also liked (15)

Calabash, an open-source automated testing technology for native mobile, by K...
Calabash, an open-source automated testing technology for native mobile, by K...Calabash, an open-source automated testing technology for native mobile, by K...
Calabash, an open-source automated testing technology for native mobile, by K...
 
Android testing calabash
Android testing calabashAndroid testing calabash
Android testing calabash
 
Behavior driven development with calabash for android
Behavior driven development with calabash for androidBehavior driven development with calabash for android
Behavior driven development with calabash for android
 
Android automation tools
Android automation toolsAndroid automation tools
Android automation tools
 
UIAutomator
UIAutomatorUIAutomator
UIAutomator
 
Android UI Testing with uiautomator
Android UI Testing with uiautomatorAndroid UI Testing with uiautomator
Android UI Testing with uiautomator
 
Automated Testing with Ruby
Automated Testing with RubyAutomated Testing with Ruby
Automated Testing with Ruby
 
Appium overview
Appium overviewAppium overview
Appium overview
 
Android & IOS Automation
Android & IOS AutomationAndroid & IOS Automation
Android & IOS Automation
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with Appium
 
Android Automation Testing with Selendroid
Android Automation Testing with SelendroidAndroid Automation Testing with Selendroid
Android Automation Testing with Selendroid
 
Introduction to Selenium and Ruby
Introduction to Selenium and RubyIntroduction to Selenium and Ruby
Introduction to Selenium and Ruby
 
Appium: Automation for Mobile Apps
Appium: Automation for Mobile AppsAppium: Automation for Mobile Apps
Appium: Automation for Mobile Apps
 
Robotium Tutorial
Robotium TutorialRobotium Tutorial
Robotium Tutorial
 
Android ppt
Android ppt Android ppt
Android ppt
 

Similar to iOS and Android Acceptance Testing with Calabash - Xcake Dublin

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
 
Intro to Continuous Integration at SoundCloud
Intro to Continuous Integration at SoundCloudIntro to Continuous Integration at SoundCloud
Intro to Continuous Integration at SoundCloudgarriguv
 
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There TodayHTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There Todaydavyjones
 
jQTouch – Mobile Web Apps with HTML, CSS and JavaScript
jQTouch – Mobile Web Apps with HTML, CSS and JavaScriptjQTouch – Mobile Web Apps with HTML, CSS and JavaScript
jQTouch – Mobile Web Apps with HTML, CSS and JavaScriptPhilipp Bosch
 
REST API Pentester's perspective
REST API Pentester's perspectiveREST API Pentester's perspective
REST API Pentester's perspectiveSecuRing
 
Android java fx-jme@jug-lugano
Android java fx-jme@jug-luganoAndroid java fx-jme@jug-lugano
Android java fx-jme@jug-luganoFabrizio Giudici
 
Philly CocoaHeads 20160414 - Building Your App SDK With Swift
Philly CocoaHeads 20160414 - Building Your App SDK With SwiftPhilly CocoaHeads 20160414 - Building Your App SDK With Swift
Philly CocoaHeads 20160414 - Building Your App SDK With SwiftJordan Yaker
 
ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud
ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloudITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud
ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloudIstanbul Tech Talks
 
we45 DEFCON Workshop - Building AppSec Automation with Python
we45 DEFCON Workshop - Building AppSec Automation with Pythonwe45 DEFCON Workshop - Building AppSec Automation with Python
we45 DEFCON Workshop - Building AppSec Automation with PythonAbhay Bhargav
 
Building Your App SDK with Swift
Building Your App SDK with SwiftBuilding Your App SDK with Swift
Building Your App SDK with SwiftJordan Yaker
 
Phonegap facebook- plugin
Phonegap facebook- pluginPhonegap facebook- plugin
Phonegap facebook- pluginSteve Gill
 
Giving back with GitHub - Putting the Open Source back in iOS
Giving back with GitHub - Putting the Open Source back in iOSGiving back with GitHub - Putting the Open Source back in iOS
Giving back with GitHub - Putting the Open Source back in iOSMadhava Jay
 
Iphone Presentation for MuMe09
Iphone Presentation for MuMe09Iphone Presentation for MuMe09
Iphone Presentation for MuMe09Gonzalo Parra
 
iOS UI Testing with Frank
iOS UI Testing with FrankiOS UI Testing with Frank
iOS UI Testing with FrankKeith Pitt
 
手機自動化測試和持續整合
手機自動化測試和持續整合手機自動化測試和持續整合
手機自動化測試和持續整合Carl Su
 
Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...
Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...
Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...Daniel Gallego Vico
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Michael Lihs
 
2017 Codemotion OWASP ZAP in CI/CD
2017 Codemotion OWASP ZAP in CI/CD2017 Codemotion OWASP ZAP in CI/CD
2017 Codemotion OWASP ZAP in CI/CDSimon Bennetts
 
Don't fear our new robot overlords – A new way to test on mobile
Don't fear our new robot overlords – A new way to test on mobileDon't fear our new robot overlords – A new way to test on mobile
Don't fear our new robot overlords – A new way to test on mobilePhilip Brechler
 

Similar to iOS and Android Acceptance Testing with Calabash - Xcake Dublin (20)

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...
 
Intro to Continuous Integration at SoundCloud
Intro to Continuous Integration at SoundCloudIntro to Continuous Integration at SoundCloud
Intro to Continuous Integration at SoundCloud
 
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There TodayHTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
 
jQTouch – Mobile Web Apps with HTML, CSS and JavaScript
jQTouch – Mobile Web Apps with HTML, CSS and JavaScriptjQTouch – Mobile Web Apps with HTML, CSS and JavaScript
jQTouch – Mobile Web Apps with HTML, CSS and JavaScript
 
REST API Pentester's perspective
REST API Pentester's perspectiveREST API Pentester's perspective
REST API Pentester's perspective
 
Android java fx-jme@jug-lugano
Android java fx-jme@jug-luganoAndroid java fx-jme@jug-lugano
Android java fx-jme@jug-lugano
 
Intro to appcelerator
Intro to appceleratorIntro to appcelerator
Intro to appcelerator
 
Philly CocoaHeads 20160414 - Building Your App SDK With Swift
Philly CocoaHeads 20160414 - Building Your App SDK With SwiftPhilly CocoaHeads 20160414 - Building Your App SDK With Swift
Philly CocoaHeads 20160414 - Building Your App SDK With Swift
 
ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud
ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloudITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud
ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud
 
we45 DEFCON Workshop - Building AppSec Automation with Python
we45 DEFCON Workshop - Building AppSec Automation with Pythonwe45 DEFCON Workshop - Building AppSec Automation with Python
we45 DEFCON Workshop - Building AppSec Automation with Python
 
Building Your App SDK with Swift
Building Your App SDK with SwiftBuilding Your App SDK with Swift
Building Your App SDK with Swift
 
Phonegap facebook- plugin
Phonegap facebook- pluginPhonegap facebook- plugin
Phonegap facebook- plugin
 
Giving back with GitHub - Putting the Open Source back in iOS
Giving back with GitHub - Putting the Open Source back in iOSGiving back with GitHub - Putting the Open Source back in iOS
Giving back with GitHub - Putting the Open Source back in iOS
 
Iphone Presentation for MuMe09
Iphone Presentation for MuMe09Iphone Presentation for MuMe09
Iphone Presentation for MuMe09
 
iOS UI Testing with Frank
iOS UI Testing with FrankiOS UI Testing with Frank
iOS UI Testing with Frank
 
手機自動化測試和持續整合
手機自動化測試和持續整合手機自動化測試和持續整合
手機自動化測試和持續整合
 
Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...
Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...
Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
2017 Codemotion OWASP ZAP in CI/CD
2017 Codemotion OWASP ZAP in CI/CD2017 Codemotion OWASP ZAP in CI/CD
2017 Codemotion OWASP ZAP in CI/CD
 
Don't fear our new robot overlords – A new way to test on mobile
Don't fear our new robot overlords – A new way to test on mobileDon't fear our new robot overlords – A new way to test on mobile
Don't fear our new robot overlords – A new way to test on mobile
 

Recently uploaded

Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Lecture # 8 software design and architecture (SDA).ppt
Lecture # 8 software design and architecture (SDA).pptLecture # 8 software design and architecture (SDA).ppt
Lecture # 8 software design and architecture (SDA).pptesrabilgic2
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 

Recently uploaded (20)

Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Lecture # 8 software design and architecture (SDA).ppt
Lecture # 8 software design and architecture (SDA).pptLecture # 8 software design and architecture (SDA).ppt
Lecture # 8 software design and architecture (SDA).ppt
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 

iOS and Android Acceptance Testing with Calabash - Xcake Dublin

  • 1. Acceptance Testing with Calabash @roland9 roland@intercom.io Xcake Dublin, 9th Dec 2014
  • 3. What is Calabash? • Automated acceptance testing of mobile apps
  • 4. What is Calabash? • Automated acceptance testing of mobile apps • Cross-platform (Android & iOS)
  • 5. What is Calabash? • Automated acceptance testing of mobile apps • Cross-platform (Android & iOS) • Open source - Company called Xamarin backing it
  • 6. What is Calabash? • Automated acceptance testing of mobile apps • Cross-platform (Android & iOS) • Open source - Company called Xamarin backing it • https://github.com/calabash/calabash-ios
  • 7. What is Calabash? • Automated acceptance testing of mobile apps • Cross-platform (Android & iOS) • Open source - Company called Xamarin backing it • https://github.com/calabash/calabash-ios • https://github.com/calabash/calabash-android
  • 8. Others • Frank, KIF, Zucchini, UIAutomation, iCuke, …
  • 9. Why would I do it?
  • 10. Why would I do it?
  • 11. Why would I do it?
  • 12. Other Testing Methods • Unit Tests • Integration Tests • Acceptance Tests
  • 13. Unit Tests • Tests smallest unit of functionality public void TestPhoneValidator() { string goodPhone = "(123) 555-1212"; string badPhone = "555 12" PhoneValidator validator = new PhoneValidator(); Assert.IsTrue(validator.IsValid(goodPhone)); Assert.IsFalse(validator.IsValid(badPhone)); } • Mocks and Stubs to simulate behaviour of other objects
  • 14. Integration Tests • Verify that combined modules function correctly
  • 15. Acceptance Tests • Performing tests on the full system (e.g. using your web page via a web browser) • Described in plain English
  • 16. How does it work? • http://blog.lesspainful.com/2012/03/07/Calabash-iOS/
  • 18. Install • ruby -v -> recommended version 2.0+
  • 19. Install • ruby -v -> recommended version 2.0+ • gem install calabash-cucumber
  • 20. Install • ruby -v -> recommended version 2.0+ • gem install calabash-cucumber • cd path-to-my-ios-project
  • 21. Install • ruby -v -> recommended version 2.0+ • gem install calabash-cucumber • cd path-to-my-ios-project • calabash-ios setup
  • 22. Install • ruby -v -> recommended version 2.0+ • gem install calabash-cucumber • cd path-to-my-ios-project • calabash-ios setup • calabash-ios gen
  • 23. Install • ruby -v -> recommended version 2.0+ • gem install calabash-cucumber • cd path-to-my-ios-project • calabash-ios setup • calabash-ios gen • in Xcode, build -cal scheme
  • 24. Install • ruby -v -> recommended version 2.0+ • gem install calabash-cucumber • cd path-to-my-ios-project • calabash-ios setup • calabash-ios gen • in Xcode, build -cal scheme • cucumber
  • 25. If all goes well: • LPSimpleExample[11298:13703] HTTPServer: Started HTTP server on port 37265
  • 26. Build Directory • export APP_BUNDLE_PATH=/Users/rolandgr/ <…>/Build/Products/Debug-iphonesimulator/ <…>-cal.app
  • 28. • Given … • When … • Then … • And …
  • 30. Useful Stuff • export DEVICE_TARGET="iPhone 5s (7.1 Simulator)"
  • 31. Useful Stuff • export DEVICE_TARGET="iPhone 5s (7.1 Simulator)" • cucumber NO_STOP=1
  • 32. Useful Stuff • export DEVICE_TARGET="iPhone 5s (7.1 Simulator)" • cucumber NO_STOP=1 • cucumber -t @current
  • 33. Useful Stuff • export DEVICE_TARGET="iPhone 5s (7.1 Simulator)" • cucumber NO_STOP=1 • cucumber -t @current • cucumber -t @~excludedtag
  • 34. Useful Stuff • export DEVICE_TARGET="iPhone 5s (7.1 Simulator)" • cucumber NO_STOP=1 • cucumber -t @current • cucumber -t @~excludedtag • calabash-ios console
  • 35. Useful Stuff • export DEVICE_TARGET="iPhone 5s (7.1 Simulator)" • cucumber NO_STOP=1 • cucumber -t @current • cucumber -t @~excludedtag • calabash-ios console • > start_test_server_in_background
  • 36. Query Syntax • query(“button") => [ {"class"=>"UIRoundedRectButton", "frame"=>{"y"=>287, "width"=>72, "x"=>100, "height"=>37}, "UIType"=>"UIControl", "description"=>"<UIRoundedRectButton: 0x7d463d0; frame = (100 287; 72 37); opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x7d46ae0>>"}, {"class"=>"UIRoundedRectButton", "frame"=>{"y"=>215, "width"=>73, "x"=>109, "height"=>37}, "UIType"=>"UIControl", "description"=>"<UIRoundedRectButton: 0x7d3a760; frame = (109 215; 73 37); opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x7d3a8a0>>”} ]
  • 37. • query("button index:0 label”) "find the first button, and then inside of that find all labels”. • query("button index:0 label", :text)
  • 40. Custom Steps - Ruby API
  • 41. Custom Steps - Ruby API • https://github.com/calabash/calabash-ios/wiki/03.5-Calabash-iOS- Ruby-API
  • 42. Custom Steps - Ruby API • https://github.com/calabash/calabash-ios/wiki/03.5-Calabash-iOS- Ruby-API • query, check for existence of elements, wait for elements to exist
  • 43. Custom Steps - Ruby API • https://github.com/calabash/calabash-ios/wiki/03.5-Calabash-iOS- Ruby-API • query, check for existence of elements, wait for elements to exist • keyboard
  • 44. Custom Steps - Ruby API • https://github.com/calabash/calabash-ios/wiki/03.5-Calabash-iOS- Ruby-API • query, check for existence of elements, wait for elements to exist • keyboard • scroll
  • 45. Custom Steps - Ruby API • https://github.com/calabash/calabash-ios/wiki/03.5-Calabash-iOS- Ruby-API • query, check for existence of elements, wait for elements to exist • keyboard • scroll • rotate
  • 46. Custom Steps - Ruby API • https://github.com/calabash/calabash-ios/wiki/03.5-Calabash-iOS- Ruby-API • query, check for existence of elements, wait for elements to exist • keyboard • scroll • rotate • backdoor -> call method in iOS app (implement in app delegate)
  • 47. Custom Steps - Ruby API • https://github.com/calabash/calabash-ios/wiki/03.5-Calabash-iOS- Ruby-API • query, check for existence of elements, wait for elements to exist • keyboard • scroll • rotate • backdoor -> call method in iOS app (implement in app delegate) • macro -> call other step definitions
  • 50. Tips and Tricks • Resetting app data between scenarios
  • 51. Tips and Tricks • Resetting app data between scenarios • Avoid sleep - use wait instead:
  • 52. Tips and Tricks • Resetting app data between scenarios • Avoid sleep - use wait instead: And I wait to see "send button"
  • 53. Tips and Tricks • Resetting app data between scenarios • Avoid sleep - use wait instead: And I wait to see "send button" • Wait before you interact with any element
  • 54. Tips and Tricks • Resetting app data between scenarios • Avoid sleep - use wait instead: And I wait to see "send button" • Wait before you interact with any element • Wait after every action to finish
  • 55. Tips and Tricks • Resetting app data between scenarios • Avoid sleep - use wait instead: And I wait to see "send button" • Wait before you interact with any element • Wait after every action to finish • Escape quotes…
  • 56. Tips and Tricks • Resetting app data between scenarios • Avoid sleep - use wait instead: And I wait to see "send button" • Wait before you interact with any element • Wait after every action to finish • Escape quotes… • https://groups.google.com/forum/#!forum/calabash-ios
  • 57. Optional: Compare Images • gem install imagemagick-binaries • check you have compare: $ which compare
  • 58. Optional: Compare Images • gem install imagemagick-binaries • check you have compare: $ which compare
  • 61. Other Info • UIKonf talk ‘Unit Testing on iOS’ by Tim Brückmann https://speakerdeck.com/tibr/unit-testing- on-ios • http://calaba.sh • https://github.com/calabash/calabash-ios • http://developer.xamarin.com/guides/testcloud/ calabash/introduction-to-calabash/
  • 62. Summary • Automated Testing - investment that pays off • Together with unit testing etc: make changes with confidence (still, manual QA required) • Cross-platform mature toolset • Continuous integration / code coverage
  • 63.
  • 64. Acceptance Testing with Calabash @roland9 roland@intercom.io Xcake Dublin, 9th Dec 2014