際際滷

際際滷Share a Scribd company logo
iOS Automated Testing with
  Calabash: Tips and Tricks
                 Moncef Belyamani
                   @monfresh




     Mobile Testing Summit / November 1, 2012 / San Francisco
iOS Automated Testing with Calabash: Tips and Tricks
iOS Automated Testing with Calabash: Tips and Tricks
iOS Automated Testing with Calabash: Tips and Tricks
iPhone Apps




iPad Apps
AUTOMATION TOOL
                 CHECKLIST
   Easy to set up and maintain

   Updated regularly

   Well-documented

   Supports iOS and Android

   Runs on devices untethered

   Readable tests
TOOLS EVALUATED
   Anteater

   Calabash

   FoneMonkey (before it became MonkeyTalk)

   Frank

   KIF

   TouchTest

   UI Automation

   Zucchini
AND THE WINNER IS...
iOS Automated Testing with Calabash: Tips and Tricks
RECOMMENDED SETUP

   Ruby 1.9.3

   RVM

   Gemset

   How to install Xcode, Homebrew, Git, RVM, & Ruby 1.9.3 on
    Snow Leopard, Lion, and Mountain Lion

   Enhance your Ruby development with RVM gemsets and .rvmrc
CALABASH TEST


FEATURE FILE + STEP DEFINITION
FEATURE EXAMPLE

Feature: Comments
  In order to contribute to the discussion
  As a Hacker News reader
  I want to be able to add a comment

Scenario: User not logged in
  Given I am not logged in
  When I go to comment on a submission
  Then I should be prompted to log in
DONT DO THIS

Scenario: User logged in, but cancels comment form
  Given the app is running
   When I touch "Profile"
   Then I wait to see "Login"
   Then I fill in Username with "my_username"
   Then I touch Password
   Then I fill in Password with "my_password"
   Then I touch done
   Then I wait to see "Logout"
   Then I touch "Home"
   Then I touch list item number 1
   Then I touch "reply"
   Then I touch "Cancel"
   Then I should see "Submission"
DO THIS

Scenario: User logged in, but cancels comment form
  Given I am logged in as username
  When I go to comment on a submission
  But I cancel the comment form
  Then I should see the submission
  And a comment from "username" should not appear
STEP DEFINITION

Given /^I am logged in as "([^"]*)"$/ do |username|
  macro 'I touch "Profile"'
  if element_exists("button marked:'Logout'")
    sleep(1)
  else
  macro %Q[I fill in Username with "#{username}"]
  macro 'I touch Password'
  macro 'I fill in Password with "my_password"'
  macro 'I touch done'
  macro 'I wait to see "Logout"'
  end
end
UPDATING IS EASY, BUT...

   gem update calabash-cucumber

   calabash-ios download   (not with SVN)

   curl http://localhost:37265/version      (to verify framework is
    up to date)

   May need to Reset Content and Settings in Simulator

   When new 鍖les are added, update Target Membership
iOS Automated Testing with Calabash: Tips and Tricks
KEEP IN MIND


Swiping depends on device orientation

Can only touch visible items
TIPS & TRICKS
Use .bash_pro鍖le aliases

self.myButton.accessibilityElementsHidden = YES;

Use console to experiment and query to 鍖nd elements

Participate in the Google Group

Get commit noti鍖cations with GitHub for Mac
RECOMMENDATIONS
   Full-time Automation Engineer

   Work with Dev to make apps accessible

   Continuous Integration

   Contribute 鍖xes and custom steps
REFERENCES
   iOS Automated Testing with Calabash, Cucumber, and Ruby

   Create aliases in .bash_pro鍖le to assign shortcuts for common
    Terminal commands

   A Calabash custom step to Swipe to delete all cells in a Table View

   Code for America

   AOL Mobile
Moncef Belyamani
    @monfresh
moncef@monfresh.com
moncefbelyamani.com
  about.me/moncef
QUESTIONS?
THANK YOU!

More Related Content

What's hot (19)

