DesktopTestingLibrary

Differences between revisions 1 and 2
Revision 1 as of 2008-08-04 15:36:50
Size: 1453
Editor: static-101-137-235-87
Comment:
Revision 2 as of 2008-08-06 16:27:08
Size: 1453
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

Summary

The aim of this document is to provide a hands-on introduction to the use of the Ubuntu testing package to create new Ubuntu tests.

Installation

The latest version of the testing library is available at Launchpad bazaar repository. See https://code.launchpad.net/~apulido/ubuntu-desktop-testing/testing-library for more information.

To install the library open a terminal and from the testing-library folder:

$ sudo python setup.py install

Hello World!

Once installed we are going to create our first script to test Ubuntu. Our script will open the Gedit and will write the string "Hello World!" in the main gedit window.

   1 # Main LDTP python wrappers 
   2 from ooldtp import *
   3 from ldtp import *
   4 from ldtputils import *
   5 
   6 # Necessary if we want to track performance
   7 from time import *
   8 
   9 # The main library in the testing-library for Ubuntu [1]
  10 from ubuntutesting.ubuntu import *
  11 
  12 try:
  13 
  14     # Gedit is the main class for GEdit tests.
  15     gedit = GEdit()
  16     
  17     # Start performance test
  18     start_time = time()
  19     
  20     # Open Gedit application and wait for existance
  21     gedit.open()
  22     
  23     # Write the selected text
  24     gedit.write_text("Hello World!")
  25     stop_time = time()
  26     
  27     elapsed = stop_time - start_time
  28     
  29     # Log time performance
  30     log ('elapsed_time: ' + str(elapsed), 'comment')
  31     
  32 except LdtpExecutionError, msg:
  33     raise

Testing/Automation/Mago/DesktopTestingLibrary (last edited 2009-06-29 09:17:00 by 63)