SlideShare uma empresa Scribd logo
1 de 32
Baixar para ler offline
Session outline

   Introduction
   Simulator basics
   Mobile end-to-end testing (Moet)
   Building your mobile tests
   Demo
   Advantages and limitations
   Q&A
What are we solving for

 Diverse mobile platforms
 Low cost solution
 End-to-end mobile tests
 Leverage black box testers
Simulator Basics

   BlackBerry TM
     Starting simulator
        fledge.exe
           /app=jvm.dll
           /session=<model>
           /app-param=
               JvmAlxConfigFile:<model>.xml
           /handheld=<model>

     Communicating with simulator
        fledgecontroller.exe /session=<model>
Simulator commands
Actions           Steps
Start 9630 Tour   fledge.exe /app=jvm.dll
simulator            /session=9630 /handheld=9630
                     /app-
                     param=JvmAlxConfigFile:9630.xml
Install           1. Copy app.jar, app.jad, app.cod to
application          Javaloader directory
                  2. JavaLoader.exe –u load app.jad
                3. Delete app.jar, app.jad, app.cod
Save screenshot 1. JavaLoader.exe –u screenshot
as test.png in     test.png
$TEST_OUTPUT
                  2. mv test.png $TEST_OUTPUT
bblib.py
Actions           Steps                                  bblib.py
Start 9630 Tour   fledge.exe /app=jvm.dll                fledgeStart()
simulator            /session=9630 /handheld=9630
                     /app-
                     param=JvmAlxConfigFile:9630.xml
Install           1. Copy app.jar, app.jad, app.cod to   install()
application          Javaloader directory
                  2. JavaLoader.exe –u load app.jad
                3. Delete app.jar, app.jad, app.cod
Save screenshot 1. JavaLoader.exe –u screenshot          screenshot(‘test’)
as test.png in     test.png
$TEST_OUTPUT
                  2. mv test.png $TEST_OUTPUT
Simulator commands
Action         Steps
Enter 'Hello   StringInjection(Hello)
World'         KeyPress(SPACE)
               KeyRelease(SPACE)
                StringInjection(World)
Touch screen at TouchScreenPress(10, 100, 0)
(10, 100)       TouchScreenClick()
                TouchScreenUnclick()
                TouchScreenUnpress(0)
Thumbwheel up ThumbWheelRoll(-1)
twice          ThumbWheelRoll(-1)
bblib.py
Action         Steps                           bblib.py
Enter 'Hello   StringInjection(Hello)          enter(‘Hello World')
World'         KeyPress(SPACE)
               KeyRelease(SPACE)
                StringInjection(World)
Touch screen at TouchScreenPress(10, 100, 0)   touch(10, 100)
(10, 100)       TouchScreenClick()
                TouchScreenUnclick()
                TouchScreenUnpress(0)
Thumbwheel up ThumbWheelRoll(-1)               thumbwheel ('up',
twice          ThumbWheelRoll(-1)                           2)
Simulator Basics
              TM
   Android
     Create AVD
        $ANDROID_HOME/tools/android


     Starting emulator
        emulator –avd <avd>


     Communicating with emulator
        adb shell
Simulator command
Action         Steps
Enter 'Hello   adb shell
World'         "sendevent /dev/input/event0 1 42 1;
                 sendevent /dev/input/event0 1 42 0;
                 sendevent /dev/input/event0 1 35 1;
                 sendevent /dev/input/event0 1 35 0;
                 sendevent /dev/input/event0 1 18 1;
                 sendevent /dev/input/event0 1 18 0;
                 sendevent /dev/input/event0 1 38 1;
                 sendevent /dev/input/event0 1 38 0;
                 sendevent /dev/input/event0 1 38 1;
                 sendevent /dev/input/event0 1 38 0;
                 sendevent /dev/input/event0 1 24 1;
                 sendevent /dev/input/event0 1 24 0;
               …"