Eye candy for your iPhone
Eye candy for your iPhoneEye candy for your iPhone
Eye candy for your iPhone
Brian Shim
Open Source Automation Tools That Really Work V2
Open Source Automation Tools That Really Work V2Open Source Automation Tools That Really Work V2
Open Source Automation Tools That Really Work V2
An Doan
Dnn connect dnnmobi-slides
Dnn connect dnnmobi-slidesDnn connect dnnmobi-slides
Dnn connect dnnmobi-slides
ashishpd
Building Browser Extensions with Ember
Building Browser Extensions with EmberBuilding Browser Extensions with Ember
Building Browser Extensions with Ember
Alex Blom
I, For One, Welcome Our New Robot Overlords
I, For One, Welcome Our New Robot OverlordsI, For One, Welcome Our New Robot Overlords
I, For One, Welcome Our New Robot Overlords
Steve Malsam
The Platform Era, Software and APIs in the organization change
The Platform Era, Software and APIs in the organization changeThe Platform Era, Software and APIs in the organization change
The Platform Era, Software and APIs in the organization change
bootis
How I got my First CVE
How I got my First CVE How I got my First CVE
How I got my First CVE
nullowaspmumbai
React For Vikings
React For VikingsReact For Vikings
React For Vikings
FITC
monkeyTalk
monkeyTalkmonkeyTalk
monkeyTalk
Md Samsul Kabir
Mobile Cross Platform Automation in-practice and on a Large Scale
Mobile Cross Platform Automation in-practice and on a Large ScaleMobile Cross Platform Automation in-practice and on a Large Scale
Mobile Cross Platform Automation in-practice and on a Large Scale
Sathish Gogineni
Mistakes I Made Building Netflix for the iPhone
Mistakes I Made Building Netflix for the iPhoneMistakes I Made Building Netflix for the iPhone
Mistakes I Made Building Netflix for the iPhone
kentbrew
Immutability: from code to infrastructure, the way to scalability - Breizhca...
 Immutability: from code to infrastructure, the way to scalability - Breizhca... Immutability: from code to infrastructure, the way to scalability - Breizhca...
Immutability: from code to infrastructure, the way to scalability - Breizhca...
Quentin Adam
Prototyping web apps with Wordpress
Prototyping web apps with WordpressPrototyping web apps with Wordpress
Prototyping web apps with Wordpress
Zeeen
DNN Web API For Mobile
DNN Web API For MobileDNN Web API For Mobile
DNN Web API For Mobile
ashishpd
Building Hybrid Apps with Ember
Building Hybrid Apps with EmberBuilding Hybrid Apps with Ember
Building Hybrid Apps with Ember
jakecraige
Selenium training in chennai
Selenium training in chennaiSelenium training in chennai
Selenium training in chennai
Thecreating Experts
Coffee script
Coffee scriptCoffee script
Coffee script
Night Wolf
WordCamp SF 2011: Debugging in WordPress
WordCamp SF 2011: Debugging in WordPressWordCamp SF 2011: Debugging in WordPress
WordCamp SF 2011: Debugging in WordPress
andrewnacin
Enterprising JavaFX
Enterprising JavaFXEnterprising JavaFX
Enterprising JavaFX
Richard Bair
Eye candy for your iPhone
Eye candy for your iPhoneEye candy for your iPhone
Eye candy for your iPhone
Brian Shim
Open Source Automation Tools That Really Work V2
Open Source Automation Tools That Really Work V2Open Source Automation Tools That Really Work V2
Open Source Automation Tools That Really Work V2
An Doan
Dnn connect dnnmobi-slides
Dnn connect dnnmobi-slidesDnn connect dnnmobi-slides
Dnn connect dnnmobi-slides
ashishpd
Building Browser Extensions with Ember
Building Browser Extensions with EmberBuilding Browser Extensions with Ember
Building Browser Extensions with Ember
Alex Blom
I, For One, Welcome Our New Robot Overlords
I, For One, Welcome Our New Robot OverlordsI, For One, Welcome Our New Robot Overlords
I, For One, Welcome Our New Robot Overlords
Steve Malsam
The Platform Era, Software and APIs in the organization change
The Platform Era, Software and APIs in the organization changeThe Platform Era, Software and APIs in the organization change
The Platform Era, Software and APIs in the organization change
bootis
How I got my First CVE
How I got my First CVE How I got my First CVE
How I got my First CVE
nullowaspmumbai
React For Vikings
React For VikingsReact For Vikings
React For Vikings
FITC
Mobile Cross Platform Automation in-practice and on a Large Scale
Mobile Cross Platform Automation in-practice and on a Large ScaleMobile Cross Platform Automation in-practice and on a Large Scale
Mobile Cross Platform Automation in-practice and on a Large Scale
Sathish Gogineni
Mistakes I Made Building Netflix for the iPhone
Mistakes I Made Building Netflix for the iPhoneMistakes I Made Building Netflix for the iPhone
Mistakes I Made Building Netflix for the iPhone
kentbrew
Immutability: from code to infrastructure, the way to scalability - Breizhca...
 Immutability: from code to infrastructure, the way to scalability - Breizhca... Immutability: from code to infrastructure, the way to scalability - Breizhca...
