SlideShare uma empresa Scribd logo
1 de 64
Baixar para ler 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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Destaque

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
 

Destaque (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
 

Semelhante a 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
 

Semelhante a 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
 

Último

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 

Último (20)

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 

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