androidlib.py
Action         Steps                                   androidlib.py
Enter 'Hello   adb shell                               enter(‘Hello
World'                                                   World’)
               "sendevent /dev/input/event0 1 42 1;
                 sendevent /dev/input/event0 1 42 0;
                 sendevent /dev/input/event0 1 35 1;
                 sendevent /dev/input/event0 1 35 0;
                 sendevent /dev/input/event0 1 18 1;
                 sendevent /dev/input/event0 1 18 0;
                 sendevent /dev/input/event0 1 38 1;
                 sendevent /dev/input/event0 1 38 0;
                 sendevent /dev/input/event0 1 38 1;
                 sendevent /dev/input/event0 1 38 0;
                 sendevent /dev/input/event0 1 24 1;
                 sendevent /dev/input/event0 1 24 0;
               …"
Moet

   Mobile end-to-End testing
     Open sourced on github
     Simulator libraries
        androidlib.py
        bblib.py
     Image processing library
        imagelib.py
     Testing utilities library
        testlib.py
        logger.py
Moet Framework

            Mobile Application Interface


              Device Independent Tests
                      Runtime binding
Simulator libraries


    Android app library        BlackBerry app library

       androidlib.py                    bblib.py
Test Automation Overview

1.   Define application interface
     This interface is device-agnostic.


2.   Implement the interface
     Implement the interface in your supported devices e.g. Android.
     Utilize python mobile libraries e.g. androidlib.py.


3.   Write your tests
     Tests are device independent and reusable on all supported devices.


4.   Run
Step 1 : Define app interface

class AppInterface:
 """ Application interface for all
   devices to implement """

  def add(self, contact):
    """Add contact """

  def find(self, contact):
    """ Find contact"""

  def delete(self, contact):
    """Delete contact"""
Test Automation Overview

1.   Define application interface
     This interface is device-agnostic.


2.   Implement the interface
     Implement the interface in your supported devices.
     Utilize moet libraries.


3.   Write your tests
     Tests are device independent and reusable on all supported devices.


4.   Run
Step 2 (Pearl) :
Implement the interface

