NewApplications
⇤ ← Revision 1 as of 2009-03-25 15:52:23
3335
Comment:
|
2651
|
Deletions are marked like this. | Additions are marked like this. |
Line 3: | Line 3: |
When adding a new Ubuntu application to the framework, you will need to edit the desktoptesting/ubuntu.py and the desktoptesting/ubuntu_constants.py files. | When adding a new Ubuntu application to the framework, you will need to edit the desktoptesting/ubuntu.py file. When adding a new generic GNOME application to the framework, you will need to edit the desktoptesting/gnome.py file. |
Line 13: | Line 14: |
""" Application constant labels """ WINDOW = "frmPasswordsandEncryptionKeys" LAUNCHER = "seahorse" |
|
Line 15: | Line 22: |
def setup(self): #setup code, self.open(), i.e. def teardown(self): #teardown code, self.exit(), i.e. def cleanup(self): # Add here what happens between test cases pass def open(self): Application.open_and_check_app(self, ubuntu_constants.<LAUNCHER_NAME>) |
|
Line 63: | Line 57: |
All the constansts of the application, such as window titles, button names, etc. should go as strings to desktoptesting/ubuntu_constants.py, and should be referenced from there. | All the constants of the application, such as window titles, button names, etc. should be described as strings at the beginning of the class. |
Line 68: | Line 62: |
* '''setup''': This will be called at the beggining of a test suite, but not between test cases within the same suite. Opening the application is a classic set up operation. * '''teardown''': This will be called at the end of a complete test suite, but not between test cases within the same suite. Closing the application is a classic tear down operation. * '''cleanup''': This will be called at the end of each test case. Write code that cleans up the mess introduced by a test case that could interfere with the next one. |
If you want to add test suites to an Ubuntu 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 Ubuntu application to the framework, you will need to edit the desktoptesting/ubuntu.py file. When adding a new generic GNOME application to the framework, you will need to edit the desktoptesting/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 """
5
6 """
7 Application constant labels
8 """
9 WINDOW = "frmPasswordsandEncryptionKeys"
10 LAUNCHER = "seahorse"
11
12 def __init__(self):
13 Application.__init__(self, ubuntu_constants.<APP_WINDOW_NAME>)
14
15 def do_stuff(self, arg1, arg2):
16 """
17 Description of the method
18
19 @type arg1: <string, float, ...>
20 @param arg1: description of first argument
21
22 @type arg2: <string, float, ...>
23 @param arg2: description of second argument argument
24
25 """
26
27 application = ooldtp.context(self.name)
28
29 #insert here the ldtpcode
30
31 def do_other_stuff(self, arg1, arg2):
32 """
33 Description of the method
34
35 @type arg1: <string, float, ...>
36 @param arg1: description of first argument
37
38 @type arg2: <string, float, ...>
39 @param arg2: description of second argument argument
40
41 """
42
43 application = ooldtp.context(self.name)
44
45 #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 ubuntu-desktop-testing 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.
Testing/Automation/Mago/NewApplications (last edited 2009-06-29 09:19:51 by 63)