SlideShare a Scribd company logo
1 of 41
Download to read offline
Introducing Calabash


                          automated functional testing for mobile native apps


                                             Karl Krukow,
                                         karl@lesspainful.com,
                                              LessPainful
                                        CodeMotion 2012, Rome
                                                   1
fredag den 23. marts 12
About me




                             2
fredag den 23. marts 12
About me

                     •    PhD, Computer Science, University of Aarhus, 2006.




                                                 2
fredag den 23. marts 12
About me

                     •    PhD, Computer Science, University of Aarhus, 2006.

                     •    Developer at Trifork for about 6 years mostly Java
                          enterprise, last two years on iOS.




                                                 2
fredag den 23. marts 12
About me

                     •    PhD, Computer Science, University of Aarhus, 2006.

                     •    Developer at Trifork for about 6 years mostly Java
                          enterprise, last two years on iOS.

                     •    Co-owner, iOS responsible at




                                                 2
fredag den 23. marts 12
About me

                     •    PhD, Computer Science, University of Aarhus, 2006.

                     •    Developer at Trifork for about 6 years mostly Java
                          enterprise, last two years on iOS.

                     •    Co-owner, iOS responsible at

                     •    Spare-time Hickey & Clojure fan-boy!




                                                 2
fredag den 23. marts 12
Agenda




                            3
fredag den 23. marts 12
Agenda
                     •    Automated functional testing for native mobile
                          •   Some desirable properties for a functional testing tool




                                                          3
fredag den 23. marts 12
Agenda
                     •    Automated functional testing for native mobile
                          •   Some desirable properties for a functional testing tool

                     •    Introduce Calabash
                          •   Focus on iOS only




                                                          3
fredag den 23. marts 12
Agenda
                     •    Automated functional testing for native mobile
                          •   Some desirable properties for a functional testing tool

                     •    Introduce Calabash
                          •   Focus on iOS only

                     •    Live Demo:
                          •   Calabash iOS

                          •   LessPainful: test service and device cloud


                                                          3
fredag den 23. marts 12
Functional testing




                                  4
fredag den 23. marts 12
Functional testing
                          •   Functional and Acceptance tests
                              •   Actual app, as opposed to an isolated component

                              •   Often based on use-cases written in natural language (for domain)

                              •   Visual appearance of screens matter! (Design guidelines, branding,..)

                              •   As realistic an environment as practically possible




                                                              4
fredag den 23. marts 12
Functional testing
                          •   Functional and Acceptance tests
                              •   Actual app, as opposed to an isolated component

                              •   Often based on use-cases written in natural language (for domain)

                              •   Visual appearance of screens matter! (Design guidelines, branding,..)

                              •   As realistic an environment as practically possible

                          •   For mobile apps, in particular
                              •   Many devices, screens, OS versions, languages

                              •   often a manual process: repetitive, expensive
                                  •   regressions: why should I test that again?


                                                              4
fredag den 23. marts 12
Functional testing
                             desiderata




                                  5
fredag den 23. marts 12
Functional testing
                                desiderata
                     •    Minimize distance between use cases and actual test
                          code (DSLs?).
                     •    Expressive and efficient to write.
                     •    Extensible
                     •    High-level, declarative (robustness against “minor” UI
                          changes).
                     •    Support testing in realistic environments (multiple real
                          devices, on multiple OS versions, languages).
                     •    Support Continuous integration.

                                                   5
fredag den 23. marts 12
Cucumber and
                            Calabash



fredag den 23. marts 12
•    Cucumber provides
                          •   a framework for writing software specifications

                          •   a tool for executing those specifications

                     •    Specifications are written in a business readable
                          language that is close to natural language.

                     •    Extremely popular tool for test and specs of
                          web applications.

                     •    http://cukes.info/


fredag den 23. marts 12
Cucumber Example

           Feature:       As an administrator. I want to be able to add and remove users,
                          so I can control access to the application

           Scenario: Add test user
               When I touch the Add User button
               And I fill in text fields as follows:
                 | field      | text   |
                 | Last Name | Knorr |
                 | Username   | knorr |
               And I touch "Save"
               Then I should be on the Users screen
               And I should see a table containing "Knorr"

           Scenario: ...




fredag den 23. marts 12
Cucumber Example

           Feature:       As an administrator. I want to be able to add and remove users,
                          so I can control access to the application

           Scenario: Add test user
               When I touch the Add User button
               And I fill in text fields as follows:
                 | field      | text   |
                 | Last Name | Knorr |
                 | Username   | knorr |
               And I touch "Save"
               Then I should be on the Users screen
               And I should see a table containing "Knorr"

           Scenario: ...




fredag den 23. marts 12
Cucumber Example

           Feature:       As an administrator. I want to be able to add and remove users,
                          so I can control access to the application

           Scenario: Add test user
               When I touch the Add User button
               And I fill in text fields as follows:
                 | field      | text   |
                 | Last Name | Knorr |
                 | Username   | knorr |
               And I touch "Save"
               Then I should be on the Users screen
               And I should see a table containing "Knorr"

           Scenario: ...




fredag den 23. marts 12
Cucumber Example

           Feature:       As an administrator. I want to be able to add and remove users,
                          so I can control access to the application

           Scenario: Add test user
               When I touch the Add User button
               And I fill in text fields as follows:
                 | field      | text   |
                 | Last Name | Knorr |
                 | Username   | knorr |
               And I touch "Save"
               Then I should be on the Users screen
               And I should see a table containing "Knorr"

           Scenario: ...




fredag den 23. marts 12
Cucumber Example

           Feature:       As an administrator. I want to be able to add and remove users,
                          so I can control access to the application

           Scenario: Add test user
               When I touch the Add User button
               And I fill in text fields as follows:
                 | field      | text   |
                 | Last Name | Knorr |
                 | Username   | knorr |
               And I touch "Save"
               Then I should be on the Users screen
               And I should see a table containing "Knorr"

           Scenario: ...




fredag den 23. marts 12
Cucumber Example

           Feature:       As an administrator. I want to be able to add and remove users,
                          so I can control access to the application

           Scenario: Add test user
               When I touch the Add User button
               And I fill in text fields as follows:
                 | field      | text   |
                 | Last Name | Knorr |
                 | Username   | knorr |
               And I touch "Save"
               Then I should be on the Users screen
               And I should see a table containing "Knorr"

           Scenario: ...




fredag den 23. marts 12
Step Definitions
                   • Make the cucumber tests “come alive”
                   • Written in ordinary programming languages
                          •   Mostly Ruby (but cucumber-jvm: Java, Clojure,...)




                              Feature                        Step definitions




fredag den 23. marts 12
Step Definitions
                   • Make the cucumber tests “come alive”
                   • Written in ordinary programming languages
                          •   Mostly Ruby (but cucumber-jvm: Java, Clojure,...)




                              Feature                        Step definitions
            Scenario: Add test user
                When I touch the Add User button
            ...




fredag den 23. marts 12
Step Definitions
                   • Make the cucumber tests “come alive”
                   • Written in ordinary programming languages
                          •   Mostly Ruby (but cucumber-jvm: Java, Clojure,...)




                              Feature                        Step definitions
            Scenario: Add test user                        When /^I touch the Add User button$/ do
                When I touch the Add User button             btn_txt = 'Add user'
            ...                                              touch("button text:#{btn_txt}")
                                                           end




fredag den 23. marts 12
Calabash
                     •    One interface: Cucumber, for Android and iOS tests.
                          •   Predefined and custom steps (Ruby + soon: JVM).

                          •   Reuse of tests across platform possible.

                     •    Run on physical devices and simulators.
                     •    Support for hybrid apps (embedded webviews)
                     •    Free, open source with commercial add-ons:
                          •   Run tests in a device cloud using the LessPainful service,

                          •   we can write and run your tests,

                          •   setting up continuous integration, consulting, training, support.


                                                         10
fredag den 23. marts 12
Architecture iOS

                                          iOS App
                                     --------------------
                                     Calabash library




fredag den 23. marts 12
Architecture iOS
  features

                                             iOS App
                                        --------------------
                           Cucumber     Calabash library
                           (ruby api)



                 Test report
                 (cucumber)
