If you want to add test suites to a GNOME application that is not yet available in the framework you will need some python coding knowledge and should have some knowledge of the LDTP framework.

When adding a new GNOME application to the framework, you will need to edit the mago/applications/gnome.py file.

In the first one, add a new child class of Application, for the selected application, following the template below:

   1 class <NameOfApplication>(Application):
   2     """
   3     Description of the class
   4     """
   6 #    Constants that should be defined in the classes that inherit from this class
   7     LAUNCHER = "" # Argument to be passed when launching the application through ldtp.launchapp
   8     WINDOW = "" # Top application frame pattern using ldtp syntax
   9     CLOSE_TYPE = "" # Close object type (one of 'menu' or 'button')
  10     CLOSE_NAME = "" # Close object name
  12     def __init__(self):
  13         Application.__init__(self, gnome_constants.<APP_WINDOW_NAME>)
  15     def setup(self):
  16         #setup code, self.open(), i.e.
  18     def teardown(self):
  19         #teardown code, self.exit(), i.e.
  21     def cleanup(self):
  22         # Add here what happens between test cases
  23         pass
  25     def open(self):
  26         Application.open_and_check_app(self, gnome_constants.<LAUNCHER_NAME>)
  28     def do_stuff(self, arg1, arg2):
  29         """
  30         Description of the method
  32         @type arg1: <string, float, ...>
  33         @param arg1: description of first argument
  35         @type arg2: <string, float, ...>
  36         @param arg2: description of second argument argument
  38         """
  40         application = ooldtp.context(self.name)
  42         #insert here the ldtpcode
  44     def do_other_stuff(self, arg1, arg2):
  45         """
  46         Description of the method
  48         @type arg1: <string, float, ...>
  49         @param arg1: description of first argument
  51         @type arg2: <string, float, ...>
  52         @param arg2: description of second argument argument
  54         """
  56         application = ooldtp.context(self.name)
  58         #insert here the ldtpcode

All the constants of the application, such as window titles, button names, etc. should be described as strings at the beginning of the class.

All the applications should have these methods:

  • init: It calls the parent's init method with the name of the window title for the new one.

  • The rest of the methods will use ldtp calls to do common stuff with the application: write text, create documents, etc.

The test suites folder

When adding a new application to the framework, you should also create a new folder in the root mago folder called as the application name. This folder will be the container of the testsuites related to this application.

Please, refer to the document about creating new tests for more information about how to add new test suites to the new application.

Projects/Mago/Documentation/GettingStarted/AddNewApplications (last edited 2013-11-22 22:58:53 by WilliamJonMcCann)