Merge lp:~pedro/mago/gnome-terminal into lp:~mago-contributors/mago/mago-testsuite

Proposed by Pedro Villavicencio
Status: Merged
Merged at revision: 6
Proposed branch: lp:~pedro/mago/gnome-terminal
Merge into: lp:~mago-contributors/mago/mago-testsuite
Diff against target: 136 lines (+131/-0)
1 file modified
gnome-terminal/test_gnome-terminal.py (+131/-0)
To merge this branch: bzr merge lp:~pedro/mago/gnome-terminal
Reviewer Review Type Date Requested Status
Jean-Baptiste Lallement Approve
Review via email: mp+46654@code.launchpad.net

Description of the change

tests for gnome-terminal

To post a comment you must log in.
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

looks good. Thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'gnome-terminal'
=== added file 'gnome-terminal/test_gnome-terminal.py'
--- gnome-terminal/test_gnome-terminal.py 1970-01-01 00:00:00 +0000
+++ gnome-terminal/test_gnome-terminal.py 2011-01-18 18:56:28 +0000
@@ -0,0 +1,131 @@
1# Copyright (C) 2010 Canonical Ltd
2#
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation; either version 2 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program; if not, write to the Free Software
15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
17"""GNOME Terminal Test
18Test the Gnome terminal:
19 - Add a new profile.
20 - Delete a profile.
21 - Zoom out
22 - Zoom in
23 - Open tabs
24 - Close tabs
25
26To run it with:
27$ mago-ng <path_to_this_file>
28
29"""
30
31from mago import TestCase
32import unittest
33import ldtp
34import ooldtp
35
36TERMINAL = 'frm*@*'
37MNU_PROFILE = 'mnuProfile*'
38DLG_PROFILE = 'dlgProfiles'
39BTN_CLOSE = 'btnClose'
40BTN_NEWPROFILE = 'btnNew'
41DLG_NEWPROFILE = 'dlgNewProfile'
42TXT_PROFILENAME = 'txtProfilename'
43PROFILE_NAME = 'Prueba'
44BTN_CREATE = 'btnCreate'
45DLG_EDITINGPROFILE = 'dlgEditingProfile*'
46PROFILE_LIST = 'tblProfilelist'
47BTN_DELETE = 'btnDelete'
48DLG_QUESTION = 'dlgQuestion'
49ZOOM_OUT = 'mnuZoomOut'
50ZOOM_IN = 'mnuZoomIn'
51FULLSCREEN = 'mnuFullScreen'
52OPENTAB = 'mnuOpenTab'
53CLOSETAB = 'mnuCloseTab'
54
55class TerminalTests(TestCase):
56 launcher = 'gnome-terminal'
57 window_name = TERMINAL
58 setupOnce = True
59
60 def test_01_add_new_profile(self):
61 t = ooldtp.context(self.application.get_windowname(discover = True))
62 t.getchild(MNU_PROFILE).selectmenuitem()
63 ldtp.wait(2)
64 self.assertTrue(ldtp.guiexist(DLG_PROFILE))
65 p = ooldtp.context(DLG_PROFILE)
66 p.getchild(BTN_NEWPROFILE).click()
67
68 ldtp.waittillguiexist(DLG_NEWPROFILE)
69 np = ooldtp.context(DLG_NEWPROFILE)
70 np.getchild(TXT_PROFILENAME).settextvalue(PROFILE_NAME)
71 np.getchild(BTN_CREATE).click()
72 ldtp.waittillguiexist(DLG_EDITINGPROFILE)
73 ep = ooldtp.context(DLG_EDITINGPROFILE)
74 ep.getchild(BTN_CLOSE).click()
75 p.getchild(BTN_CLOSE).click()
76
77
78 def test_02_delete_profile(self):
79 t = ooldtp.context(self.application.get_windowname(discover = True))
80 t.getchild(MNU_PROFILE).selectmenuitem()
81 ldtp.wait(2)
82
83 self.assertTrue(ldtp.guiexist(DLG_PROFILE))
84
85 p = ooldtp.context(DLG_PROFILE)
86 pl = p.getchild(PROFILE_LIST)
87 self.assertTrue(pl.selectrowpartialmatch(PROFILE_NAME))
88 p.getchild(BTN_DELETE).click()
89
90 ldtp.waittillguiexist(DLG_QUESTION)
91
92 q = ooldtp.context(DLG_QUESTION)
93 q.getchild(BTN_DELETE).click()
94
95 p.getchild(BTN_CLOSE).click()
96
97 def test_03_zoom_out(self):
98 t = ooldtp.context(self.application.get_windowname(discover = True))
99 zoom = t.getchild(ZOOM_OUT)
100
101 while zoom.stateenabled():
102 zoom.selectmenuitem()
103 self.assertTrue(ldtp.guiexist(t))
104
105 def test_04_zoom_in(self):
106 t = ooldtp.context(self.application.get_windowname(discover = True))
107 zoom = t.getchild(ZOOM_IN)
108
109 while zoom.stateenabled():
110 zoom.selectmenuitem()
111
112 self.assertTrue(ldtp.guiexist(t))
113
114 def test_05_open_new_tabs(self):
115 t = ooldtp.context(self.application.get_windowname(discover = True))
116 tabs = t.getchild(OPENTAB)
117 t = 0
118 while t < 50:
119 tabs.selectmenuitem()
120 t+=1
121 self.assertTrue(ldtp.guiexist(t))
122
123 def test_06_close_tabs(self):
124 t = ooldtp.context(self.application.get_windowname(discover = True))
125 tabs = t.getchild(CLOSETAB)
126 while tabs.stateenabled():
127 tabs.selectmenuitem()
128 self.assertTrue(ldtp.guiexist(t))
129
130if __name__ == "__main__":
131 unittest.main()

Subscribers

People subscribed via source and target branches