fredag den 23. marts 12
LessPainful
                 Test Execution in the Cloud
                              •   Execute Calabash tests
                                  concurrently on many
                                  devices, OS’es, languages.

                              •   Authentic: Not jailbroken, iOS
                                  and Android devices, rotation.

                              •   Visual test reports.

                                  •   Comparison across models
                                      and operating systems.

                              •   Continuous integration.


fredag den 23. marts 12
fredag den 23. marts 12
fredag den 23. marts 12
fredag den 23. marts 12
Calabash iOS:
                           more detail


                                15
fredag den 23. marts 12
Calabash: more detail
                     •    Very easy to get started for iOS developers/QAs.
                     •    Declarative query language for finding views.
                          •   Based on UISpec, but simplified and extended. (New
                              Implementation, EPL licensed).

                     •    Touch synthesis, supports (multitouch) gestures.
                          Extensible. (pan, swipe, pinch, your own)
                     •    Full power of Ruby programming language for test
                          logic
                          •   Interactive, exploratory development experience.

                     •    Can use device accessibility for identifying views.
                                                    16
fredag den 23. marts 12
Queries




                             17
fredag den 23. marts 12
Queries
                     • Queries are like CSS selectors or XPath
                          •   label text:‘Hello‘

                          •   label index:2

                          •   view marked:‘thepane’ label

                          •   view:‘MyClassName’

                          •   label {text LIKE ‘Hel*’}

                          •   webView css:‘#header a.cssclass‘

                          •   webView xpath:’//node()’



                                              17
fredag den 23. marts 12
Demo:
                                - Calabash iOS
                          - LessPainful Device Cloud



                                      18
fredag den 23. marts 12
iOS Comparisons
                     •    Several options available. To my knowledge:
                          •   Calabash

                          •   UIAutomation, Apple

                          •   Zucchini, iOS Testing Framework

                          •   Frank, Pete Hodgson, ThoughtWorks

                          •   UISpec, http://code.google.com/p/uispec/

                          •   FoneMonkey => MonkeyTalk, GorillaLogic

                          •   KIF, Square

                          •   NativeDriver, http://code.google.com/p/nativedriver/



                                                        19
fredag den 23. marts 12
References
                     • https://github.com/calabash
                          •   https://github.com/calabash/calabash-ios

                          •   https://github.com/calabash/calabash-ios/wiki

                          •   https://github.com/calabash/calabash-ios-server

                          •   https://github.com/calabash/calabash-android

                     • http://blog.lesspainful.com/
                     • https://www.lesspainful.com/
                                                  20
fredag den 23. marts 12
Questions?



                             Making app testing less painful...
                          Please contact us with any questions:
                                contact@lesspainful.com
                               karl@lesspainful.com - iOS
                            jonas@lesspainful.com - Android
                                              http://www.lesspainful.com
fredag den 23. marts 12

More Related Content

Viewers also liked

Viewers also liked (14)

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
 
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
 
SAP MM Standard Business Processes
SAP MM Standard Business ProcessesSAP MM Standard Business Processes
SAP MM Standard Business Processes
 
Robotium Tutorial
Robotium TutorialRobotium Tutorial
Robotium Tutorial
 
Android ppt
Android ppt Android ppt
Android ppt
 

Similar to Calabash, an open-source automated testing technology for native mobile, by Karl Krukow

WebSphere User Group UK: Larger Applications with Worklight
WebSphere User Group UK: Larger Applications with WorklightWebSphere User Group UK: Larger Applications with Worklight
WebSphere User Group UK: Larger Applications with Worklight
Andrew Ferrier
 
Patterns for Building High Performance Applications in Cloud - CloudConnect2012
Patterns for Building High Performance Applications in Cloud - CloudConnect2012Patterns for Building High Performance Applications in Cloud - CloudConnect2012
Patterns for Building High Performance Applications in Cloud - CloudConnect2012
Munish Gupta
 
Open.source.innovation.20070624
Open.source.innovation.20070624Open.source.innovation.20070624
Open.source.innovation.20070624
Vu Hung Nguyen
 
Java programming basics
Java programming basicsJava programming basics
Java programming basics
Pragya Rastogi
 

Similar to Calabash, an open-source automated testing technology for native mobile, by Karl Krukow (20)

Testing banking apps
Testing banking appsTesting banking apps
Testing banking apps
 