Immutability: from code to infrastructure, the way to scalability - Breizhca...
Quentin Adam
Prototyping web apps with Wordpress
Prototyping web apps with WordpressPrototyping web apps with Wordpress
Prototyping web apps with Wordpress
Zeeen
DNN Web API For Mobile
DNN Web API For MobileDNN Web API For Mobile
DNN Web API For Mobile
ashishpd
Building Hybrid Apps with Ember
Building Hybrid Apps with EmberBuilding Hybrid Apps with Ember
Building Hybrid Apps with Ember
jakecraige
Coffee script
Coffee scriptCoffee script
Coffee script
Night Wolf
WordCamp SF 2011: Debugging in WordPress
WordCamp SF 2011: Debugging in WordPressWordCamp SF 2011: Debugging in WordPress
WordCamp SF 2011: Debugging in WordPress
andrewnacin
Enterprising JavaFX
Enterprising JavaFXEnterprising JavaFX
Enterprising JavaFX
Richard Bair

Viewers also liked (20)

Monkey talk
Monkey talkMonkey talk
Monkey talk
ISsoft
Automating Firefox OS
Automating Firefox OSAutomating Firefox OS
Automating Firefox OS
mobiletestsummit
82746248 study-of-nec-transmitter
82746248 study-of-nec-transmitter82746248 study-of-nec-transmitter
82746248 study-of-nec-transmitter
homeworkping3
MY FRIEND CALSS 3
MY FRIEND CALSS 3MY FRIEND CALSS 3
MY FRIEND CALSS 3
Sanjoy Mudi
Orlando Flores Jr. Resume
Orlando Flores Jr. ResumeOrlando Flores Jr. Resume
Orlando Flores Jr. Resume
Orlando Flores Jr
Social media for b2b - Madhouse Associates seminar
Social media for b2b - Madhouse Associates seminarSocial media for b2b - Madhouse Associates seminar
Social media for b2b - Madhouse Associates seminar
Smoking Gun PR
舒亰亠舒 束丱亳亳舒仆从舒 弍舒亰亳晛, 于亞 2014 亞. 8 (89)
舒亰亠舒 束丱亳亳舒仆从舒 弍舒亰亳晛, 于亞 2014 亞.  8 (89)舒亰亠舒 束丱亳亳舒仆从舒 弍舒亰亳晛, 于亞 2014 亞.  8 (89)
舒亰亠舒 束丱亳亳舒仆从舒 弍舒亰亳晛, 于亞 2014 亞. 8 (89)
anyhaorg
Inzoomen op de kaart
Inzoomen op de kaartInzoomen op de kaart
Inzoomen op de kaart
Jan Willem van Eck
Social Media for B2B - Marta Majewska - Spring Creek
Social Media for B2B - Marta Majewska - Spring CreekSocial Media for B2B - Marta Majewska - Spring Creek
Social Media for B2B - Marta Majewska - Spring Creek
McCann Brussels
Sema local SEO 2010
Sema local SEO 2010Sema local SEO 2010
Sema local SEO 2010
Wil Reynolds
悋惘悋悋 悋愕惺惆
悋惘悋悋 悋愕惺惆悋惘悋悋 悋愕惺惆
悋惘悋悋 悋愕惺惆
Mohamed Zakaria
Sikuli for Mobile Testing
Sikuli for Mobile TestingSikuli for Mobile Testing
Sikuli for Mobile Testing
mobiletestsummit
Hands on iOS developments with jenkins
Hands on iOS developments with jenkinsHands on iOS developments with jenkins
Hands on iOS developments with jenkins
Arnaud H辿ritier
Gale smm strategy and plan 20110222
Gale  smm strategy and plan 20110222Gale  smm strategy and plan 20110222
Gale smm strategy and plan 20110222
Soumya Ravi
Sejarah Berdirinya Borobudur
Sejarah Berdirinya BorobudurSejarah Berdirinya Borobudur
Sejarah Berdirinya Borobudur
Firdika Arini
Class expectations for online communication
Class expectations for online communicationClass expectations for online communication
Class expectations for online communication
erinmarkus
Automated Testing and Continuous Deployment for Mobile Apps with Jenkins
Automated Testing and Continuous Deployment for Mobile Apps with Jenkins Automated Testing and Continuous Deployment for Mobile Apps with Jenkins
Automated Testing and Continuous Deployment for Mobile Apps with Jenkins
CloudBees
Get More Work: How to Build a Partnership With an Agency
Get More Work: How to Build a Partnership With an AgencyGet More Work: How to Build a Partnership With an Agency
Get More Work: How to Build a Partnership With an Agency
brandextract
Mobile testing and its part in testing tools
Mobile testing and its part in testing toolsMobile testing and its part in testing tools
Mobile testing and its part in testing tools
Kari Kakkonen
How to configure monkey talk android agent
How to configure monkey talk android agentHow to configure monkey talk android agent
How to configure monkey talk android agent
Dasun Eranthika
Monkey talk
Monkey talkMonkey talk
Monkey talk
ISsoft
82746248 study-of-nec-transmitter
82746248 study-of-nec-transmitter82746248 study-of-nec-transmitter
82746248 study-of-nec-transmitter
homeworkping3
MY FRIEND CALSS 3
MY FRIEND CALSS 3MY FRIEND CALSS 3
MY FRIEND CALSS 3
Sanjoy Mudi
Orlando Flores Jr. Resume
Orlando Flores Jr. ResumeOrlando Flores Jr. Resume
Orlando Flores Jr. Resume
Orlando Flores Jr
Social media for b2b - Madhouse Associates seminar
Social media for b2b - Madhouse Associates seminarSocial media for b2b - Madhouse Associates seminar
Social media for b2b - Madhouse Associates seminar
Smoking Gun PR
舒亰亠舒 束丱亳亳舒仆从舒 弍舒亰亳晛, 于亞 2014 亞. 8 (89)
舒亰亠舒 束丱亳亳舒仆从舒 弍舒亰亳晛, 于亞 2014 亞.  8 (89)舒亰亠舒 束丱亳亳舒仆从舒 弍舒亰亳晛, 于亞 2014 亞.  8 (89)
舒亰亠舒 束丱亳亳舒仆从舒 弍舒亰亳晛, 于亞 2014 亞. 8 (89)
anyhaorg
Social Media for B2B - Marta Majewska - Spring Creek
Social Media for B2B - Marta Majewska - Spring CreekSocial Media for B2B - Marta Majewska - Spring Creek
Social Media for B2B - Marta Majewska - Spring Creek
McCann Brussels
Sema local SEO 2010
Sema local SEO 2010Sema local SEO 2010
Sema local SEO 2010
Wil Reynolds
悋惘悋悋 悋愕惺惆
悋惘悋悋 悋愕惺惆悋惘悋悋 悋愕惺惆
悋惘悋悋 悋愕惺惆
Mohamed Zakaria
Sikuli for Mobile Testing
Sikuli for Mobile TestingSikuli for Mobile Testing
Sikuli for Mobile Testing
mobiletestsummit
Hands on iOS developments with jenkins
Hands on iOS developments with jenkinsHands on iOS developments with jenkins
Hands on iOS developments with jenkins
Arnaud H辿ritier
Gale smm strategy and plan 20110222
Gale  smm strategy and plan 20110222Gale  smm strategy and plan 20110222
Gale smm strategy and plan 20110222
Soumya Ravi
Sejarah Berdirinya Borobudur
Sejarah Berdirinya BorobudurSejarah Berdirinya Borobudur
Sejarah Berdirinya Borobudur
Firdika Arini
Class expectations for online communication
Class expectations for online communicationClass expectations for online communication
Class expectations for online communication
erinmarkus
Automated Testing and Continuous Deployment for Mobile Apps with Jenkins
Automated Testing and Continuous Deployment for Mobile Apps with Jenkins Automated Testing and Continuous Deployment for Mobile Apps with Jenkins
Automated Testing and Continuous Deployment for Mobile Apps with Jenkins
CloudBees
Get More Work: How to Build a Partnership With an Agency
Get More Work: How to Build a Partnership With an AgencyGet More Work: How to Build a Partnership With an Agency
Get More Work: How to Build a Partnership With an Agency
brandextract
Mobile testing and its part in testing tools
Mobile testing and its part in testing toolsMobile testing and its part in testing tools
Mobile testing and its part in testing tools
Kari Kakkonen
How to configure monkey talk android agent
How to configure monkey talk android agentHow to configure monkey talk android agent
How to configure monkey talk android agent
Dasun Eranthika

