Merge lp:~mago-contributors/mago/mago-eog into lp:~mago-contributors/mago/mago-testsuite

Proposed by Patrick Wright
Status: Merged
Merged at revision: 21
Proposed branch: lp:~mago-contributors/mago/mago-eog
Merge into: lp:~mago-contributors/mago/mago-testsuite
Diff against target: 247 lines (+211/-8)
3 files modified
eog/test_eog.py (+188/-0)
software-center/tree.py (+6/-8)
tree.py (+17/-0)
To merge this branch: bzr merge lp:~mago-contributors/mago/mago-eog
Reviewer Review Type Date Requested Status
Mago Contributors Pending
Review via email: mp+54622@code.launchpad.net

Description of the change

Added Eye of Gnome Test Suite
- regression test for bug 730733
- still incomplete - test hacks were added until Mago launcher_args fix is committed

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'eog'
2=== added directory 'eog/data'
3=== added file 'eog/data/ubuntu01.jpg'
4Binary files eog/data/ubuntu01.jpg 1970-01-01 00:00:00 +0000 and eog/data/ubuntu01.jpg 2011-03-23 22:50:51 +0000 differ
5=== added file 'eog/test_eog.py'
6--- eog/test_eog.py 1970-01-01 00:00:00 +0000
7+++ eog/test_eog.py 2011-03-23 22:50:51 +0000
8@@ -0,0 +1,188 @@
9+# Copyright (C) 2011 Canonical Ltd
10+#
11+# This program is free software; you can redistribute it and/or modify
12+# it under the terms of the GNU General Public License as published by
13+# the Free Software Foundation; either version 2 of the License, or
14+# (at your option) any later version.
15+#
16+# This program is distributed in the hope that it will be useful,
17+# but WITHOUT ANY WARRANTY; without even the implied warranty of
18+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+# GNU General Public License for more details.
20+#
21+# You should have received a copy of the GNU General Public License
22+# along with this program; if not, write to the Free Software
23+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24+
25+"""
26+Eye of GNOME Test Suite
27+
28+pre-requisites:
29+ * install eog-plugins
30+ * Map plugin is not enabled
31+
32+"""
33+
34+from mago import TestCase
35+import unittest
36+import commands
37+import ldtp
38+import ooldtp
39+import os
40+
41+class TestEyeOfGnome(TestCase):
42+
43+ launcher = 'eog'
44+ img_path = os.path.join(os.path.dirname(__file__), 'data', 'ubuntu01.jpg')
45+ launcher_args = [img_path]
46+ #window_name = 'frmubuntu01.jpg'
47+ window_name = 'frm0' # TODO hack until JB's mago launcher_args fix is committed
48+
49+ dialog = {
50+ 'Preferences' : 'dlgEyeofGNOMEPreferences'
51+ }
52+ menu = {
53+ 'Preferences' : 'mnuPreferences'
54+ }
55+
56+ table = {
57+ 'ActivePlugins' : 'tblActivePlugins'
58+ }
59+
60+ pageTab = {
61+ 'Plugins' : 'ptabPlugins'
62+ }
63+
64+
65+ def test_bug730733(self):
66+ # TODO hack until JB's mago launcher_args fix is committed
67+ ldtp.click(self.window_name, 'mnu*ubuntu01*')
68+ self.window_name = 'frmubuntu01.jpg'
69+ ldtp.waittillguiexist(self.window_name)
70+ # end hack
71+
72+ ldtp.click(self.window_name, self.menu['Preferences'])
73+ ldtp.waittillguiexist(self.dialog['Preferences'])
74+ ldtp.mouseleftclick(self.dialog['Preferences'], self.pageTab['Plugins'])
75+
76+ # TODO I'd like to either see this partial match get added to LDTP
77+ # or refactor this to mago
78+ row = 0
79+ row_count = ldtp.getrowcount(self.dialog['Preferences'], self.table['ActivePlugins'])
80+ while row <= row_count:
81+ name = ldtp.getcellvalue(self.dialog['Preferences'], self.table['ActivePlugins'], row, 1)
82+ if 'Map' in name:
83+ ldtp.checkrow(self.dialog['Preferences'], self.table['ActivePlugins'], row)
84+ break
85+ row += 1
86+
87+ self.application.close()
88+ self.application.launch()
89+ self.application.close()
90+
91+if __name__ == "__main__":
92+ nose.main()
93+
94+#launcher = 'eog'
95+#launcher_args = []
96+#window_name = 'frmubuntu01*jpg'
97+
98+#btn10 = "btn10"
99+#btn11 = "btn11"
100+#btnClose = "btnClose"
101+#btnEditImage = "btnEditImage"
102+#btnFit = "btnFit"
103+#btnIn = "btnIn"
104+#btnLeft = "btnLeft"
105+#btnNext = "btnNext"
106+#btnNormal = "btnNormal"
107+#btnOut = "btnOut"
108+#btnPrevious = "btnPrevious"
109+#btnRight = "btnRight"
110+#ico0 = "ico0"
111+#mnu1ubuntu01jpg = "mnu1ubuntu01jpg"
112+#mnuAbout = "mnuAbout"
113+#mnuBestFit = "mnuBestFit"
114+#mnuClose = "mnuClose"
115+#mnuContents = "mnuContents"
116+#mnuEdit = "mnuEdit"
117+#mnuEmpty = "mnuEmpty"
118+#mnuEmpty1 = "mnuEmpty1"
119+#mnuEmpty2 = "mnuEmpty2"
120+#mnuEmpty3 = "mnuEmpty3"
121+#mnuEmpty4 = "mnuEmpty4"
122+#mnuEmpty5 = "mnuEmpty5"
123+#mnuEmpty6 = "mnuEmpty6"
124+#mnuFirefoxWebBrowser = "mnuFirefoxWebBrowser"
125+#mnuFirstImage = "mnuFirstImage"
126+#mnuFlickrUploader = "mnuFlickrUploader"
127+#mnuFlipHorizontal = "mnuFlipHorizontal"
128+#mnuFlipVertical = "mnuFlipVertical"
129+#mnuFullscreen = "mnuFullscreen"
130+#mnuGetHelpOnline = "mnuGetHelpOnline"
131+#mnuGo = "mnuGo"
132+#mnuHelp = "mnuHelp"
133+#mnuImage = "mnuImage"
134+#mnuImageCollection = "mnuImageCollection"
135+#mnuLastImage = "mnuLastImage"
136+#mnuMovetoTrash = "mnuMovetoTrash"
137+#mnuNextImage = "mnuNextImage"
138+#mnuNormalSize = "mnuNormalSize"
139+#mnuOpenwith = "mnuOpenwith"
140+#mnuOpen___ = "mnuOpen*"
141+#mnuPreferences = "mnuPreferences"
142+#mnuPreviousImage = "mnuPreviousImage"
143+#mnuPrint___ = "mnuPrint*"
144+#mnuProperties = "mnuProperties"
145+#mnuRandomImage = "mnuRandomImage"
146+#mnuReportaProblem = "mnuReportaProblem"
147+#mnuRotateClockwise = "mnuRotateClockwise"
148+#mnuRotateCounterclockwise = "mnuRotateCounterclockwise"
149+#mnuSave = "mnuSave"
150+#mnuSaveAs___ = "mnuSaveAs*"
151+#mnuSetasDesktopBackground = "mnuSetasDesktopBackground"
152+#mnuShotwellPhotoViewer = "mnuShotwellPhotoViewer"
153+#mnuSidePane = "mnuSidePane"
154+#mnuSlideshow = "mnuSlideshow"
155+#mnuStatusbar = "mnuStatusbar"
156+#mnuToolbar = "mnuToolbar"
157+#mnuToolbar1 = "mnuToolbar1"
158+#mnuTools = "mnuTools"
159+#mnuTranslateThisApplication = "mnuTranslateThisApplication"
160+#mnuUndo = "mnuUndo"
161+#mnuView = "mnuView"
162+#mnuZoomIn = "mnuZoomIn"
163+#mnuZoomOut = "mnuZoomOut"
164+#ptl0 = "ptl0"
165+#scbr0 = "scbr0"
166+#scbr1 = "scbr1"
167+#scbr2 = "scbr2"
168+#tbtn0 = "tbtn0"
169+
170+#launcher = 'eog'
171+#launcher_args = []
172+#window_name = 'dlgEyeofGNOMEPreferences'
173+
174+#btn0 = "btn0"
175+#btn1 = "btn1"
176+#btnAboutPlugin = "btnAboutPlugin"
177+#btnClose = "btnClose"
178+#btnConfigurePlugin = "btnConfigurePlugin"
179+#btnHelp = "btnHelp"
180+#chkAscustomcolor = "chkAscustomcolor"
181+#chkAutomaticorientation = "chkAutomaticorientation"
182+#chkExpandimagestofitscreen = "chkExpandimagestofitscreen"
183+#chkLoopsequence = "chkLoopsequence"
184+#chkSmoothimageswhenzoomed_in = "chkSmoothimageswhenzoomed-in"
185+#chkSmoothimageswhenzoomed_out = "chkSmoothimageswhenzoomed-out"
186+#ptabImageView = "ptabImageView"
187+#ptabPlugins = "ptabPlugins"
188+#ptabSlideshow = "ptabSlideshow"
189+#ptl0 = "ptl0"
190+#rbtnAsbackground = "rbtnAsbackground"
191+#rbtnAscheckpattern = "rbtnAscheckpattern"
192+#rbtnAscustomcolor = "rbtnAscustomcolor"
193+#sbtnSwitchimageafter = "sbtnSwitchimageafter"
194+#scbr0 = "scbr0"
195+#tblActivePlugins = "tblActivePlugins"
196+
197
198=== modified file 'software-center/tree.py'
199--- software-center/tree.py 2011-03-23 11:16:51 +0000
200+++ software-center/tree.py 2011-03-23 22:50:51 +0000
201@@ -1,8 +1,9 @@
202 import ldtp
203-
204-sc = "frmUbuntuSoftwareCenter"
205-
206-objs = sorted(ldtp.getobjectlist(sc))
207+import sys
208+
209+window = "%r" % sys.argv[1]
210+
211+objs = sorted(ldtp.getobjectlist(window))
212
213 for o in objs:
214 print "Object: %r" % o
215@@ -11,9 +12,6 @@
216 print "Properties"
217 for oi in oinfo:
218 #print oi
219- oprop = ldtp.getobjectproperty(sc, o, oi)
220+ oprop = ldtp.getobjectproperty(window, o, oi)
221 print "%r : %r" % (oi, oprop)
222 print "------------"
223-
224-
225-
226
227=== added file 'tree.py'
228--- tree.py 1970-01-01 00:00:00 +0000
229+++ tree.py 2011-03-23 22:50:51 +0000
230@@ -0,0 +1,17 @@
231+import ldtp
232+import sys
233+
234+window = "%s" % sys.argv[1]
235+
236+objs = sorted(ldtp.getobjectlist(window))
237+
238+for o in objs:
239+ print "Object: %r" % o
240+ oinfo = ldtp.getobjectinfo(window, o)
241+ #print oinfo
242+ print "Properties"
243+ for oi in oinfo:
244+ #print oi
245+ oprop = ldtp.getobjectproperty(window, o, oi)
246+ print "%r : %r" % (oi, oprop)
247+ print "------------"

Subscribers

People subscribed via source and target branches