def add(self, contact):
   """ Add contact """

   # click add contact
   enter()

   # enter name
   enter(contact.getFirstname()
   thumbwheel('down', 1)
    …
   # save
   menu()
   enter()
Step 2 (Android) :
Implement the interface

def add(self, contact):
   """ Add contact """

   # click add contact
   menu()
   scroll(‘up’)
   scroll(‘right’)
   enter()

   # enter name
   enter(contact.getFirstname())
   scroll('down')
   …
   # save
   menu()
   scroll(‘down’)
    enter()
Step 2 (recap) :
Implement the interface

def PearlImpl(appbase.AppInterface):   def AndroidImpl(appbase.AppInterface):
    def add(self, contact):               def add(self, contact):
         """ Add contact """                   """ Add contact """
       enter()                                 menu()
       enter(contact.getFirstname()            scroll(‘up’)
       thumbwheel('down', 1)                   scroll(‘right’)
       …                                       enter()
       menu()                                  enter(contact.getFirstname())
       enter()                                 scroll(‘down’)
                                               …
                                              menu()
                                              scroll(‘down’)
                                              enter()
Test Automation Overview

1.   Define application interface
     This interface is device-agnostic.


2.   Implement the interface
     Implement the interface in your supported devices e.g. Android.
     Utilize python mobile libraries e.g. androidlib.py.


3.   Write your tests
     Tests are device independent and reusable on all supported devices.


4.   Run
Step 3 : Writing tests
class AddContactTest(unittest.TestCase):

   device = testenv.getDeviceClass()

   def addContactWithOnlyFirstnameTest(self):
     self.contact.setFirstname(firstname)
     self.device.add(self.contact)

   def addContactWithOnlyLastnameTest(self):
     self.contact.setLastname(lastname)
     self.device.add(self.contact)
Step 3 : Runtime binding
def getDeviceClass(self):
    """ Returns the device to test """

   mobileDevice = self.getMobileDevice()

   if mobileDevice == 'pearl':
         import pearl
         deviceClass = pearl.PearlImpl()

   elif mobileDevice == ‘android':
          import android
          deviceClass = android.AndroidImpl()

   return deviceClass
More device-independent tests

Additional tests are easy to write

    def addContactWithEmailTest(self):
    def addContactWithAddressesTest(self):
    def addContactWithAllDetailsTest(self):
    def addContactWithLongDetailsTest(self):
    def addContactAddressWithStateZip(self):
    def addContactAddressWithCityStateZip(self):
    def addContactAddressWithNoDataNegativeTest(self):
Step 4 : Run

   Basic run command
     python <test.py>


   Python test frameworks
     unittest
     PyUnit
     python-nose
Test Verification

   Server hosted apps
     API assertions
     Database assertions

   Image assertions
      self.assertTrue(
        imagelib.compare(
          self.device, testname, '100%x90%‘, tolerance))
            # Crop settings examples
            # 100%x80%+10%+20% (crop size + offset)
            # 320x90+0+0
            # +0+90
Test Logging

   Logs
    AddressTest.log :
    2010-06-10 15:19:46,773 - testCreateAddressMethod - INFO -
       [Address] 200 Villa St Mountain View CA 94040 BUSINESS ADDRESS


   Initialization
    self.log = self.device.initLogger(self._testMethodName,
                                      self.__class__.__name__)

   Usage
    self.log.info('Starting test: ' + self._testMethodName)
    self.log.debug(self.contact)
    self.log.error(‘Missing image to compare’)
Demo

   Simulators
     Android
     BlackBerry Pearl
 Moet
 Test automation
     Address book app
      ○ Add contact
      ○ Find contact
      ○ Delete contact
Advantages

   Low cost and ease of use
   Reusable end-to-end tests
   No device sharing/scheduling
   Bigger device pool
   Reduce manual testing time
   Run on developer machines
   Debugging capabilities
Limitations

   Requires ethernet or internet connectivity
   Does not simulate network performance
   Does not support hardware controls testing
   Dependent on simulator reliability
   Limited peer-to-peer applications testing
Resources
Moet http://github.com/moet/moet/
Android 

     Emulator http://developer.android.com/guide/developing/tools/emulator.html

     ADB http://android-dls.com/wiki/index.php?title=ADB

     Forum http://developer.android.com/resources/community-groups.html

BlackBerry 
     Downloads http://na.blackberry.com/eng/developers/javaappdev/javadevenv.jsp
     Fledge Controller
          http://docs.blackberry.com/en/developers/deliverables/6338/Testing_apps_using_the_
          BBSmrtphnSmltr_607559_11.jsp

     Forum http://supportforums.blackberry.com/
Q&A
2011 py con

Mais conteúdo relacionado

Mais procurados

Real World Dependency Injection - IPC11 Spring Edition
Real World Dependency Injection - IPC11 Spring EditionReal World Dependency Injection - IPC11 Spring Edition
Real World Dependency Injection - IPC11 Spring Edition
Stephan Hochdörfer
 
Interpreter implementation of advice weaving
Interpreter implementation of advice weavingInterpreter implementation of advice weaving
Interpreter implementation of advice weaving
inaseer
 
Programming in java_-_17_-_swing
Programming in java_-_17_-_swingProgramming in java_-_17_-_swing
Programming in java_-_17_-_swing
josodo
 

Mais procurados (20)

Unit testing without Robolectric, Droidcon Berlin 2016
Unit testing without Robolectric, Droidcon Berlin 2016Unit testing without Robolectric, Droidcon Berlin 2016
Unit testing without Robolectric, Droidcon Berlin 2016
 
Leaving Interface Builder Behind
Leaving Interface Builder BehindLeaving Interface Builder Behind
Leaving Interface Builder Behind
 
Standford 2015 week4: 1.Protocols and Delegation, Gestures 2. Multiple MVCs
Standford 2015 week4: 1.Protocols and Delegation, Gestures 2. Multiple MVCsStandford 2015 week4: 1.Protocols and Delegation, Gestures 2. Multiple MVCs
Standford 2015 week4: 1.Protocols and Delegation, Gestures 2. Multiple MVCs
 
Capture image on eye blink
Capture image on eye blinkCapture image on eye blink
Capture image on eye blink
 
meet.js - QooXDoo
meet.js - QooXDoomeet.js - QooXDoo
meet.js - QooXDoo
 
An Introduction to the World of Testing for Front-End Developers
An Introduction to the World of Testing for Front-End DevelopersAn Introduction to the World of Testing for Front-End Developers
An Introduction to the World of Testing for Front-End Developers
 
FITC Web Unleashed 2017 - Introduction to the World of Testing for Front-End ...
FITC Web Unleashed 2017 - Introduction to the World of Testing for Front-End ...FITC Web Unleashed 2017 - Introduction to the World of Testing for Front-End ...
FITC Web Unleashed 2017 - Introduction to the World of Testing for Front-End ...
 
Android Unit Testing With Robolectric
Android Unit Testing With RobolectricAndroid Unit Testing With Robolectric
Android Unit Testing With Robolectric
 
Real World Dependency Injection - IPC11 Spring Edition
Real World Dependency Injection - IPC11 Spring EditionReal World Dependency Injection - IPC11 Spring Edition
Real World Dependency Injection - IPC11 Spring Edition
 
Building an app with Google's new suites
Building an app with Google's new suitesBuilding an app with Google's new suites
Building an app with Google's new suites
 
Interpreter implementation of advice weaving
Interpreter implementation of advice weavingInterpreter implementation of advice weaving
Interpreter implementation of advice weaving
 
Enterprise Tic-Tac-Toe
Enterprise Tic-Tac-ToeEnterprise Tic-Tac-Toe
Enterprise Tic-Tac-Toe
 
Kotlin : Advanced Tricks - Ubiratan Soares
Kotlin : Advanced Tricks - Ubiratan SoaresKotlin : Advanced Tricks - Ubiratan Soares
Kotlin : Advanced Tricks - Ubiratan Soares
 
Functional Testing for React Native Apps
Functional Testing for React Native AppsFunctional Testing for React Native Apps
Functional Testing for React Native Apps
 
Good code
Good codeGood code
Good code
 
Openframworks x Mobile
Openframworks x MobileOpenframworks x Mobile
Openframworks x Mobile
 
Programming in java_-_17_-_swing
Programming in java_-_17_-_swingProgramming in java_-_17_-_swing
Programming in java_-_17_-_swing
 
TDD per Webapps
TDD per WebappsTDD per Webapps
TDD per Webapps
 
Testing with VS2010 - A Bugs Life
Testing with VS2010 - A Bugs LifeTesting with VS2010 - A Bugs Life
Testing with VS2010 - A Bugs Life
 
Java: GUI
Java: GUIJava: GUI
Java: GUI
 

Semelhante a 2011 py con

Semelhante a 2011 py con (20)

Eclipse Summit Europe '10 - Test UI Aspects of Plug-ins
Eclipse Summit Europe '10 - Test UI Aspects of Plug-insEclipse Summit Europe '10 - Test UI Aspects of Plug-ins
Eclipse Summit Europe '10 - Test UI Aspects of Plug-ins
 
The Ring programming language version 1.7 book - Part 85 of 196
The Ring programming language version 1.7 book - Part 85 of 196The Ring programming language version 1.7 book - Part 85 of 196
The Ring programming language version 1.7 book - Part 85 of 196
 
Of class1
Of class1Of class1
Of class1
 
Xam expertday
Xam expertdayXam expertday
Xam expertday
 
Droidcon Turin 2015 - Android wear sdk introduction
Droidcon Turin 2015 - Android wear sdk introductionDroidcon Turin 2015 - Android wear sdk introduction
Droidcon Turin 2015 - Android wear sdk introduction
 
Android wear SDK introduction
Android wear SDK introductionAndroid wear SDK introduction
Android wear SDK introduction
 
Android development with Scala and SBT
Android development with Scala and SBTAndroid development with Scala and SBT
Android development with Scala and SBT
 
JUNit Presentation
JUNit PresentationJUNit Presentation
JUNit Presentation
 
MOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app developmentMOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app development
 
Mobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScriptMobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScript
 
Introduction toandroid
Introduction toandroidIntroduction toandroid
Introduction toandroid
 
Workshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingWorkshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testing
 
The fundamental problems of GUI applications and why people choose React
The fundamental problems of GUI applications and why people choose ReactThe fundamental problems of GUI applications and why people choose React
The fundamental problems of GUI applications and why people choose React
 
Griffon @ Svwjug
Griffon @ SvwjugGriffon @ Svwjug
Griffon @ Svwjug
 
jQuery Bay Area Conference 2010
jQuery Bay Area Conference 2010jQuery Bay Area Conference 2010
jQuery Bay Area Conference 2010
 
End to-end testing from rookie to pro
End to-end testing  from rookie to proEnd to-end testing  from rookie to pro
End to-end testing from rookie to pro
 
Zio from Home
Zio from Home Zio from Home
Zio from Home
 
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
 
Eric Lafortune - The Jack and Jill build system
Eric Lafortune - The Jack and Jill build systemEric Lafortune - The Jack and Jill build system
Eric Lafortune - The Jack and Jill build system
 
Projet d'accès aux résultats des étudiant via client mobile
Projet d'accès aux résultats des étudiant via client mobile Projet d'accès aux résultats des étudiant via client mobile
Projet d'accès aux résultats des étudiant via client mobile
 

2011 py con

  • 1.
  • 2. Session outline  Introduction  Simulator basics  Mobile end-to-end testing (Moet)  Building your mobile tests  Demo  Advantages and limitations  Q&A
  • 3. What are we solving for  Diverse mobile platforms  Low cost solution  End-to-end mobile tests  Leverage black box testers
  • 4. Simulator Basics  BlackBerry TM  Starting simulator fledge.exe /app=jvm.dll /session=<model> /app-param= JvmAlxConfigFile:<model>.xml /handheld=<model>  Communicating with simulator fledgecontroller.exe /session=<model>
  • 5. Simulator commands Actions Steps Start 9630 Tour fledge.exe /app=jvm.dll simulator /session=9630 /handheld=9630 /app- param=JvmAlxConfigFile:9630.xml Install 1. Copy app.jar, app.jad, app.cod to application Javaloader directory 2. JavaLoader.exe –u load app.jad 3. Delete app.jar, app.jad, app.cod Save screenshot 1. JavaLoader.exe –u screenshot as test.png in test.png $TEST_OUTPUT 2. mv test.png $TEST_OUTPUT
  • 6. bblib.py Actions Steps bblib.py Start 9630 Tour fledge.exe /app=jvm.dll fledgeStart() simulator /session=9630 /handheld=9630 /app- param=JvmAlxConfigFile:9630.xml Install 1. Copy app.jar, app.jad, app.cod to install() application Javaloader directory 2. JavaLoader.exe –u load app.jad 3. Delete app.jar, app.jad, app.cod Save screenshot 1. JavaLoader.exe –u screenshot screenshot(‘test’) as test.png in test.png $TEST_OUTPUT 2. mv test.png $TEST_OUTPUT
  • 7. Simulator commands Action Steps Enter 'Hello StringInjection(Hello) World' KeyPress(SPACE) KeyRelease(SPACE) StringInjection(World) Touch screen at TouchScreenPress(10, 100, 0) (10, 100) TouchScreenClick() TouchScreenUnclick() TouchScreenUnpress(0) Thumbwheel up ThumbWheelRoll(-1) twice ThumbWheelRoll(-1)
  • 8. bblib.py Action Steps bblib.py Enter 'Hello StringInjection(Hello) enter(‘Hello World') World' KeyPress(SPACE) KeyRelease(SPACE) StringInjection(World) Touch screen at TouchScreenPress(10, 100, 0) touch(10, 100) (10, 100) TouchScreenClick() TouchScreenUnclick() TouchScreenUnpress(0) Thumbwheel up ThumbWheelRoll(-1) thumbwheel ('up', twice ThumbWheelRoll(-1) 2)
  • 9. Simulator Basics TM  Android  Create AVD $ANDROID_HOME/tools/android  Starting emulator emulator –avd <avd>  Communicating with emulator adb shell
  • 10. Simulator command Action Steps Enter 'Hello adb shell World' "sendevent /dev/input/event0 1 42 1; sendevent /dev/input/event0 1 42 0; sendevent /dev/input/event0 1 35 1; sendevent /dev/input/event0 1 35 0; sendevent /dev/input/event0 1 18 1; sendevent /dev/input/event0 1 18 0; sendevent /dev/input/event0 1 38 1; sendevent /dev/input/event0 1 38 0; sendevent /dev/input/event0 1 38 1; sendevent /dev/input/event0 1 38 0; sendevent /dev/input/event0 1 24 1; sendevent /dev/input/event0 1 24 0; …"
  • 11. androidlib.py Action Steps androidlib.py Enter 'Hello adb shell enter(‘Hello World' World’) "sendevent /dev/input/event0 1 42 1; sendevent /dev/input/event0 1 42 0; sendevent /dev/input/event0 1 35 1; sendevent /dev/input/event0 1 35 0; sendevent /dev/input/event0 1 18 1; sendevent /dev/input/event0 1 18 0; sendevent /dev/input/event0 1 38 1; sendevent /dev/input/event0 1 38 0; sendevent /dev/input/event0 1 38 1; sendevent /dev/input/event0 1 38 0; sendevent /dev/input/event0 1 24 1; sendevent /dev/input/event0 1 24 0; …"
  • 12. Moet  Mobile end-to-End testing  Open sourced on github  Simulator libraries androidlib.py bblib.py  Image processing library imagelib.py  Testing utilities library testlib.py logger.py
  • 13. Moet Framework Mobile Application Interface Device Independent Tests Runtime binding Simulator libraries Android app library BlackBerry app library androidlib.py bblib.py
  • 14. Test Automation Overview 1. Define application interface This interface is device-agnostic. 2. Implement the interface Implement the interface in your supported devices e.g. Android. Utilize python mobile libraries e.g. androidlib.py. 3. Write your tests Tests are device independent and reusable on all supported devices. 4. Run
  • 15. Step 1 : Define app interface class AppInterface: """ Application interface for all devices to implement """ def add(self, contact): """Add contact """ def find(self, contact): """ Find contact""" def delete(self, contact): """Delete contact"""
  • 16. Test Automation Overview 1. Define application interface This interface is device-agnostic. 2. Implement the interface Implement the interface in your supported devices. Utilize moet libraries. 3. Write your tests Tests are device independent and reusable on all supported devices. 4. Run
  • 17. Step 2 (Pearl) : Implement the interface def add(self, contact): """ Add contact """ # click add contact enter() # enter name enter(contact.getFirstname() thumbwheel('down', 1) … # save menu() enter()
  • 18. Step 2 (Android) : Implement the interface def add(self, contact): """ Add contact """ # click add contact menu() scroll(‘up’) scroll(‘right’) enter() # enter name enter(contact.getFirstname()) scroll('down') … # save menu() scroll(‘down’) enter()
  • 19. Step 2 (recap) : Implement the interface def PearlImpl(appbase.AppInterface): def AndroidImpl(appbase.AppInterface): def add(self, contact): def add(self, contact): """ Add contact """ """ Add contact """ enter() menu() enter(contact.getFirstname() scroll(‘up’) thumbwheel('down', 1) scroll(‘right’) … enter() menu() enter(contact.getFirstname()) enter() scroll(‘down’) … menu() scroll(‘down’) enter()
  • 20. Test Automation Overview 1. Define application interface This interface is device-agnostic. 2. Implement the interface Implement the interface in your supported devices e.g. Android. Utilize python mobile libraries e.g. androidlib.py. 3. Write your tests Tests are device independent and reusable on all supported devices. 4. Run
  • 21. Step 3 : Writing tests class AddContactTest(unittest.TestCase): device = testenv.getDeviceClass() def addContactWithOnlyFirstnameTest(self): self.contact.setFirstname(firstname) self.device.add(self.contact) def addContactWithOnlyLastnameTest(self): self.contact.setLastname(lastname) self.device.add(self.contact)
  • 22. Step 3 : Runtime binding def getDeviceClass(self): """ Returns the device to test """ mobileDevice = self.getMobileDevice() if mobileDevice == 'pearl': import pearl deviceClass = pearl.PearlImpl() elif mobileDevice == ‘android': import android deviceClass = android.AndroidImpl() return deviceClass
  • 23. More device-independent tests Additional tests are easy to write def addContactWithEmailTest(self): def addContactWithAddressesTest(self): def addContactWithAllDetailsTest(self): def addContactWithLongDetailsTest(self): def addContactAddressWithStateZip(self): def addContactAddressWithCityStateZip(self): def addContactAddressWithNoDataNegativeTest(self):
  • 24. Step 4 : Run  Basic run command  python <test.py>  Python test frameworks  unittest  PyUnit  python-nose
  • 25. Test Verification  Server hosted apps  API assertions  Database assertions  Image assertions self.assertTrue( imagelib.compare( self.device, testname, '100%x90%‘, tolerance)) # Crop settings examples # 100%x80%+10%+20% (crop size + offset) # 320x90+0+0 # +0+90
  • 26. Test Logging  Logs AddressTest.log : 2010-06-10 15:19:46,773 - testCreateAddressMethod - INFO - [Address] 200 Villa St Mountain View CA 94040 BUSINESS ADDRESS  Initialization self.log = self.device.initLogger(self._testMethodName, self.__class__.__name__)  Usage self.log.info('Starting test: ' + self._testMethodName) self.log.debug(self.contact) self.log.error(‘Missing image to compare’)
  • 27. Demo  Simulators  Android  BlackBerry Pearl  Moet  Test automation  Address book app ○ Add contact ○ Find contact ○ Delete contact
  • 28. Advantages  Low cost and ease of use  Reusable end-to-end tests  No device sharing/scheduling  Bigger device pool  Reduce manual testing time  Run on developer machines  Debugging capabilities
  • 29. Limitations  Requires ethernet or internet connectivity  Does not simulate network performance  Does not support hardware controls testing  Dependent on simulator reliability  Limited peer-to-peer applications testing
  • 30. Resources Moet http://github.com/moet/moet/ Android  Emulator http://developer.android.com/guide/developing/tools/emulator.html ADB http://android-dls.com/wiki/index.php?title=ADB Forum http://developer.android.com/resources/community-groups.html BlackBerry  Downloads http://na.blackberry.com/eng/developers/javaappdev/javadevenv.jsp Fledge Controller http://docs.blackberry.com/en/developers/deliverables/6338/Testing_apps_using_the_ BBSmrtphnSmltr_607559_11.jsp Forum http://supportforums.blackberry.com/
  • 31. Q&A