Similar to iOS Automated Testing with Calabash: Tips and Tricks (20)

[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
Srijan Technologies
iOS and Android Acceptance Testing with Calabash - Xcake Dublin
iOS and Android Acceptance Testing with Calabash - Xcake DubliniOS and Android Acceptance Testing with Calabash - Xcake Dublin
iOS and Android Acceptance Testing with Calabash - Xcake Dublin
roland99
Espresso workshop
Espresso workshopEspresso workshop
Espresso workshop
Ketan Soni
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Jean-Loup Yu
iOS Automation Frameworks evaluation
iOS Automation Frameworks evaluationiOS Automation Frameworks evaluation
iOS Automation Frameworks evaluation
Serghei Moret
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
Beginning jQuery Mobile
Beginning jQuery MobileBeginning jQuery Mobile
Beginning jQuery Mobile
Troy Miles
Selenium Training in Chennai
Selenium Training in ChennaiSelenium Training in Chennai
Selenium Training in Chennai
Thecreating Experts
Graceful Failure with Selenium and Continuous Integration
Graceful Failure with Selenium and Continuous IntegrationGraceful Failure with Selenium and Continuous Integration
Graceful Failure with Selenium and Continuous Integration
Chris B. France
Effectively Using UI Automation
Effectively Using UI AutomationEffectively Using UI Automation
Effectively Using UI Automation
Alexander Repty
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
E2E testing Single Page Apps and APIs with Cucumber.js and PuppeteerE2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
Paul Jensen
Android testing calabash
Android testing calabashAndroid testing calabash
Android testing calabash
kellinreaver
Functional Testing
Functional TestingFunctional Testing
Functional Testing
Adam Hill
The Many Ways to Test Your React App
The Many Ways to Test Your React AppThe Many Ways to Test Your React App
The Many Ways to Test Your React App
All Things Open
Automating android
Automating androidAutomating android
Automating android
Melvin Laguren
Bug Hunting Safari
Bug Hunting SafariBug Hunting Safari
Bug Hunting Safari
Janie Clayton
Hack in the Box GSEC 2016 - Reverse Engineering Swift Applications
Hack in the Box GSEC 2016 - Reverse Engineering Swift ApplicationsHack in the Box GSEC 2016 - Reverse Engineering Swift Applications
Hack in the Box GSEC 2016 - Reverse Engineering Swift Applications
eightbit
Testing Native iOS Apps with Appium
Testing Native iOS Apps with AppiumTesting Native iOS Apps with Appium
Testing Native iOS Apps with Appium
Sauce Labs
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
Paul Jensen
How To Run/Test Flutter App On a Real Device?
How To Run/Test Flutter App On a Real Device?How To Run/Test Flutter App On a Real Device?
How To Run/Test Flutter App On a Real Device?
RubenGray1
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
Srijan Technologies
iOS and Android Acceptance Testing with Calabash - Xcake Dublin
iOS and Android Acceptance Testing with Calabash - Xcake DubliniOS and Android Acceptance Testing with Calabash - Xcake Dublin
iOS and Android Acceptance Testing with Calabash - Xcake Dublin
roland99
Espresso workshop
Espresso workshopEspresso workshop
Espresso workshop
Ketan Soni
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Jean-Loup Yu
iOS Automation Frameworks evaluation
iOS Automation Frameworks evaluationiOS Automation Frameworks evaluation
iOS Automation Frameworks evaluation
Serghei Moret
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
Beginning jQuery Mobile
Beginning jQuery MobileBeginning jQuery Mobile
Beginning jQuery Mobile
Troy Miles
Graceful Failure with Selenium and Continuous Integration
Graceful Failure with Selenium and Continuous IntegrationGraceful Failure with Selenium and Continuous Integration
Graceful Failure with Selenium and Continuous Integration
Chris B. France
Effectively Using UI Automation
Effectively Using UI AutomationEffectively Using UI Automation
Effectively Using UI Automation
Alexander Repty
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
E2E testing Single Page Apps and APIs with Cucumber.js and PuppeteerE2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
Paul Jensen
Android testing calabash
Android testing calabashAndroid testing calabash
Android testing calabash
kellinreaver
Functional Testing
Functional TestingFunctional Testing
Functional Testing
Adam Hill
The Many Ways to Test Your React App
The Many Ways to Test Your React AppThe Many Ways to Test Your React App
The Many Ways to Test Your React App
All Things Open
Bug Hunting Safari
Bug Hunting SafariBug Hunting Safari
Bug Hunting Safari
Janie Clayton
Hack in the Box GSEC 2016 - Reverse Engineering Swift Applications
Hack in the Box GSEC 2016 - Reverse Engineering Swift ApplicationsHack in the Box GSEC 2016 - Reverse Engineering Swift Applications
Hack in the Box GSEC 2016 - Reverse Engineering Swift Applications
eightbit
Testing Native iOS Apps with Appium
Testing Native iOS Apps with AppiumTesting Native iOS Apps with Appium
Testing Native iOS Apps with Appium
Sauce Labs
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
Paul Jensen
How To Run/Test Flutter App On a Real Device?
How To Run/Test Flutter App On a Real Device?How To Run/Test Flutter App On a Real Device?
How To Run/Test Flutter App On a Real Device?
RubenGray1

iOS Automated Testing with Calabash: Tips and Tricks

  • 1. iOS Automated Testing with Calabash: Tips and Tricks Moncef Belyamani @monfresh Mobile Testing Summit / November 1, 2012 / San Francisco
  • 6. AUTOMATION TOOL CHECKLIST Easy to set up and maintain Updated regularly Well-documented Supports iOS and Android Runs on devices untethered Readable tests
  • 7. TOOLS EVALUATED Anteater Calabash FoneMonkey (before it became MonkeyTalk) Frank KIF TouchTest UI Automation Zucchini
  • 10. RECOMMENDED SETUP Ruby 1.9.3 RVM Gemset How to install Xcode, Homebrew, Git, RVM, & Ruby 1.9.3 on Snow Leopard, Lion, and Mountain Lion Enhance your Ruby development with RVM gemsets and .rvmrc
  • 11. CALABASH TEST FEATURE FILE + STEP DEFINITION
  • 12. FEATURE EXAMPLE Feature: Comments In order to contribute to the discussion As a Hacker News reader I want to be able to add a comment Scenario: User not logged in Given I am not logged in When I go to comment on a submission Then I should be prompted to log in
  • 13. DONT DO THIS Scenario: User logged in, but cancels comment form Given the app is running When I touch "Profile" Then I wait to see "Login" Then I fill in Username with "my_username" Then I touch Password Then I fill in Password with "my_password" Then I touch done Then I wait to see "Logout" Then I touch "Home" Then I touch list item number 1 Then I touch "reply" Then I touch "Cancel" Then I should see "Submission"
  • 14. DO THIS Scenario: User logged in, but cancels comment form Given I am logged in as username When I go to comment on a submission But I cancel the comment form Then I should see the submission And a comment from "username" should not appear
  • 15. STEP DEFINITION Given /^I am logged in as "([^"]*)"$/ do |username| macro 'I touch "Profile"' if element_exists("button marked:'Logout'") sleep(1) else macro %Q[I fill in Username with "#{username}"] macro 'I touch Password' macro 'I fill in Password with "my_password"' macro 'I touch done' macro 'I wait to see "Logout"' end end
  • 16. UPDATING IS EASY, BUT... gem update calabash-cucumber calabash-ios download (not with SVN) curl http://localhost:37265/version (to verify framework is up to date) May need to Reset Content and Settings in Simulator When new 鍖les are added, update Target Membership
  • 18. KEEP IN MIND Swiping depends on device orientation Can only touch visible items
  • 19. TIPS & TRICKS Use .bash_pro鍖le aliases self.myButton.accessibilityElementsHidden = YES; Use console to experiment and query to 鍖nd elements Participate in the Google Group Get commit noti鍖cations with GitHub for Mac
  • 20. RECOMMENDATIONS Full-time Automation Engineer Work with Dev to make apps accessible Continuous Integration Contribute 鍖xes and custom steps
  • 21. REFERENCES iOS Automated Testing with Calabash, Cucumber, and Ruby Create aliases in .bash_pro鍖le to assign shortcuts for common Terminal commands A Calabash custom step to Swipe to delete all cells in a Table View Code for America AOL Mobile
  • 22. Moncef Belyamani @monfresh moncef@monfresh.com moncefbelyamani.com about.me/moncef