WebSphere User Group UK: Larger Applications with Worklight
WebSphere User Group UK: Larger Applications with WorklightWebSphere User Group UK: Larger Applications with Worklight
WebSphere User Group UK: Larger Applications with Worklight
 
Cross-platform tools for mobile application development
Cross-platform tools for mobile application developmentCross-platform tools for mobile application development
Cross-platform tools for mobile application development
 
Software variability management - 2017
Software variability management - 2017Software variability management - 2017
Software variability management - 2017
 
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...
 
Testing Best Practices
Testing Best PracticesTesting Best Practices
Testing Best Practices
 
Usability Testing Basics
Usability Testing BasicsUsability Testing Basics
Usability Testing Basics
 
Exploratory Mobile Testing Webinar_XBOSoft_jean_annharrison
Exploratory Mobile Testing Webinar_XBOSoft_jean_annharrisonExploratory Mobile Testing Webinar_XBOSoft_jean_annharrison
Exploratory Mobile Testing Webinar_XBOSoft_jean_annharrison
 
Patterns for Building High Performance Applications in Cloud - CloudConnect2012
Patterns for Building High Performance Applications in Cloud - CloudConnect2012Patterns for Building High Performance Applications in Cloud - CloudConnect2012
Patterns for Building High Performance Applications in Cloud - CloudConnect2012
 
Building Mobile Web Apps with jQM and Cordova on Azure
Building Mobile Web Apps with jQM and Cordova on AzureBuilding Mobile Web Apps with jQM and Cordova on Azure
Building Mobile Web Apps with jQM and Cordova on Azure
 
Cucumber in Practice(en)
Cucumber in Practice(en)Cucumber in Practice(en)
Cucumber in Practice(en)
 
Core Java
Core JavaCore Java
Core Java
 
Mobile Apps Testing - Part 2
Mobile Apps Testing - Part 2Mobile Apps Testing - Part 2
Mobile Apps Testing - Part 2
 
Open.source.innovation.20070624
Open.source.innovation.20070624Open.source.innovation.20070624
Open.source.innovation.20070624
 
Choosing the right Technologies for your next unicorn.
Choosing the right Technologies for your next unicorn.Choosing the right Technologies for your next unicorn.
Choosing the right Technologies for your next unicorn.
 
Introduction to Java Programming
Introduction to Java ProgrammingIntroduction to Java Programming
Introduction to Java Programming
 
Test Strategies in Microservices
Test Strategies in MicroservicesTest Strategies in Microservices
Test Strategies in Microservices
 
Random thoughts and dev practices / advices to build a great product
Random thoughts and dev practices / advices to build a great productRandom thoughts and dev practices / advices to build a great product
Random thoughts and dev practices / advices to build a great product
 
Orientation - Java
Orientation - JavaOrientation - Java
Orientation - Java
 
Java programming basics
Java programming basicsJava programming basics
Java programming basics
 

More from Codemotion

More from Codemotion (20)

Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
 
Pompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyPompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending story
 
Pastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaPastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storia
 
Pennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserPennisi - Essere Richard Altwasser
Pennisi - Essere Richard Altwasser
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
 
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
 
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
 
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 - Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
 
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
 
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
 
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
 
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
 
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
 
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
 
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
 
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
 
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
 
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Calabash, an open-source automated testing technology for native mobile, by Karl Krukow

  • 1. Introducing Calabash automated functional testing for mobile native apps Karl Krukow, karl@lesspainful.com, LessPainful CodeMotion 2012, Rome 1 fredag den 23. marts 12
  • 2. About me 2 fredag den 23. marts 12
  • 3. About me • PhD, Computer Science, University of Aarhus, 2006. 2 fredag den 23. marts 12
  • 4. About me • PhD, Computer Science, University of Aarhus, 2006. • Developer at Trifork for about 6 years mostly Java enterprise, last two years on iOS. 2 fredag den 23. marts 12
  • 5. About me • PhD, Computer Science, University of Aarhus, 2006. • Developer at Trifork for about 6 years mostly Java enterprise, last two years on iOS. • Co-owner, iOS responsible at 2 fredag den 23. marts 12
  • 6. About me • PhD, Computer Science, University of Aarhus, 2006. • Developer at Trifork for about 6 years mostly Java enterprise, last two years on iOS. • Co-owner, iOS responsible at • Spare-time Hickey & Clojure fan-boy! 2 fredag den 23. marts 12
  • 7. Agenda 3 fredag den 23. marts 12
  • 8. Agenda • Automated functional testing for native mobile • Some desirable properties for a functional testing tool 3 fredag den 23. marts 12
  • 9. Agenda • Automated functional testing for native mobile • Some desirable properties for a functional testing tool • Introduce Calabash • Focus on iOS only 3 fredag den 23. marts 12
  • 10. Agenda • Automated functional testing for native mobile • Some desirable properties for a functional testing tool • Introduce Calabash • Focus on iOS only • Live Demo: • Calabash iOS • LessPainful: test service and device cloud 3 fredag den 23. marts 12
  • 11. Functional testing 4 fredag den 23. marts 12
  • 12. Functional testing • Functional and Acceptance tests • Actual app, as opposed to an isolated component • Often based on use-cases written in natural language (for domain) • Visual appearance of screens matter! (Design guidelines, branding,..) • As realistic an environment as practically possible 4 fredag den 23. marts 12
  • 13. Functional testing • Functional and Acceptance tests • Actual app, as opposed to an isolated component • Often based on use-cases written in natural language (for domain) • Visual appearance of screens matter! (Design guidelines, branding,..) • As realistic an environment as practically possible • For mobile apps, in particular • Many devices, screens, OS versions, languages • often a manual process: repetitive, expensive • regressions: why should I test that again? 4 fredag den 23. marts 12
  • 14. Functional testing desiderata 5 fredag den 23. marts 12
  • 15. Functional testing desiderata • Minimize distance between use cases and actual test code (DSLs?). • Expressive and efficient to write. • Extensible • High-level, declarative (robustness against “minor” UI changes). • Support testing in realistic environments (multiple real devices, on multiple OS versions, languages). • Support Continuous integration. 5 fredag den 23. marts 12
  • 16. Cucumber and Calabash fredag den 23. marts 12
  • 17. Cucumber provides • a framework for writing software specifications • a tool for executing those specifications • Specifications are written in a business readable language that is close to natural language. • Extremely popular tool for test and specs of web applications. • http://cukes.info/ fredag den 23. marts 12
  • 18. Cucumber Example Feature: As an administrator. I want to be able to add and remove users, so I can control access to the application Scenario: Add test user When I touch the Add User button And I fill in text fields as follows: | field | text | | Last Name | Knorr | | Username | knorr | And I touch "Save" Then I should be on the Users screen And I should see a table containing "Knorr" Scenario: ... fredag den 23. marts 12
  • 19. Cucumber Example Feature: As an administrator. I want to be able to add and remove users, so I can control access to the application Scenario: Add test user When I touch the Add User button And I fill in text fields as follows: | field | text | | Last Name | Knorr | | Username | knorr | And I touch "Save" Then I should be on the Users screen And I should see a table containing "Knorr" Scenario: ... fredag den 23. marts 12
  • 20. Cucumber Example Feature: As an administrator. I want to be able to add and remove users, so I can control access to the application Scenario: Add test user When I touch the Add User button And I fill in text fields as follows: | field | text | | Last Name | Knorr | | Username | knorr | And I touch "Save" Then I should be on the Users screen And I should see a table containing "Knorr" Scenario: ... fredag den 23. marts 12
  • 21. Cucumber Example Feature: As an administrator. I want to be able to add and remove users, so I can control access to the application Scenario: Add test user When I touch the Add User button And I fill in text fields as follows: | field | text | | Last Name | Knorr | | Username | knorr | And I touch "Save" Then I should be on the Users screen And I should see a table containing "Knorr" Scenario: ... fredag den 23. marts 12
  • 22. Cucumber Example Feature: As an administrator. I want to be able to add and remove users, so I can control access to the application Scenario: Add test user When I touch the Add User button And I fill in text fields as follows: | field | text | | Last Name | Knorr | | Username | knorr | And I touch "Save" Then I should be on the Users screen And I should see a table containing "Knorr" Scenario: ... fredag den 23. marts 12
  • 23. Cucumber Example Feature: As an administrator. I want to be able to add and remove users, so I can control access to the application Scenario: Add test user When I touch the Add User button And I fill in text fields as follows: | field | text | | Last Name | Knorr | | Username | knorr | And I touch "Save" Then I should be on the Users screen And I should see a table containing "Knorr" Scenario: ... fredag den 23. marts 12
  • 24. Step Definitions • Make the cucumber tests “come alive” • Written in ordinary programming languages • Mostly Ruby (but cucumber-jvm: Java, Clojure,...) Feature Step definitions fredag den 23. marts 12
  • 25. Step Definitions • Make the cucumber tests “come alive” • Written in ordinary programming languages • Mostly Ruby (but cucumber-jvm: Java, Clojure,...) Feature Step definitions Scenario: Add test user When I touch the Add User button ... fredag den 23. marts 12
  • 26. Step Definitions • Make the cucumber tests “come alive” • Written in ordinary programming languages • Mostly Ruby (but cucumber-jvm: Java, Clojure,...) Feature Step definitions Scenario: Add test user When /^I touch the Add User button$/ do When I touch the Add User button btn_txt = 'Add user' ... touch("button text:#{btn_txt}") end fredag den 23. marts 12
  • 27. Calabash • One interface: Cucumber, for Android and iOS tests. • Predefined and custom steps (Ruby + soon: JVM). • Reuse of tests across platform possible. • Run on physical devices and simulators. • Support for hybrid apps (embedded webviews) • Free, open source with commercial add-ons: • Run tests in a device cloud using the LessPainful service, • we can write and run your tests, • setting up continuous integration, consulting, training, support. 10 fredag den 23. marts 12
  • 28. Architecture iOS iOS App -------------------- Calabash library fredag den 23. marts 12
  • 29. Architecture iOS features iOS App -------------------- Cucumber Calabash library (ruby api) Test report (cucumber) fredag den 23. marts 12
  • 30. LessPainful Test Execution in the Cloud • Execute Calabash tests concurrently on many devices, OS’es, languages. • Authentic: Not jailbroken, iOS and Android devices, rotation. • Visual test reports. • Comparison across models and operating systems. • Continuous integration. fredag den 23. marts 12
  • 31. fredag den 23. marts 12
  • 32. fredag den 23. marts 12
  • 33. fredag den 23. marts 12
  • 34. Calabash iOS: more detail 15 fredag den 23. marts 12
  • 35. Calabash: more detail • Very easy to get started for iOS developers/QAs. • Declarative query language for finding views. • Based on UISpec, but simplified and extended. (New Implementation, EPL licensed). • Touch synthesis, supports (multitouch) gestures. Extensible. (pan, swipe, pinch, your own) • Full power of Ruby programming language for test logic • Interactive, exploratory development experience. • Can use device accessibility for identifying views. 16 fredag den 23. marts 12
  • 36. Queries 17 fredag den 23. marts 12
  • 37. Queries • Queries are like CSS selectors or XPath • label text:‘Hello‘ • label index:2 • view marked:‘thepane’ label • view:‘MyClassName’ • label {text LIKE ‘Hel*’} • webView css:‘#header a.cssclass‘ • webView xpath:’//node()’ 17 fredag den 23. marts 12
  • 38. Demo: - Calabash iOS - LessPainful Device Cloud 18 fredag den 23. marts 12
  • 39. iOS Comparisons • Several options available. To my knowledge: • Calabash • UIAutomation, Apple • Zucchini, iOS Testing Framework • Frank, Pete Hodgson, ThoughtWorks • UISpec, http://code.google.com/p/uispec/ • FoneMonkey => MonkeyTalk, GorillaLogic • KIF, Square • NativeDriver, http://code.google.com/p/nativedriver/ 19 fredag den 23. marts 12
  • 40. References • https://github.com/calabash • https://github.com/calabash/calabash-ios • https://github.com/calabash/calabash-ios/wiki • https://github.com/calabash/calabash-ios-server • https://github.com/calabash/calabash-android • http://blog.lesspainful.com/ • https://www.lesspainful.com/ 20 fredag den 23. marts 12
  • 41. Questions? Making app testing less painful... Please contact us with any questions: contact@lesspainful.com karl@lesspainful.com - iOS jonas@lesspainful.com - Android http://www.lesspainful.com fredag den 23. marts 12