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
=== added directory 'eog'
=== added directory 'eog/data'
=== added file 'eog/data/ubuntu01.jpg'
0Binary files eog/data/ubuntu01.jpg 1970-01-01 00:00:00 +0000 and eog/data/ubuntu01.jpg 2011-03-23 22:50:51 +0000 differ0Binary 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
=== added file 'eog/test_eog.py'
--- eog/test_eog.py 1970-01-01 00:00:00 +0000
+++ eog/test_eog.py 2011-03-23 22:50:51 +0000
@@ -0,0 +1,188 @@
1# Copyright (C) 2011 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"""
18Eye of GNOME Test Suite
19
20pre-requisites:
21 * install eog-plugins
22 * Map plugin is not enabled
23
24"""
25
26from mago import TestCase
27import unittest
28import commands
29import ldtp
30import ooldtp
31import os
32
33class TestEyeOfGnome(TestCase):
34
35 launcher = 'eog'
36 img_path = os.path.join(os.path.dirname(__file__), 'data', 'ubuntu01.jpg')
37 launcher_args = [img_path]
38 #window_name = 'frmubuntu01.jpg'
39 window_name = 'frm0' # TODO hack until JB's mago launcher_args fix is committed
40
41 dialog = {
42 'Preferences' : 'dlgEyeofGNOMEPreferences'
43 }
44 menu = {
45 'Preferences' : 'mnuPreferences'
46 }
47
48 table = {
49 'ActivePlugins' : 'tblActivePlugins'
50 }
51
52 pageTab = {
53 'Plugins' : 'ptabPlugins'
54 }
55
56
57 def test_bug730733(self):
58 # TODO hack until JB's mago launcher_args fix is committed
59 ldtp.click(self.window_name, 'mnu*ubuntu01*')
60 self.window_name = 'frmubuntu01.jpg'
61 ldtp.waittillguiexist(self.window_name)
62 # end hack
63
64 ldtp.click(self.window_name, self.menu['Preferences'])
65 ldtp.waittillguiexist(self.dialog['Preferences'])
66 ldtp.mouseleftclick(self.dialog['Preferences'], self.pageTab['Plugins'])
67
68 # TODO I'd like to either see this partial match get added to LDTP
69 # or refactor this to mago
70 row = 0
71 row_count = ldtp.getrowcount(self.dialog['Preferences'], self.table['ActivePlugins'])
72 while row <= row_count:
73 name = ldtp.getcellvalue(self.dialog['Preferences'], self.table['ActivePlugins'], row, 1)
74 if 'Map' in name:
75 ldtp.checkrow(self.dialog['Preferences'], self.table['ActivePlugins'], row)
76 break
77 row += 1
78
79 self.application.close()
80 self.application.launch()
81 self.application.close()
82
83if __name__ == "__main__":
84 nose.main()
85
86#launcher = 'eog'
87#launcher_args = []
88#window_name = 'frmubuntu01*jpg'
89
90#btn10 = "btn10"
91#btn11 = "btn11"
92#btnClose = "btnClose"
93#btnEditImage = "btnEditImage"
94#btnFit = "btnFit"
95#btnIn = "btnIn"
96#btnLeft = "btnLeft"
97#btnNext = "btnNext"
98#btnNormal = "btnNormal"
99#btnOut = "btnOut"
100#btnPrevious = "btnPrevious"
101#btnRight = "btnRight"
102#ico0 = "ico0"
103#mnu1ubuntu01jpg = "mnu1ubuntu01jpg"
104#mnuAbout = "mnuAbout"
105#mnuBestFit = "mnuBestFit"
106#mnuClose = "mnuClose"
107#mnuContents = "mnuContents"
108#mnuEdit = "mnuEdit"
109#mnuEmpty = "mnuEmpty"
110#mnuEmpty1 = "mnuEmpty1"
111#mnuEmpty2 = "mnuEmpty2"
112#mnuEmpty3 = "mnuEmpty3"
113#mnuEmpty4 = "mnuEmpty4"
114#mnuEmpty5 = "mnuEmpty5"
115#mnuEmpty6 = "mnuEmpty6"
116#mnuFirefoxWebBrowser = "mnuFirefoxWebBrowser"
117#mnuFirstImage = "mnuFirstImage"
118#mnuFlickrUploader = "mnuFlickrUploader"
119#mnuFlipHorizontal = "mnuFlipHorizontal"
120#mnuFlipVertical = "mnuFlipVertical"
121#mnuFullscreen = "mnuFullscreen"
122#mnuGetHelpOnline = "mnuGetHelpOnline"
123#mnuGo = "mnuGo"
124#mnuHelp = "mnuHelp"
125#mnuImage = "mnuImage"
126#mnuImageCollection = "mnuImageCollection"
127#mnuLastImage = "mnuLastImage"
128#mnuMovetoTrash = "mnuMovetoTrash"
129#mnuNextImage = "mnuNextImage"
130#mnuNormalSize = "mnuNormalSize"
131#mnuOpenwith = "mnuOpenwith"
132#mnuOpen___ = "mnuOpen*"
133#mnuPreferences = "mnuPreferences"
134#mnuPreviousImage = "mnuPreviousImage"
135#mnuPrint___ = "mnuPrint*"
136#mnuProperties = "mnuProperties"
137#mnuRandomImage = "mnuRandomImage"
138#mnuReportaProblem = "mnuReportaProblem"
139#mnuRotateClockwise = "mnuRotateClockwise"
140#mnuRotateCounterclockwise = "mnuRotateCounterclockwise"
141#mnuSave = "mnuSave"
142#mnuSaveAs___ = "mnuSaveAs*"
143#mnuSetasDesktopBackground = "mnuSetasDesktopBackground"
144#mnuShotwellPhotoViewer = "mnuShotwellPhotoViewer"
145#mnuSidePane = "mnuSidePane"
146#mnuSlideshow = "mnuSlideshow"
147#mnuStatusbar = "mnuStatusbar"
148#mnuToolbar = "mnuToolbar"
149#mnuToolbar1 = "mnuToolbar1"
150#mnuTools = "mnuTools"
151#mnuTranslateThisApplication = "mnuTranslateThisApplication"
152#mnuUndo = "mnuUndo"
153#mnuView = "mnuView"
154#mnuZoomIn = "mnuZoomIn"
155#mnuZoomOut = "mnuZoomOut"
156#ptl0 = "ptl0"
157#scbr0 = "scbr0"
158#scbr1 = "scbr1"
159#scbr2 = "scbr2"
160#tbtn0 = "tbtn0"
161
162#launcher = 'eog'
163#launcher_args = []
164#window_name = 'dlgEyeofGNOMEPreferences'
165
166#btn0 = "btn0"
167#btn1 = "btn1"
168#btnAboutPlugin = "btnAboutPlugin"
169#btnClose = "btnClose"
170#btnConfigurePlugin = "btnConfigurePlugin"
171#btnHelp = "btnHelp"
172#chkAscustomcolor = "chkAscustomcolor"
173#chkAutomaticorientation = "chkAutomaticorientation"
174#chkExpandimagestofitscreen = "chkExpandimagestofitscreen"
175#chkLoopsequence = "chkLoopsequence"
176#chkSmoothimageswhenzoomed_in = "chkSmoothimageswhenzoomed-in"
177#chkSmoothimageswhenzoomed_out = "chkSmoothimageswhenzoomed-out"
178#ptabImageView = "ptabImageView"
179#ptabPlugins = "ptabPlugins"
180#ptabSlideshow = "ptabSlideshow"
181#ptl0 = "ptl0"
182#rbtnAsbackground = "rbtnAsbackground"
183#rbtnAscheckpattern = "rbtnAscheckpattern"
184#rbtnAscustomcolor = "rbtnAscustomcolor"
185#sbtnSwitchimageafter = "sbtnSwitchimageafter"
186#scbr0 = "scbr0"
187#tblActivePlugins = "tblActivePlugins"
188
0189
=== modified file 'software-center/tree.py'
--- software-center/tree.py 2011-03-23 11:16:51 +0000
+++ software-center/tree.py 2011-03-23 22:50:51 +0000
@@ -1,8 +1,9 @@
1import ldtp1import ldtp
22import sys
3sc = "frmUbuntuSoftwareCenter"3
44window = "%r" % sys.argv[1]
5objs = sorted(ldtp.getobjectlist(sc))5
6objs = sorted(ldtp.getobjectlist(window))
67
7for o in objs:8for o in objs:
8 print "Object: %r" % o9 print "Object: %r" % o
@@ -11,9 +12,6 @@
11 print "Properties"12 print "Properties"
12 for oi in oinfo:13 for oi in oinfo:
13 #print oi14 #print oi
14 oprop = ldtp.getobjectproperty(sc, o, oi)15 oprop = ldtp.getobjectproperty(window, o, oi)
15 print "%r : %r" % (oi, oprop) 16 print "%r : %r" % (oi, oprop)
16 print "------------"17 print "------------"
17
18
19
2018
=== added file 'tree.py'
--- tree.py 1970-01-01 00:00:00 +0000
+++ tree.py 2011-03-23 22:50:51 +0000
@@ -0,0 +1,17 @@
1import ldtp
2import sys
3
4window = "%s" % sys.argv[1]
5
6objs = sorted(ldtp.getobjectlist(window))
7
8for o in objs:
9 print "Object: %r" % o
10 oinfo = ldtp.getobjectinfo(window, o)
11 #print oinfo
12 print "Properties"
13 for oi in oinfo:
14 #print oi
15 oprop = ldtp.getobjectproperty(window, o, oi)
16 print "%r : %r" % (oi, oprop)
17 print "------------"

Subscribers

People subscribed via source and target branches