Merge lp:~marjo-mercado/mago/gobby_test into lp:~mago-contributors/mago/mago-1.0

Proposed by Marjo F. Mercado
Status: Merged
Merged at revision: 156
Proposed branch: lp:~marjo-mercado/mago/gobby_test
Merge into: lp:~mago-contributors/mago/mago-1.0
Diff against target: 200 lines (+147/-23)
6 files modified
gedit/gedit_chains.xml (+0/-23)
gobby/README (+17/-0)
gobby/gobby_basics.py (+13/-0)
gobby/gobby_basics.xml (+14/-0)
mago/application/gobby.py (+83/-0)
mago/test_suite/gobby.py (+20/-0)
To merge this branch: bzr merge lp:~marjo-mercado/mago/gobby_test
Reviewer Review Type Date Requested Status
Nagappan Alagappan Approve
Review via email: mp+43259@code.launchpad.net

Description of the change

Initial version of gobby test suite.

To post a comment you must log in.
Revision history for this message
Nagappan Alagappan (nagappan) wrote :

Looks okay to me

review: Approve
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

With the exception that it removes the gedit_chains.xml. I'll fix that in trunk.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed file 'gedit/gedit_chains.xml'
--- gedit/gedit_chains.xml 2009-06-03 09:41:56 +0000
+++ gedit/gedit_chains.xml 1970-01-01 00:00:00 +0000
@@ -1,23 +0,0 @@
1<?xml version="1.0"?>
2<suite name="gedit chains">
3 <class>gedit_chains.GEditChain</class>
4 <description>
5 Tests which verify gedit's save file functionality.
6 </description>
7 <case name="Unicode Tests">
8 <method>testChain</method>
9 <description>Test Unicode text saving.</description>
10 <args>
11 <oracle>data/utf8.txt</oracle>
12 <chain>This is a japanese string: 広告掲載 - ビジネス</chain>
13 </args>
14 </case>
15 <case name="ASCII Test">
16 <method>testChain</method>
17 <description>Test ASCII text saving.</description>
18 <args>
19 <oracle>data/ascii.txt</oracle>
20 <chain>This is a very basic string!</chain>
21 </args>
22 </case>
23</suite>
240
=== added directory 'gobby'
=== added file 'gobby/README'
--- gobby/README 1970-01-01 00:00:00 +0000
+++ gobby/README 2010-12-09 18:06:49 +0000
@@ -0,0 +1,17 @@
1gobby Tests
2---------------------
3Tests that verify gobby functionality.
4
5Safety
6------
7None of these tests touches any configuration or system files.
8
9Configuration
10-------------
11Nothing
12
13Available Tests
14---------------
15
16* about_dialog: runs the about dialog
17
018
=== added file 'gobby/gobby_basics.py'
--- gobby/gobby_basics.py 1970-01-01 00:00:00 +0000
+++ gobby/gobby_basics.py 2010-12-09 18:06:49 +0000
@@ -0,0 +1,13 @@
1# -*- coding: utf-8 -*-
2import os
3from time import time, gmtime, strftime
4
5from mago.test_suite.gobby import GobbyTestSuite
6
7class GobbyBasics(GobbyTestSuite):
8 def testAboutdialog(self, arg1=None):
9 self.application.runAboutdialog()
10
11if __name__ == "__main__":
12 gobby_test = GobbyBasics()
13 gobby_test.run()
014
=== added file 'gobby/gobby_basics.xml'
--- gobby/gobby_basics.xml 1970-01-01 00:00:00 +0000
+++ gobby/gobby_basics.xml 2010-12-09 18:06:49 +0000
@@ -0,0 +1,14 @@
1<?xml version="1.0"?>
2<suite name="Gobby">
3 <class>gobby_basics.GobbyBasics</class>
4 <description>
5 Tests which verify Gobby basics functionality.
6 </description>
7 <case name="about_dialog">
8 <method>testAboutdialog</method>
9 <description>Verify that the about dialog launches</description>
10 <args>
11 <arg1>Arg example</arg1>
12 </args>
13 </case>
14</suite>
015
=== added file 'mago/application/gobby.py'
--- mago/application/gobby.py 1970-01-01 00:00:00 +0000
+++ mago/application/gobby.py 2010-12-09 18:06:49 +0000
@@ -0,0 +1,83 @@
1PACKAGE = "mago"
2
3#-*- coding:utf-8 -*-
4"""
5This is the "gobby" module.
6
7This module provides a wrapper for LDTP to make writing Gobby tests easier.
8"""
9import ooldtp
10import ldtp
11import os
12from .main import Application
13from ..gconfwrapper import GConf
14from ..cmd import globals
15import time
16import gettext
17
18gettext.install (True)
19gettext.bindtextdomain (PACKAGE, globals.LOCALE_SHARE)
20gettext.textdomain (PACKAGE)
21t = gettext.translation(PACKAGE, globals.LOCALE_SHARE, fallback = True)
22_ = t.gettext
23
24
25class Gobby(Application):
26 """
27 gobby manages the Gobby application.
28 """
29
30 LAUNCHER = 'gobby'
31 LAUNCHER_ARGS = []
32 WINDOW = 'frmGobby'
33
34 MNU_ABOUT = _('mnuAbout')
35 MNU_CLOSE = _('mnuClose')
36 MNU_NEW = _('mnuNew')
37
38
39 def runAboutdialog(self):
40 """
41 This basic test simply verifies that the application launches
42 and that the UI reacts
43 The About dialog is the only menu that is always present in the UI
44 """
45 if self.MNU_ABOUT:
46 self.main_window.click(self.MNU_ABOUT)
47
48 # Wait for the dialog to open
49 # Name of about dialogs change with the app
50 timeout=60
51 dlgAbout=None
52 while not ( timeout>0 and dlgAbout):
53 dlgs=[ w for w in ldtp.getwindowlist() if w.startswith('dlgAbout')]
54 if dlgs:
55 dlgAbout = dlgs[0]
56 timeout -= 1
57 time.sleep(1)
58
59 if not dlgAbout:
60 raise AssertionError('About Dialog not found')
61
62
63 # Looking for a button to close the window
64 found = None
65 for btnClose in ('btnClose', 'btnOK', 'btnCancel'):
66 try:
67 found = ldtp.getchild(dlgAbout, btnClose, 'push button')
68 break
69 except:
70 pass
71
72 if not found:
73 return
74
75 ldtp.click(dlgAbout, btnClose)
76
77
78 def close(self):
79 self.main_window.click('mnuQuit')
80
81 def __init__(self):
82 Application.__init__(self)
83 self.main_window = ooldtp.context(self.WINDOW)
084
=== added file 'mago/test_suite/gobby.py'
--- mago/test_suite/gobby.py 1970-01-01 00:00:00 +0000
+++ mago/test_suite/gobby.py 2010-12-09 18:06:49 +0000
@@ -0,0 +1,20 @@
1"""
2This module contains the definition of the test suite for Gobby testing.
3"""
4import ldtp, ooldtp
5from .main import SingleApplicationTestSuite
6from ..application.gobby import Application, Gobby
7
8class GobbyTestSuite(SingleApplicationTestSuite):
9 """
10 Default test suite for Gobby
11 """
12 APPLICATION_FACTORY = Gobby
13 def setup(self):
14 self.application.open()
15
16 def teardown(self):
17 self.application.close()
18
19 def cleanup(self):
20 self.application.close()

Subscribers

People subscribed via source and target branches

to status/vote changes: