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

Subscribers

People subscribed via source and target branches