Slide 1

Slide 1 text

Functionally Mobile I believe every mobile app should be tested through automation. Sebastian Tiedtke @sourishkrout

Slide 2

Slide 2 text

Why?

Slide 3

Slide 3 text

Paradigm Shift? ! More mobile devices More consumers More apps 


Slide 4

Slide 4 text

Mobile creates New Opportunities


Slide 5

Slide 5 text

Opportunities come with Challenges

Slide 6

Slide 6 text

Multitude of Platforms ! ! ! ! ! ! ! ! !

Slide 7

Slide 7 text

Device Fragmentation * Data as of July 2013; Source: h"p://www.idownloadblog.com/2013/07/30/the-­‐terrible-­‐state-­‐of-­‐android-­‐fragmenta=on/ 

Slide 8

Slide 8 text

Different Screen Sizes

Slide 9

Slide 9 text

Agile Development

Slide 10

Slide 10 text

AppStore Approval

Slide 11

Slide 11 text

Quality Assurance is a key factor to success ! - Find bugs before app users do - Execute tests quickly and repetitively - Systematically and automated 

Slide 12

Slide 12 text

How?

Slide 13

Slide 13 text

Comprehensive App Development Approach using Web Technologies


Slide 14

Slide 14 text

Apache Cordova / PhoneGap ! Apache Cordova is a platform for building native mobile applications using HTML, CSS and JavaScript.

Slide 15

Slide 15 text

Topcoat ! CSS for clean and fast web apps. Benchmarked for performance. Think twitter bootstrap for apps. 


Slide 16

Slide 16 text

Test App - Quick Demo ! Courtesy of Christophe Coenraets from Adobe ! https://github.com/ccoenraets/directory-backbone-topcoat

Slide 17

Slide 17 text

Appium ! Appium is an open source test automation framework for use with native and hybrid mobile apps. It drives iOS and Android apps using the WebDriver JSON wire protocol. 


Slide 18

Slide 18 text

Appium: Selenium 3 ! Appium 1.x is an implementation of the proposed extensions to the Selenium/Webdriver JSON wire protocol to natively embrace mobile for Sessions, Locator Strategies, Contexts, Gestures, etc. 


Slide 19

Slide 19 text

How does Appium work? !

Slide 20

Slide 20 text

Appium for iOS !

Slide 21

Slide 21 text

Appium for Android !

Slide 22

Slide 22 text

Why Appium? ! R1. Test the same app you submit to the market place R2. Write your tests in any language, using any framework R3. Use a standard automation specification and API R4. Build a large and thriving open-source community effort ! Test execution on emulators and real devices. 


Slide 23

Slide 23 text

Anatomy of a Hybrid App ! ! ! ! ! ! ! Cordova exposes native platform APIs to the web app using a unified Javascript API * Illustration source: h"p://bizitpi.blogspot.com/2012/12/what-­‐should-­‐i-­‐choose-­‐na=ve-­‐or-­‐hybrid.html

Slide 24

Slide 24 text

Native vs Web View Context ! Same APIs and protocol to talk to native as well as webview parts of mobile apps -> Selenium ! API calls available to switch contexts ! ! ! +

Slide 25

Slide 25 text

Native vs Web View Context  it('should confirm table cell element is visible', function(done) {! h.driver.elementsByTagName('tableCell', function(err, els) {! // do something with native table cell (iOS) elements! });! });! ! // context switch native to web view! ! it('should confirm spans are visible', function(done) {! h.driver.elementsByTagName('span', function(err, els) {! // do something with span elements (web DOM)! });! });! +

Slide 26

Slide 26 text

Test All The Things! ! Execute the exact same test suite on iOS and Android ! Demo + Code

Slide 27

Slide 27 text

Test Implementation ! Based on node.js 0.11’s generators (ES6 Harmony) ! - Mocha - WD.js through yiewd.js (generator based) - monocle.js

Slide 28

Slide 28 text

Use Your Favorite Tools

Slide 29

Slide 29 text

What’s next? ! Continuous Integration with Jenkins, Travis, Strider, etc Appium Functional Testing at Scale using Selenium Grid or Sauce Labs (free for Open Source projects) ! Smoke tests are a good starting point Perfect to back up your Javascript unit tests

Slide 30

Slide 30 text

Please Help Us! ! Appium: http://appium.io/ ! Gappium: https://github.com/appium/ io.appium.gappium.sampleapp ! Apache Cordova: http://cordova.apache.org/ ! Topcoat: http://topcoat.io/ ! @sourishkrout