This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

Jason Cozens

My main wiki page is on the ubuntu wiki: https://wiki.ubuntu.com/JasonCozens

Email: <you AT SPAMFREE example DOT com>

Using gnome-desktop-testing

In the initial examples we will use gedit as the application. In desktoptesting.gnome.py there is a class GEdit that derives from the Application class.

   1 class GEdit(Application):
   2     """
   3     GEdit manages the Gedit application.
   4     """

   1 import gnome
   2 
   3 gedit = gnome.GEdit()
   4 
   5 gedit.open()

./bin/desktop-testing

For a normal run with no options a list of suite_file(s) is built up. Each suite_file is then passed to the TestSuiteRunner class. This creates an instance of TestSuiteRunner and the run method is then called on this instance.

   1     runner = TestSuiteRunner(suite_file)
   2     results = runner.run(cases=cases)

First Experiments Using Ara's Notes

The following change to the gnome.py file and the addition of the two files below are about the minimum needed to open Evolution. This is very rough and ready.

jason@jason-desktop:~/gdt-2/desktoptesting$ svn diff gnome.py
Index: gnome.py
===================================================================
--- gnome.py    (revision 10)
+++ gnome.py    (working copy)
@@ -770,7 +770,36 @@
           
         cancelButton.click()
         ldtp.waittillguinotexist (self.name)
-        
 
+class Evolution(Application):
+    """
+    Description of the class
+    """
+
+#    Constants that should be defined in the classes that inherit from this class
+    LAUNCHER = "evolution" # Argument to be passed when launching the application through ldtp.launchapp
+    WINDOW = "" # Top application frame pattern using ldtp syntax
+    CLOSE_TYPE = "" # Close object type (one of 'menu' or 'button')
+    CLOSE_NAME = "" # Close object name
+
+    def __init__(self):
+        Application.__init__(self)
+
+    def setup(self):
+        #setup code, self.open(), i.e.
+        pass
+
+    def teardown(self):
+        #teardown code, self.exit(), i.e.
+        pass
+
+    def cleanup(self):
+        # Add here what happens between test cases
+        pass
+
+    def open(self):
+        Application.open_and_check_app(self)
+     
+
         
       

# -*- coding: utf-8 -*-

import ldtp
import ldtputils

from time import time, gmtime, strftime

from desktoptesting.gnome import Evolution
from desktoptesting.check import FileComparison, FAIL

class EvolutionOpen(Evolution):
    def Method01(self):
        self.open()
        
if __name__ == "__main__":
    evolution_open = EvolutionOpen()
    evolution_open.run()

<?xml version="1.0"?>
<suite name="Evolution Test Suite">
  <class>evolution.EvolutionOpen</class>
    <description>
    </description>
    <case name="Test Open">
      <method>Method01</method>
    </case>
</suite>


CategoryHomepage


2024-10-23 11:18