Merge lp:~lderan/ubuntu-autopilot-tests/ubuntu-autopilot-tests into lp:ubuntu-autopilot-tests
- ubuntu-autopilot-tests
- Merge into trunk
Status: | Needs review |
---|---|
Proposed branch: | lp:~lderan/ubuntu-autopilot-tests/ubuntu-autopilot-tests |
Merge into: | lp:ubuntu-autopilot-tests |
Diff against target: |
1649 lines (+1350/-3) 52 files modified
xubuntu_autopilot_tests/abiword/__init__.py (+2/-0) xubuntu_autopilot_tests/abiword/test_abiword.py (+65/-0) xubuntu_autopilot_tests/catfish/__init__.py (+2/-0) xubuntu_autopilot_tests/catfish/test_catfish.py (+51/-0) xubuntu_autopilot_tests/evince/__init__.py (+2/-0) xubuntu_autopilot_tests/evince/test_evince.py (+51/-0) xubuntu_autopilot_tests/file-roller/__init__.py (+2/-0) xubuntu_autopilot_tests/file-roller/test_file_roller.py (+51/-0) xubuntu_autopilot_tests/gmusicbrowser/__init__.py (+2/-0) xubuntu_autopilot_tests/gmusicbrowser/test_gmusicbrowser.py (+51/-0) xubuntu_autopilot_tests/gnome-calculator/__init__.py (+2/-0) xubuntu_autopilot_tests/gnome-calculator/test_gnome_calculator.py (+51/-0) xubuntu_autopilot_tests/gnumeric/__init__.py (+2/-0) xubuntu_autopilot_tests/gnumeric/test_gnumeric.py (+51/-0) xubuntu_autopilot_tests/gthumb/__init__.py (+2/-0) xubuntu_autopilot_tests/gthumb/test_gthumb.py (+51/-0) xubuntu_autopilot_tests/gucharmap/__init__.py (+2/-0) xubuntu_autopilot_tests/gucharmap/test_gucharmap.py (+51/-0) xubuntu_autopilot_tests/mousepad/__init__.py (+2/-0) xubuntu_autopilot_tests/mousepad/test_mousepad.py (+51/-0) xubuntu_autopilot_tests/onboard/__init__.py (+2/-0) xubuntu_autopilot_tests/onboard/test_onboard.py (+51/-0) xubuntu_autopilot_tests/orage-calendar/__init__.py (+2/-0) xubuntu_autopilot_tests/orage-calendar/test_orage_calendar.py (+51/-0) xubuntu_autopilot_tests/orage-globaltime/__init__.py (+2/-0) xubuntu_autopilot_tests/orage-globaltime/test_orage_globaltime.py (+51/-0) xubuntu_autopilot_tests/pavucontrol/__init__.py (+2/-0) xubuntu_autopilot_tests/pavucontrol/test_pavucontrol.py (+51/-0) xubuntu_autopilot_tests/pidgin/__init__.py (+2/-0) xubuntu_autopilot_tests/pidgin/test_pidgin.py (+51/-0) xubuntu_autopilot_tests/ristretto/__init__.py (+2/-0) xubuntu_autopilot_tests/ristretto/test_ristretto.py (+51/-0) xubuntu_autopilot_tests/simple-scan/__init__.py (+2/-0) xubuntu_autopilot_tests/simple-scan/test_simple_scan.py (+50/-0) xubuntu_autopilot_tests/sudoku/__init__.py (+2/-0) xubuntu_autopilot_tests/sudoku/test_sudoku.py (+49/-0) xubuntu_autopilot_tests/thunderbird/__init__.py (+2/-0) xubuntu_autopilot_tests/thunderbird/test_thunderbird.py (+49/-0) xubuntu_autopilot_tests/transmission-gtk/__init__.py (+2/-0) xubuntu_autopilot_tests/transmission-gtk/test_transmission_gtk.py (+49/-0) xubuntu_autopilot_tests/xfce4-appfinder/__init__.py (+2/-0) xubuntu_autopilot_tests/xfce4-appfinder/test_xfce4_appfinder.py (+51/-0) xubuntu_autopilot_tests/xfce4-dict/__init__.py (+2/-0) xubuntu_autopilot_tests/xfce4-dict/test_xfce4_dict.py (+51/-0) xubuntu_autopilot_tests/xfce4-screenshooter/__init__.py (+2/-0) xubuntu_autopilot_tests/xfce4-screenshooter/test_xfce4_screenshooter.py (+51/-0) xubuntu_autopilot_tests/xfce4-settings-manager/__init__.py (+2/-0) xubuntu_autopilot_tests/xfce4-settings-manager/test_xfce4_settings_manager.py (+66/-0) xubuntu_autopilot_tests/xfce4-taskmanager/__init__.py (+2/-0) xubuntu_autopilot_tests/xfce4-taskmanager/test_xfce4_taskmanager.py (+51/-0) xubuntu_autopilot_tests/xfce4-terminal/__init__.py (+1/-1) xubuntu_autopilot_tests/xfce4-terminal/test_terminal.py (+2/-2) |
To merge this branch: | bzr merge lp:~lderan/ubuntu-autopilot-tests/ubuntu-autopilot-tests |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Nicholas Skaggs (community) | Needs Fixing | ||
Review via email:
|
Commit message
Description of the change
Added simple tests for Sudoku and gThumb to the Xubuntu Autopilot tests
- 66. By Thomas Molloy
-
Added Simple-scan test to Xubuntu tests
- 67. By Thomas Molloy
-
gmusicbrowser simple test for Xubuntu
- 68. By Thomas Molloy
-
Added Ristretto Image Viewer test to the Xubuntu test directory

Thomas Molloy (lderan) wrote : | # |
The __init__ must of come from my copying and pasting the terminal app folder to make the others, my apologies. Shall fix this as soon as I can. and try to expand on the tests before submitting another MP.

Thomas Molloy (lderan) wrote : | # |
> In the gmusicbrowser test;
>
> I take it you want the window to be the only one?
> windows = self.app.
> self.assertTrue
Yes, that is correct
> This is ok, but note that mainWindow.title will never change as it's already
> set (well, the app could change it, but I don't think that's what we're
> looking for here :-) ) I'm not exactly sure you need the eventually here, but
> if so you should ensure you get the window as part of the lambda function.
> mainWindow = windows[0]
> self.assertThat
> Eventually(
Okay shall approach it differently :)
> Reviewing several apps at once is a bit hard; ideally split these up in the
> future :-)
Yup will do, I can get rid of this mp and do each on individually.
- 69. By Thomas Molloy
-
fixes for the xubuntu tests
- 70. By Thomas Molloy
-
working tests, need to be individually merged and if possible improved before doing so
Unmerged revisions
- 70. By Thomas Molloy
-
working tests, need to be individually merged and if possible improved before doing so
- 69. By Thomas Molloy
-
fixes for the xubuntu tests
- 68. By Thomas Molloy
-
Added Ristretto Image Viewer test to the Xubuntu test directory
- 67. By Thomas Molloy
-
gmusicbrowser simple test for Xubuntu
- 66. By Thomas Molloy
-
Added Simple-scan test to Xubuntu tests
- 65. By Thomas Molloy
-
Corrected the gThumb test text
- 64. By Thomas Molloy
-
Added simple tests for Sudoku and gThumb to the Xubuntu Autopilot tests
Preview Diff
1 | === added directory 'xubuntu_autopilot_tests/abiword' |
2 | === added file 'xubuntu_autopilot_tests/abiword/__init__.py' |
3 | --- xubuntu_autopilot_tests/abiword/__init__.py 1970-01-01 00:00:00 +0000 |
4 | +++ xubuntu_autopilot_tests/abiword/__init__.py 2014-03-30 18:20:04 +0000 |
5 | @@ -0,0 +1,2 @@ |
6 | +# -*- coding: utf-8 -*- |
7 | + |
8 | |
9 | === added file 'xubuntu_autopilot_tests/abiword/test_abiword.py' |
10 | --- xubuntu_autopilot_tests/abiword/test_abiword.py 1970-01-01 00:00:00 +0000 |
11 | +++ xubuntu_autopilot_tests/abiword/test_abiword.py 2014-03-30 18:20:04 +0000 |
12 | @@ -0,0 +1,65 @@ |
13 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
14 | +# |
15 | +# Copyright (C) 2014 |
16 | +# |
17 | +# Author: Thomas Molloy beetyrootey@gmail.com |
18 | +# |
19 | +# This program is free software; you can redistribute it and/or modify |
20 | +# it under the terms of the GNU Lesser General Public License as published by |
21 | +# the Free Software Foundation; version 3. |
22 | +# |
23 | +# This program is distributed in the hope that it will be useful, |
24 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
25 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
26 | +# GNU Lesser General Public License for more details. |
27 | +# |
28 | +# You should have received a copy of the GNU Lesser General Public License |
29 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
30 | +import os |
31 | +from autopilot.matchers import Eventually |
32 | +from testtools.matchers import Equals, Contains |
33 | +from autopilot.testcase import AutopilotTestCase |
34 | +from autopilot.process import ProcessManager |
35 | +from testtools.matchers import Equals, Contains, FileExists, DirExists, \ |
36 | + DirContains |
37 | + |
38 | +# register abiword app |
39 | +ProcessManager.register_known_application( |
40 | + "abiword", |
41 | + "abiword.desktop", |
42 | + "abiword") |
43 | + |
44 | +class AbiwordWindowTests(AutopilotTestCase): |
45 | + """ Window tests for the xfce4-screenshooter """ |
46 | + |
47 | + def setUp(self): |
48 | + """ Basic setup instruction to run before each test """ |
49 | + super(AbiwordWindowTests, self).setUp() |
50 | + self.manager = ProcessManager.create('BAMF') |
51 | + self.app = self.manager.start_app("abiword") |
52 | + # This will make sure Screenshooter window you launched is focused and ready |
53 | + # to accept your keyboard input |
54 | + self.assertTrue(self.app.is_active) |
55 | + |
56 | + def test_window_visible(self): |
57 | + """ Check to see if the main window has the proper title """ |
58 | + windows = self.app.get_windows() |
59 | + window = windows[0] |
60 | + |
61 | + # We must assert the window title = Untitled1 |
62 | + # It fails with assertTrue(self.app.is_focused) |
63 | + self.assertThat(lambda: window.title, Eventually(Contains('Untitled1'))) |
64 | + |
65 | + for window in windows: |
66 | + window.close() |
67 | + |
68 | + def test_file_saving(self): |
69 | + self.keyboard.press_and_release('Ctrl+Shift+s') |
70 | + self.keyboard.type("/tmp/") |
71 | + self.keyboard.press_and_release('Enter') |
72 | + self.keyboard.type("test-file") |
73 | + self.keyboard.press_and_release('Enter') |
74 | + # Verify that test-file has been created |
75 | + self.assertThat(lambda: '/tmp/test-file.abw', Eventually(FileExists())) |
76 | + # Delete the file we created |
77 | + self.addCleanup(os.remove, "/tmp/test-file.abw") |
78 | |
79 | === added directory 'xubuntu_autopilot_tests/catfish' |
80 | === added file 'xubuntu_autopilot_tests/catfish/__init__.py' |
81 | --- xubuntu_autopilot_tests/catfish/__init__.py 1970-01-01 00:00:00 +0000 |
82 | +++ xubuntu_autopilot_tests/catfish/__init__.py 2014-03-30 18:20:04 +0000 |
83 | @@ -0,0 +1,2 @@ |
84 | +# -*- coding: utf-8 -*- |
85 | + |
86 | |
87 | === added file 'xubuntu_autopilot_tests/catfish/test_catfish.py' |
88 | --- xubuntu_autopilot_tests/catfish/test_catfish.py 1970-01-01 00:00:00 +0000 |
89 | +++ xubuntu_autopilot_tests/catfish/test_catfish.py 2014-03-30 18:20:04 +0000 |
90 | @@ -0,0 +1,51 @@ |
91 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
92 | +# |
93 | +# Copyright (C) 2014 |
94 | +# |
95 | +# Author: Thomas Molloy beetyrootey@gmail.com |
96 | +# |
97 | +# This program is free software; you can redistribute it and/or modify |
98 | +# it under the terms of the GNU Lesser General Public License as published by |
99 | +# the Free Software Foundation; version 3. |
100 | +# |
101 | +# This program is distributed in the hope that it will be useful, |
102 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
103 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
104 | +# GNU Lesser General Public License for more details. |
105 | +# |
106 | +# You should have received a copy of the GNU Lesser General Public License |
107 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
108 | +from autopilot.matchers import Eventually |
109 | +from testtools.matchers import Equals, Contains |
110 | +from autopilot.testcase import AutopilotTestCase |
111 | +from autopilot.process import ProcessManager |
112 | + |
113 | +# register catfish app |
114 | +ProcessManager.register_known_application( |
115 | + "catfish", |
116 | + "catfish.desktop", |
117 | + "catfish") |
118 | + |
119 | +class CatfishWindowTests(AutopilotTestCase): |
120 | + """ Window tests for the xfce4-screenshooter """ |
121 | + |
122 | + def setUp(self): |
123 | + """ Basic setup instruction to run before each test """ |
124 | + super(CatfishWindowTests, self).setUp() |
125 | + self.manager = ProcessManager.create('BAMF') |
126 | + self.app = self.manager.start_app("catfish") |
127 | + # This will make sure Screenshooter window you launched is focused and ready |
128 | + # to accept your keyboard input |
129 | + self.assertTrue(self.app.is_active) |
130 | + |
131 | + def test_window_visible(self): |
132 | + """ Check to see if the main window has the proper title """ |
133 | + windows = self.app.get_windows() |
134 | + window = windows[0] |
135 | + |
136 | + # We must assert the window title = Catfish |
137 | + # It fails with assertTrue(self.app.is_focused) |
138 | + self.assertThat(lambda: window.title, Eventually(Contains('Catfish'))) |
139 | + |
140 | + for window in windows: |
141 | + window.close() |
142 | |
143 | === added directory 'xubuntu_autopilot_tests/evince' |
144 | === added file 'xubuntu_autopilot_tests/evince/__init__.py' |
145 | --- xubuntu_autopilot_tests/evince/__init__.py 1970-01-01 00:00:00 +0000 |
146 | +++ xubuntu_autopilot_tests/evince/__init__.py 2014-03-30 18:20:04 +0000 |
147 | @@ -0,0 +1,2 @@ |
148 | +# -*- coding: utf-8 -*- |
149 | + |
150 | |
151 | === added file 'xubuntu_autopilot_tests/evince/test_evince.py' |
152 | --- xubuntu_autopilot_tests/evince/test_evince.py 1970-01-01 00:00:00 +0000 |
153 | +++ xubuntu_autopilot_tests/evince/test_evince.py 2014-03-30 18:20:04 +0000 |
154 | @@ -0,0 +1,51 @@ |
155 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
156 | +# |
157 | +# Copyright (C) 2014 |
158 | +# |
159 | +# Author: Thomas Molloy beetyrootey@gmail.com |
160 | +# |
161 | +# This program is free software; you can redistribute it and/or modify |
162 | +# it under the terms of the GNU Lesser General Public License as published by |
163 | +# the Free Software Foundation; version 3. |
164 | +# |
165 | +# This program is distributed in the hope that it will be useful, |
166 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
167 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
168 | +# GNU Lesser General Public License for more details. |
169 | +# |
170 | +# You should have received a copy of the GNU Lesser General Public License |
171 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
172 | +from autopilot.matchers import Eventually |
173 | +from testtools.matchers import Equals, Contains |
174 | +from autopilot.testcase import AutopilotTestCase |
175 | +from autopilot.process import ProcessManager |
176 | + |
177 | +# register evince app |
178 | +ProcessManager.register_known_application( |
179 | + "evince", |
180 | + "evince.desktop", |
181 | + "evince") |
182 | + |
183 | +class EvinceWindowTests(AutopilotTestCase): |
184 | + """ Window tests for the xfce4-screenshooter """ |
185 | + |
186 | + def setUp(self): |
187 | + """ Basic setup instruction to run before each test """ |
188 | + super(EvinceWindowTests, self).setUp() |
189 | + self.manager = ProcessManager.create('BAMF') |
190 | + self.app = self.manager.start_app("evince") |
191 | + # This will make sure Screenshooter window you launched is focused and ready |
192 | + # to accept your keyboard input |
193 | + self.assertTrue(self.app.is_active) |
194 | + |
195 | + def test_window_visible(self): |
196 | + """ Check to see if the main window has the proper title """ |
197 | + windows = self.app.get_windows() |
198 | + window = windows[0] |
199 | + |
200 | + # We must assert the window title = Document Viewer |
201 | + # It fails with assertTrue(self.app.is_focused) |
202 | + self.assertThat(lambda: window.title, Eventually(Contains('Document Viewer'))) |
203 | + |
204 | + for window in windows: |
205 | + window.close() |
206 | |
207 | === added directory 'xubuntu_autopilot_tests/file-roller' |
208 | === added file 'xubuntu_autopilot_tests/file-roller/__init__.py' |
209 | --- xubuntu_autopilot_tests/file-roller/__init__.py 1970-01-01 00:00:00 +0000 |
210 | +++ xubuntu_autopilot_tests/file-roller/__init__.py 2014-03-30 18:20:04 +0000 |
211 | @@ -0,0 +1,2 @@ |
212 | +# -*- coding: utf-8 -*- |
213 | + |
214 | |
215 | === added file 'xubuntu_autopilot_tests/file-roller/test_file_roller.py' |
216 | --- xubuntu_autopilot_tests/file-roller/test_file_roller.py 1970-01-01 00:00:00 +0000 |
217 | +++ xubuntu_autopilot_tests/file-roller/test_file_roller.py 2014-03-30 18:20:04 +0000 |
218 | @@ -0,0 +1,51 @@ |
219 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
220 | +# |
221 | +# Copyright (C) 2014 |
222 | +# |
223 | +# Author: Thomas Molloy beetyrootey@gmail.com |
224 | +# |
225 | +# This program is free software; you can redistribute it and/or modify |
226 | +# it under the terms of the GNU Lesser General Public License as published by |
227 | +# the Free Software Foundation; version 3. |
228 | +# |
229 | +# This program is distributed in the hope that it will be useful, |
230 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
231 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
232 | +# GNU Lesser General Public License for more details. |
233 | +# |
234 | +# You should have received a copy of the GNU Lesser General Public License |
235 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
236 | +from autopilot.matchers import Eventually |
237 | +from testtools.matchers import Equals, Contains |
238 | +from autopilot.testcase import AutopilotTestCase |
239 | +from autopilot.process import ProcessManager |
240 | + |
241 | +# register file-roller app |
242 | +ProcessManager.register_known_application( |
243 | + "file-roller", |
244 | + "file-roller.desktop", |
245 | + "file-roller") |
246 | + |
247 | +class FileRollerWindowTests(AutopilotTestCase): |
248 | + """ Window tests for the xfce4-screenshooter """ |
249 | + |
250 | + def setUp(self): |
251 | + """ Basic setup instruction to run before each test """ |
252 | + super(FileRollerWindowTests, self).setUp() |
253 | + self.manager = ProcessManager.create('BAMF') |
254 | + self.app = self.manager.start_app("file-roller") |
255 | + # This will make sure Screenshooter window you launched is focused and ready |
256 | + # to accept your keyboard input |
257 | + self.assertTrue(self.app.is_active) |
258 | + |
259 | + def test_window_visible(self): |
260 | + """ Check to see if the main window has the proper title """ |
261 | + windows = self.app.get_windows() |
262 | + window = windows[0] |
263 | + |
264 | + # We must assert the window title = Archive Manager |
265 | + # It fails with assertTrue(self.app.is_focused) |
266 | + self.assertThat(lambda: window.title, Eventually(Contains('Archive Manager'))) |
267 | + |
268 | + for window in windows: |
269 | + window.close() |
270 | |
271 | === added directory 'xubuntu_autopilot_tests/gmusicbrowser' |
272 | === added file 'xubuntu_autopilot_tests/gmusicbrowser/__init__.py' |
273 | --- xubuntu_autopilot_tests/gmusicbrowser/__init__.py 1970-01-01 00:00:00 +0000 |
274 | +++ xubuntu_autopilot_tests/gmusicbrowser/__init__.py 2014-03-30 18:20:04 +0000 |
275 | @@ -0,0 +1,2 @@ |
276 | +# -*- coding: utf-8 -*- |
277 | + |
278 | |
279 | === added file 'xubuntu_autopilot_tests/gmusicbrowser/test_gmusicbrowser.py' |
280 | --- xubuntu_autopilot_tests/gmusicbrowser/test_gmusicbrowser.py 1970-01-01 00:00:00 +0000 |
281 | +++ xubuntu_autopilot_tests/gmusicbrowser/test_gmusicbrowser.py 2014-03-30 18:20:04 +0000 |
282 | @@ -0,0 +1,51 @@ |
283 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
284 | +# |
285 | +# Copyright (C) 2014 |
286 | +# |
287 | +# Author: Thomas Molloy beetyrootey@gmail.com |
288 | +# |
289 | +# This program is free software; you can redistribute it and/or modify |
290 | +# it under the terms of the GNU Lesser General Public License as published by |
291 | +# the Free Software Foundation; version 3. |
292 | +# |
293 | +# This program is distributed in the hope that it will be useful, |
294 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
295 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
296 | +# GNU Lesser General Public License for more details. |
297 | +# |
298 | +# You should have received a copy of the GNU Lesser General Public License |
299 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
300 | + |
301 | +from autopilot.matchers import Eventually |
302 | +from testtools.matchers import Equals, Contains |
303 | +from autopilot.testcase import AutopilotTestCase |
304 | +from autopilot.process import ProcessManager |
305 | + |
306 | +# register gmusicbrowser app |
307 | +ProcessManager.register_known_application( |
308 | + "gmusicbrowser", |
309 | + "gmusicbrowser.desktop", |
310 | + "gmusicbrowser") |
311 | + |
312 | +class GMusicBrowserWindowTests(AutopilotTestCase): |
313 | + """ Window tests for the game Simple scan """ |
314 | + |
315 | + def setUp(self): |
316 | + """ Basic setup instruction to run before each test """ |
317 | + super(GMusicBrowserWindowTests, self).setUp() |
318 | + self.manager = ProcessManager.create('BAMF') |
319 | + self.app = self.manager.start_app("gmusicbrowser") |
320 | + # This will make sure Sudoku window you launched is focused and ready |
321 | + # to accept your keyboard input |
322 | + self.assertTrue(self.app.is_active) |
323 | + |
324 | + def test_window_visible(self): |
325 | + """ Basic test to see if the window opens with the correct name """ |
326 | + # We must assert the window title = gmusicbrowser here to keep focus of gmusicbrowser |
327 | + # It fails with assertTrue(self.app.is_focused) |
328 | + windows = self.app.get_windows() |
329 | + self.assertTrue(len(windows) == 1) |
330 | + mainWindow = windows[0] |
331 | + self.assertThat(lambda: mainWindow.title, Eventually(Contains('gmusicbrowser'))) |
332 | + # We must close the window else the test fails as it is unable to close it automatically |
333 | + mainWindow.close() |
334 | |
335 | === added directory 'xubuntu_autopilot_tests/gnome-calculator' |
336 | === added file 'xubuntu_autopilot_tests/gnome-calculator/__init__.py' |
337 | --- xubuntu_autopilot_tests/gnome-calculator/__init__.py 1970-01-01 00:00:00 +0000 |
338 | +++ xubuntu_autopilot_tests/gnome-calculator/__init__.py 2014-03-30 18:20:04 +0000 |
339 | @@ -0,0 +1,2 @@ |
340 | +# -*- coding: utf-8 -*- |
341 | + |
342 | |
343 | === added file 'xubuntu_autopilot_tests/gnome-calculator/test_gnome_calculator.py' |
344 | --- xubuntu_autopilot_tests/gnome-calculator/test_gnome_calculator.py 1970-01-01 00:00:00 +0000 |
345 | +++ xubuntu_autopilot_tests/gnome-calculator/test_gnome_calculator.py 2014-03-30 18:20:04 +0000 |
346 | @@ -0,0 +1,51 @@ |
347 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
348 | +# |
349 | +# Copyright (C) 2014 |
350 | +# |
351 | +# Author: Thomas Molloy beetyrootey@gmail.com |
352 | +# |
353 | +# This program is free software; you can redistribute it and/or modify |
354 | +# it under the terms of the GNU Lesser General Public License as published by |
355 | +# the Free Software Foundation; version 3. |
356 | +# |
357 | +# This program is distributed in the hope that it will be useful, |
358 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
359 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
360 | +# GNU Lesser General Public License for more details. |
361 | +# |
362 | +# You should have received a copy of the GNU Lesser General Public License |
363 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
364 | +from autopilot.matchers import Eventually |
365 | +from testtools.matchers import Equals, Contains |
366 | +from autopilot.testcase import AutopilotTestCase |
367 | +from autopilot.process import ProcessManager |
368 | + |
369 | +# register gnome-calculator app |
370 | +ProcessManager.register_known_application( |
371 | + "gnome-calculator", |
372 | + "gnome-calculator.desktop", |
373 | + "gnome-calculator") |
374 | + |
375 | +class GnomeCalculatorWindowTests(AutopilotTestCase): |
376 | + """ Window tests for the xfce4-screenshooter """ |
377 | + |
378 | + def setUp(self): |
379 | + """ Basic setup instruction to run before each test """ |
380 | + super(GnomeCalculatorWindowTests, self).setUp() |
381 | + self.manager = ProcessManager.create('BAMF') |
382 | + self.app = self.manager.start_app("gnome-calculator") |
383 | + # This will make sure Screenshooter window you launched is focused and ready |
384 | + # to accept your keyboard input |
385 | + self.assertTrue(self.app.is_active) |
386 | + |
387 | + def test_window_visible(self): |
388 | + """ Check to see if the main window has the proper title """ |
389 | + windows = self.app.get_windows() |
390 | + window = windows[0] |
391 | + |
392 | + # We must assert the window title = Calculator |
393 | + # It fails with assertTrue(self.app.is_focused) |
394 | + self.assertThat(lambda: window.title, Eventually(Contains('Calculator'))) |
395 | + |
396 | + for window in windows: |
397 | + window.close() |
398 | |
399 | === added directory 'xubuntu_autopilot_tests/gnumeric' |
400 | === added file 'xubuntu_autopilot_tests/gnumeric/__init__.py' |
401 | --- xubuntu_autopilot_tests/gnumeric/__init__.py 1970-01-01 00:00:00 +0000 |
402 | +++ xubuntu_autopilot_tests/gnumeric/__init__.py 2014-03-30 18:20:04 +0000 |
403 | @@ -0,0 +1,2 @@ |
404 | +# -*- coding: utf-8 -*- |
405 | + |
406 | |
407 | === added file 'xubuntu_autopilot_tests/gnumeric/test_gnumeric.py' |
408 | --- xubuntu_autopilot_tests/gnumeric/test_gnumeric.py 1970-01-01 00:00:00 +0000 |
409 | +++ xubuntu_autopilot_tests/gnumeric/test_gnumeric.py 2014-03-30 18:20:04 +0000 |
410 | @@ -0,0 +1,51 @@ |
411 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
412 | +# |
413 | +# Copyright (C) 2014 |
414 | +# |
415 | +# Author: Thomas Molloy beetyrootey@gmail.com |
416 | +# |
417 | +# This program is free software; you can redistribute it and/or modify |
418 | +# it under the terms of the GNU Lesser General Public License as published by |
419 | +# the Free Software Foundation; version 3. |
420 | +# |
421 | +# This program is distributed in the hope that it will be useful, |
422 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
423 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
424 | +# GNU Lesser General Public License for more details. |
425 | +# |
426 | +# You should have received a copy of the GNU Lesser General Public License |
427 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
428 | +from autopilot.matchers import Eventually |
429 | +from testtools.matchers import Equals, Contains |
430 | +from autopilot.testcase import AutopilotTestCase |
431 | +from autopilot.process import ProcessManager |
432 | + |
433 | +# register gnumeric app |
434 | +ProcessManager.register_known_application( |
435 | + "gnumeric", |
436 | + "gnumeric.desktop", |
437 | + "gnumeric") |
438 | + |
439 | +class GnumericWindowTests(AutopilotTestCase): |
440 | + """ Window tests for the xfce4-screenshooter """ |
441 | + |
442 | + def setUp(self): |
443 | + """ Basic setup instruction to run before each test """ |
444 | + super(GnumericWindowTests, self).setUp() |
445 | + self.manager = ProcessManager.create('BAMF') |
446 | + self.app = self.manager.start_app("gnumeric") |
447 | + # This will make sure Screenshooter window you launched is focused and ready |
448 | + # to accept your keyboard input |
449 | + self.assertTrue(self.app.is_active) |
450 | + |
451 | + def test_window_visible(self): |
452 | + """ Check to see if the main window has the proper title """ |
453 | + windows = self.app.get_windows() |
454 | + window = windows[0] |
455 | + |
456 | + # We must assert the window title = Archive Manager |
457 | + # It fails with assertTrue(self.app.is_focused) |
458 | + self.assertThat(lambda: window.title, Eventually(Contains('Gnumeric'))) |
459 | + |
460 | + for window in windows: |
461 | + window.close() |
462 | |
463 | === added directory 'xubuntu_autopilot_tests/gthumb' |
464 | === added file 'xubuntu_autopilot_tests/gthumb/__init__.py' |
465 | --- xubuntu_autopilot_tests/gthumb/__init__.py 1970-01-01 00:00:00 +0000 |
466 | +++ xubuntu_autopilot_tests/gthumb/__init__.py 2014-03-30 18:20:04 +0000 |
467 | @@ -0,0 +1,2 @@ |
468 | +# -*- coding: utf-8 -*- |
469 | + |
470 | |
471 | === added file 'xubuntu_autopilot_tests/gthumb/test_gthumb.py' |
472 | --- xubuntu_autopilot_tests/gthumb/test_gthumb.py 1970-01-01 00:00:00 +0000 |
473 | +++ xubuntu_autopilot_tests/gthumb/test_gthumb.py 2014-03-30 18:20:04 +0000 |
474 | @@ -0,0 +1,51 @@ |
475 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
476 | +# |
477 | +# Copyright (C) 2014 |
478 | +# |
479 | +# Author: Thomas Molloy beetyrootey@gmail.com |
480 | +# |
481 | +# This program is free software; you can redistribute it and/or modify |
482 | +# it under the terms of the GNU Lesser General Public License as published by |
483 | +# the Free Software Foundation; version 3. |
484 | +# |
485 | +# This program is distributed in the hope that it will be useful, |
486 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
487 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
488 | +# GNU Lesser General Public License for more details. |
489 | +# |
490 | +# You should have received a copy of the GNU Lesser General Public License |
491 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
492 | +from autopilot.matchers import Eventually |
493 | +from testtools.matchers import Equals, Contains |
494 | +from autopilot.testcase import AutopilotTestCase |
495 | +from autopilot.process import ProcessManager |
496 | + |
497 | +# register gThumb app |
498 | +ProcessManager.register_known_application( |
499 | + "gthumb", |
500 | + "gthumb.desktop", |
501 | + "gThumb") |
502 | + |
503 | +class GThumbWindowTests(AutopilotTestCase): |
504 | + """ Window tests for the gthumb """ |
505 | + |
506 | + def setUp(self): |
507 | + """ Basic setup instruction to run before each test """ |
508 | + super(GThumbWindowTests, self).setUp() |
509 | + self.manager = ProcessManager.create('BAMF') |
510 | + self.app = self.manager.start_app("gthumb") |
511 | + # This will make sure Mines window you launched is focused and ready |
512 | + # to accept your keyboard input |
513 | + self.assertTrue(self.app.is_active) |
514 | + |
515 | + def test_window_visible(self): |
516 | + """ Check to see if the main window has the proper title """ |
517 | + windows = self.app.get_windows() |
518 | + window = windows[0] |
519 | + |
520 | + # We must assert the window title = gThumb here to keep focus of Sudoku |
521 | + # It fails with assertTrue(self.app.is_focused) |
522 | + self.assertThat(lambda: window.title, Eventually(Contains('gThumb'))) |
523 | + |
524 | + for window in windows: |
525 | + window.close() |
526 | |
527 | === added directory 'xubuntu_autopilot_tests/gucharmap' |
528 | === added file 'xubuntu_autopilot_tests/gucharmap/__init__.py' |
529 | --- xubuntu_autopilot_tests/gucharmap/__init__.py 1970-01-01 00:00:00 +0000 |
530 | +++ xubuntu_autopilot_tests/gucharmap/__init__.py 2014-03-30 18:20:04 +0000 |
531 | @@ -0,0 +1,2 @@ |
532 | +# -*- coding: utf-8 -*- |
533 | + |
534 | |
535 | === added file 'xubuntu_autopilot_tests/gucharmap/test_gucharmap.py' |
536 | --- xubuntu_autopilot_tests/gucharmap/test_gucharmap.py 1970-01-01 00:00:00 +0000 |
537 | +++ xubuntu_autopilot_tests/gucharmap/test_gucharmap.py 2014-03-30 18:20:04 +0000 |
538 | @@ -0,0 +1,51 @@ |
539 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
540 | +# |
541 | +# Copyright (C) 2014 |
542 | +# |
543 | +# Author: Thomas Molloy beetyrootey@gmail.com |
544 | +# |
545 | +# This program is free software; you can redistribute it and/or modify |
546 | +# it under the terms of the GNU Lesser General Public License as published by |
547 | +# the Free Software Foundation; version 3. |
548 | +# |
549 | +# This program is distributed in the hope that it will be useful, |
550 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
551 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
552 | +# GNU Lesser General Public License for more details. |
553 | +# |
554 | +# You should have received a copy of the GNU Lesser General Public License |
555 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
556 | +from autopilot.matchers import Eventually |
557 | +from testtools.matchers import Equals, Contains |
558 | +from autopilot.testcase import AutopilotTestCase |
559 | +from autopilot.process import ProcessManager |
560 | + |
561 | +# register gnumeric app |
562 | +ProcessManager.register_known_application( |
563 | + "gucharmap", |
564 | + "gucharmap.desktop", |
565 | + "gucharmap") |
566 | + |
567 | +class GucharmapWindowTests(AutopilotTestCase): |
568 | + """ Window tests for the xfce4-screenshooter """ |
569 | + |
570 | + def setUp(self): |
571 | + """ Basic setup instruction to run before each test """ |
572 | + super(GucharmapWindowTests, self).setUp() |
573 | + self.manager = ProcessManager.create('BAMF') |
574 | + self.app = self.manager.start_app("gucharmap") |
575 | + # This will make sure Screenshooter window you launched is focused and ready |
576 | + # to accept your keyboard input |
577 | + self.assertTrue(self.app.is_active) |
578 | + |
579 | + def test_window_visible(self): |
580 | + """ Check to see if the main window has the proper title """ |
581 | + windows = self.app.get_windows() |
582 | + window = windows[0] |
583 | + |
584 | + # We must assert the window title = Archive Manager |
585 | + # It fails with assertTrue(self.app.is_focused) |
586 | + self.assertThat(lambda: window.title, Eventually(Contains('Character Map'))) |
587 | + |
588 | + for window in windows: |
589 | + window.close() |
590 | |
591 | === added directory 'xubuntu_autopilot_tests/mousepad' |
592 | === added file 'xubuntu_autopilot_tests/mousepad/__init__.py' |
593 | --- xubuntu_autopilot_tests/mousepad/__init__.py 1970-01-01 00:00:00 +0000 |
594 | +++ xubuntu_autopilot_tests/mousepad/__init__.py 2014-03-30 18:20:04 +0000 |
595 | @@ -0,0 +1,2 @@ |
596 | +# -*- coding: utf-8 -*- |
597 | + |
598 | |
599 | === added file 'xubuntu_autopilot_tests/mousepad/test_mousepad.py' |
600 | --- xubuntu_autopilot_tests/mousepad/test_mousepad.py 1970-01-01 00:00:00 +0000 |
601 | +++ xubuntu_autopilot_tests/mousepad/test_mousepad.py 2014-03-30 18:20:04 +0000 |
602 | @@ -0,0 +1,51 @@ |
603 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
604 | +# |
605 | +# Copyright (C) 2014 |
606 | +# |
607 | +# Author: Thomas Molloy beetyrootey@gmail.com |
608 | +# |
609 | +# This program is free software; you can redistribute it and/or modify |
610 | +# it under the terms of the GNU Lesser General Public License as published by |
611 | +# the Free Software Foundation; version 3. |
612 | +# |
613 | +# This program is distributed in the hope that it will be useful, |
614 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
615 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
616 | +# GNU Lesser General Public License for more details. |
617 | +# |
618 | +# You should have received a copy of the GNU Lesser General Public License |
619 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
620 | +from autopilot.matchers import Eventually |
621 | +from testtools.matchers import Equals, Contains |
622 | +from autopilot.testcase import AutopilotTestCase |
623 | +from autopilot.process import ProcessManager |
624 | + |
625 | +# register gnumeric app |
626 | +ProcessManager.register_known_application( |
627 | + "mousepad", |
628 | + "mousepad.desktop", |
629 | + "mousepad") |
630 | + |
631 | +class MousepadWindowTests(AutopilotTestCase): |
632 | + """ Window tests for the xfce4-screenshooter """ |
633 | + |
634 | + def setUp(self): |
635 | + """ Basic setup instruction to run before each test """ |
636 | + super(MousepadWindowTests, self).setUp() |
637 | + self.manager = ProcessManager.create('BAMF') |
638 | + self.app = self.manager.start_app("mousepad") |
639 | + # This will make sure Screenshooter window you launched is focused and ready |
640 | + # to accept your keyboard input |
641 | + self.assertTrue(self.app.is_active) |
642 | + |
643 | + def test_window_visible(self): |
644 | + """ Check to see if the main window has the proper title """ |
645 | + windows = self.app.get_windows() |
646 | + window = windows[0] |
647 | + |
648 | + # We must assert the window title = Archive Manager |
649 | + # It fails with assertTrue(self.app.is_focused) |
650 | + self.assertThat(lambda: window.title, Eventually(Contains('Mousepad'))) |
651 | + |
652 | + for window in windows: |
653 | + window.close() |
654 | |
655 | === added directory 'xubuntu_autopilot_tests/onboard' |
656 | === added file 'xubuntu_autopilot_tests/onboard/__init__.py' |
657 | --- xubuntu_autopilot_tests/onboard/__init__.py 1970-01-01 00:00:00 +0000 |
658 | +++ xubuntu_autopilot_tests/onboard/__init__.py 2014-03-30 18:20:04 +0000 |
659 | @@ -0,0 +1,2 @@ |
660 | +# -*- coding: utf-8 -*- |
661 | + |
662 | |
663 | === added file 'xubuntu_autopilot_tests/onboard/test_onboard.py' |
664 | --- xubuntu_autopilot_tests/onboard/test_onboard.py 1970-01-01 00:00:00 +0000 |
665 | +++ xubuntu_autopilot_tests/onboard/test_onboard.py 2014-03-30 18:20:04 +0000 |
666 | @@ -0,0 +1,51 @@ |
667 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
668 | +# |
669 | +# Copyright (C) 2014 |
670 | +# |
671 | +# Author: Thomas Molloy beetyrootey@gmail.com |
672 | +# |
673 | +# This program is free software; you can redistribute it and/or modify |
674 | +# it under the terms of the GNU Lesser General Public License as published by |
675 | +# the Free Software Foundation; version 3. |
676 | +# |
677 | +# This program is distributed in the hope that it will be useful, |
678 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
679 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
680 | +# GNU Lesser General Public License for more details. |
681 | +# |
682 | +# You should have received a copy of the GNU Lesser General Public License |
683 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
684 | +from autopilot.matchers import Eventually |
685 | +from testtools.matchers import Equals, Contains |
686 | +from autopilot.testcase import AutopilotTestCase |
687 | +from autopilot.process import ProcessManager |
688 | + |
689 | +# register gnumeric app |
690 | +ProcessManager.register_known_application( |
691 | + "onboard", |
692 | + "onboard.desktop", |
693 | + "onboard") |
694 | + |
695 | +class OnboardWindowTests(AutopilotTestCase): |
696 | + """ Window tests for the xfce4-screenshooter """ |
697 | + |
698 | + def setUp(self): |
699 | + """ Basic setup instruction to run before each test """ |
700 | + super(OnboardWindowTests, self).setUp() |
701 | + self.manager = ProcessManager.create('BAMF') |
702 | + self.app = self.manager.start_app("onboard") |
703 | + # This will make sure Screenshooter window you launched is focused and ready |
704 | + # to accept your keyboard input |
705 | + self.assertTrue(self.app.is_active) |
706 | + |
707 | + def test_window_visible(self): |
708 | + """ Check to see if the main window has the proper title """ |
709 | + windows = self.app.get_windows() |
710 | + window = windows[0] |
711 | + |
712 | + # We must assert the window title = Archive Manager |
713 | + # It fails with assertTrue(self.app.is_focused) |
714 | + self.assertThat(lambda: window.title, Eventually(Contains('Onboard'))) |
715 | + |
716 | + for window in windows: |
717 | + window.close() |
718 | |
719 | === added directory 'xubuntu_autopilot_tests/orage-calendar' |
720 | === added file 'xubuntu_autopilot_tests/orage-calendar/__init__.py' |
721 | --- xubuntu_autopilot_tests/orage-calendar/__init__.py 1970-01-01 00:00:00 +0000 |
722 | +++ xubuntu_autopilot_tests/orage-calendar/__init__.py 2014-03-30 18:20:04 +0000 |
723 | @@ -0,0 +1,2 @@ |
724 | +# -*- coding: utf-8 -*- |
725 | + |
726 | |
727 | === added file 'xubuntu_autopilot_tests/orage-calendar/test_orage_calendar.py' |
728 | --- xubuntu_autopilot_tests/orage-calendar/test_orage_calendar.py 1970-01-01 00:00:00 +0000 |
729 | +++ xubuntu_autopilot_tests/orage-calendar/test_orage_calendar.py 2014-03-30 18:20:04 +0000 |
730 | @@ -0,0 +1,51 @@ |
731 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
732 | +# |
733 | +# Copyright (C) 2014 |
734 | +# |
735 | +# Author: Thomas Molloy beetyrootey@gmail.com |
736 | +# |
737 | +# This program is free software; you can redistribute it and/or modify |
738 | +# it under the terms of the GNU Lesser General Public License as published by |
739 | +# the Free Software Foundation; version 3. |
740 | +# |
741 | +# This program is distributed in the hope that it will be useful, |
742 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
743 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
744 | +# GNU Lesser General Public License for more details. |
745 | +# |
746 | +# You should have received a copy of the GNU Lesser General Public License |
747 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
748 | +from autopilot.matchers import Eventually |
749 | +from testtools.matchers import Equals, Contains |
750 | +from autopilot.testcase import AutopilotTestCase |
751 | +from autopilot.process import ProcessManager |
752 | + |
753 | +# register gnumeric app |
754 | +ProcessManager.register_known_application( |
755 | + "orage", |
756 | + "orage.desktop", |
757 | + "orage") |
758 | + |
759 | +class OrageCalendarWindowTests(AutopilotTestCase): |
760 | + """ Window tests for the xfce4-screenshooter """ |
761 | + |
762 | + def setUp(self): |
763 | + """ Basic setup instruction to run before each test """ |
764 | + super(OrageCalendarWindowTests, self).setUp() |
765 | + self.manager = ProcessManager.create('BAMF') |
766 | + self.app = self.manager.start_app("orage") |
767 | + # This will make sure Screenshooter window you launched is focused and ready |
768 | + # to accept your keyboard input |
769 | + self.assertTrue(self.app.is_active) |
770 | + |
771 | + def test_window_visible(self): |
772 | + """ Check to see if the main window has the proper title """ |
773 | + windows = self.app.get_windows() |
774 | + window = windows[0] |
775 | + |
776 | + # We must assert the window title = Archive Manager |
777 | + # It fails with assertTrue(self.app.is_focused) |
778 | + self.assertThat(lambda: window.title, Eventually(Contains('Orage'))) |
779 | + |
780 | + for window in windows: |
781 | + window.close() |
782 | |
783 | === added directory 'xubuntu_autopilot_tests/orage-globaltime' |
784 | === added file 'xubuntu_autopilot_tests/orage-globaltime/__init__.py' |
785 | --- xubuntu_autopilot_tests/orage-globaltime/__init__.py 1970-01-01 00:00:00 +0000 |
786 | +++ xubuntu_autopilot_tests/orage-globaltime/__init__.py 2014-03-30 18:20:04 +0000 |
787 | @@ -0,0 +1,2 @@ |
788 | +# -*- coding: utf-8 -*- |
789 | + |
790 | |
791 | === added file 'xubuntu_autopilot_tests/orage-globaltime/test_orage_globaltime.py' |
792 | --- xubuntu_autopilot_tests/orage-globaltime/test_orage_globaltime.py 1970-01-01 00:00:00 +0000 |
793 | +++ xubuntu_autopilot_tests/orage-globaltime/test_orage_globaltime.py 2014-03-30 18:20:04 +0000 |
794 | @@ -0,0 +1,51 @@ |
795 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
796 | +# |
797 | +# Copyright (C) 2014 |
798 | +# |
799 | +# Author: Thomas Molloy beetyrootey@gmail.com |
800 | +# |
801 | +# This program is free software; you can redistribute it and/or modify |
802 | +# it under the terms of the GNU Lesser General Public License as published by |
803 | +# the Free Software Foundation; version 3. |
804 | +# |
805 | +# This program is distributed in the hope that it will be useful, |
806 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
807 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
808 | +# GNU Lesser General Public License for more details. |
809 | +# |
810 | +# You should have received a copy of the GNU Lesser General Public License |
811 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
812 | +from autopilot.matchers import Eventually |
813 | +from testtools.matchers import Equals, Contains |
814 | +from autopilot.testcase import AutopilotTestCase |
815 | +from autopilot.process import ProcessManager |
816 | + |
817 | +# register gnumeric app |
818 | +ProcessManager.register_known_application( |
819 | + "globaltime", |
820 | + "globaltime.desktop", |
821 | + "globaltime") |
822 | + |
823 | +class OrageCalendarWindowTests(AutopilotTestCase): |
824 | + """ Window tests for the xfce4-screenshooter """ |
825 | + |
826 | + def setUp(self): |
827 | + """ Basic setup instruction to run before each test """ |
828 | + super(OrageCalendarWindowTests, self).setUp() |
829 | + self.manager = ProcessManager.create('BAMF') |
830 | + self.app = self.manager.start_app("globaltime") |
831 | + # This will make sure Screenshooter window you launched is focused and ready |
832 | + # to accept your keyboard input |
833 | + self.assertTrue(self.app.is_active) |
834 | + |
835 | + def test_window_visible(self): |
836 | + """ Check to see if the main window has the proper title """ |
837 | + windows = self.app.get_windows() |
838 | + window = windows[0] |
839 | + |
840 | + # We must assert the window title = Archive Manager |
841 | + # It fails with assertTrue(self.app.is_focused) |
842 | + self.assertThat(lambda: window.title, Eventually(Contains('Global Time'))) |
843 | + |
844 | + for window in windows: |
845 | + window.close() |
846 | |
847 | === added directory 'xubuntu_autopilot_tests/pavucontrol' |
848 | === added file 'xubuntu_autopilot_tests/pavucontrol/__init__.py' |
849 | --- xubuntu_autopilot_tests/pavucontrol/__init__.py 1970-01-01 00:00:00 +0000 |
850 | +++ xubuntu_autopilot_tests/pavucontrol/__init__.py 2014-03-30 18:20:04 +0000 |
851 | @@ -0,0 +1,2 @@ |
852 | +# -*- coding: utf-8 -*- |
853 | + |
854 | |
855 | === added file 'xubuntu_autopilot_tests/pavucontrol/test_pavucontrol.py' |
856 | --- xubuntu_autopilot_tests/pavucontrol/test_pavucontrol.py 1970-01-01 00:00:00 +0000 |
857 | +++ xubuntu_autopilot_tests/pavucontrol/test_pavucontrol.py 2014-03-30 18:20:04 +0000 |
858 | @@ -0,0 +1,51 @@ |
859 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
860 | +# |
861 | +# Copyright (C) 2014 |
862 | +# |
863 | +# Author: Thomas Molloy beetyrootey@gmail.com |
864 | +# |
865 | +# This program is free software; you can redistribute it and/or modify |
866 | +# it under the terms of the GNU Lesser General Public License as published by |
867 | +# the Free Software Foundation; version 3. |
868 | +# |
869 | +# This program is distributed in the hope that it will be useful, |
870 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
871 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
872 | +# GNU Lesser General Public License for more details. |
873 | +# |
874 | +# You should have received a copy of the GNU Lesser General Public License |
875 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
876 | +from autopilot.matchers import Eventually |
877 | +from testtools.matchers import Equals, Contains |
878 | +from autopilot.testcase import AutopilotTestCase |
879 | +from autopilot.process import ProcessManager |
880 | + |
881 | +# register gnumeric app |
882 | +ProcessManager.register_known_application( |
883 | + "pavucontrol", |
884 | + "pavucontrol.desktop", |
885 | + "pavucontrol") |
886 | + |
887 | +class PavucontrolWindowTests(AutopilotTestCase): |
888 | + """ Window tests for the xfce4-screenshooter """ |
889 | + |
890 | + def setUp(self): |
891 | + """ Basic setup instruction to run before each test """ |
892 | + super(PavucontrolWindowTests, self).setUp() |
893 | + self.manager = ProcessManager.create('BAMF') |
894 | + self.app = self.manager.start_app("pavucontrol") |
895 | + # This will make sure Screenshooter window you launched is focused and ready |
896 | + # to accept your keyboard input |
897 | + self.assertTrue(self.app.is_active) |
898 | + |
899 | + def test_window_visible(self): |
900 | + """ Check to see if the main window has the proper title """ |
901 | + windows = self.app.get_windows() |
902 | + window = windows[0] |
903 | + |
904 | + # We must assert the window title = Archive Manager |
905 | + # It fails with assertTrue(self.app.is_focused) |
906 | + self.assertThat(lambda: window.title, Eventually(Contains('Volume Control'))) |
907 | + |
908 | + for window in windows: |
909 | + window.close() |
910 | |
911 | === added directory 'xubuntu_autopilot_tests/pidgin' |
912 | === added file 'xubuntu_autopilot_tests/pidgin/__init__.py' |
913 | --- xubuntu_autopilot_tests/pidgin/__init__.py 1970-01-01 00:00:00 +0000 |
914 | +++ xubuntu_autopilot_tests/pidgin/__init__.py 2014-03-30 18:20:04 +0000 |
915 | @@ -0,0 +1,2 @@ |
916 | +# -*- coding: utf-8 -*- |
917 | + |
918 | |
919 | === added file 'xubuntu_autopilot_tests/pidgin/test_pidgin.py' |
920 | --- xubuntu_autopilot_tests/pidgin/test_pidgin.py 1970-01-01 00:00:00 +0000 |
921 | +++ xubuntu_autopilot_tests/pidgin/test_pidgin.py 2014-03-30 18:20:04 +0000 |
922 | @@ -0,0 +1,51 @@ |
923 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
924 | +# |
925 | +# Copyright (C) 2014 |
926 | +# |
927 | +# Author: Thomas Molloy beetyrootey@gmail.com |
928 | +# |
929 | +# This program is free software; you can redistribute it and/or modify |
930 | +# it under the terms of the GNU Lesser General Public License as published by |
931 | +# the Free Software Foundation; version 3. |
932 | +# |
933 | +# This program is distributed in the hope that it will be useful, |
934 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
935 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
936 | +# GNU Lesser General Public License for more details. |
937 | +# |
938 | +# You should have received a copy of the GNU Lesser General Public License |
939 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
940 | +from autopilot.matchers import Eventually |
941 | +from testtools.matchers import Equals, Contains |
942 | +from autopilot.testcase import AutopilotTestCase |
943 | +from autopilot.process import ProcessManager |
944 | + |
945 | +# register gnumeric app |
946 | +ProcessManager.register_known_application( |
947 | + "pidgin", |
948 | + "pidgin.desktop", |
949 | + "pidgin") |
950 | + |
951 | +class PidginWindowTests(AutopilotTestCase): |
952 | + """ Window tests for the xfce4-screenshooter """ |
953 | + |
954 | + def setUp(self): |
955 | + """ Basic setup instruction to run before each test """ |
956 | + super(PidginWindowTests, self).setUp() |
957 | + self.manager = ProcessManager.create('BAMF') |
958 | + self.app = self.manager.start_app("pidgin") |
959 | + # This will make sure Screenshooter window you launched is focused and ready |
960 | + # to accept your keyboard input |
961 | + self.assertTrue(self.app.is_active) |
962 | + |
963 | + def test_window_visible(self): |
964 | + """ Check to see if the main window has the proper title """ |
965 | + windows = self.app.get_windows() |
966 | + window = windows[0] |
967 | + |
968 | + # We must assert the window title = Archive Manager |
969 | + # It fails with assertTrue(self.app.is_focused) |
970 | + self.assertThat(lambda: window.title, Eventually(Contains('Accounts'))) |
971 | + |
972 | + for window in windows: |
973 | + window.close() |
974 | |
975 | === added directory 'xubuntu_autopilot_tests/ristretto' |
976 | === added file 'xubuntu_autopilot_tests/ristretto/__init__.py' |
977 | --- xubuntu_autopilot_tests/ristretto/__init__.py 1970-01-01 00:00:00 +0000 |
978 | +++ xubuntu_autopilot_tests/ristretto/__init__.py 2014-03-30 18:20:04 +0000 |
979 | @@ -0,0 +1,2 @@ |
980 | +# -*- coding: utf-8 -*- |
981 | + |
982 | |
983 | === added file 'xubuntu_autopilot_tests/ristretto/test_ristretto.py' |
984 | --- xubuntu_autopilot_tests/ristretto/test_ristretto.py 1970-01-01 00:00:00 +0000 |
985 | +++ xubuntu_autopilot_tests/ristretto/test_ristretto.py 2014-03-30 18:20:04 +0000 |
986 | @@ -0,0 +1,51 @@ |
987 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
988 | +# |
989 | +# Copyright (C) 2014 |
990 | +# |
991 | +# Author: Thomas Molloy beetyrootey@gmail.com |
992 | +# |
993 | +# This program is free software; you can redistribute it and/or modify |
994 | +# it under the terms of the GNU Lesser General Public License as published by |
995 | +# the Free Software Foundation; version 3. |
996 | +# |
997 | +# This program is distributed in the hope that it will be useful, |
998 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
999 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1000 | +# GNU Lesser General Public License for more details. |
1001 | +# |
1002 | +# You should have received a copy of the GNU Lesser General Public License |
1003 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1004 | +from autopilot.matchers import Eventually |
1005 | +from testtools.matchers import Equals, Contains |
1006 | +from autopilot.testcase import AutopilotTestCase |
1007 | +from autopilot.process import ProcessManager |
1008 | + |
1009 | +# register gThumb app |
1010 | +ProcessManager.register_known_application( |
1011 | + "ristretto", |
1012 | + "ristretto.desktop", |
1013 | + "ristretto") |
1014 | + |
1015 | +class RistrettoWindowTests(AutopilotTestCase): |
1016 | + """ Window tests for the gthumb """ |
1017 | + |
1018 | + def setUp(self): |
1019 | + """ Basic setup instruction to run before each test """ |
1020 | + super(RistrettoWindowTests, self).setUp() |
1021 | + self.manager = ProcessManager.create('BAMF') |
1022 | + self.app = self.manager.start_app("ristretto") |
1023 | + # This will make sure Mines window you launched is focused and ready |
1024 | + # to accept your keyboard input |
1025 | + self.assertTrue(self.app.is_active) |
1026 | + |
1027 | + def test_window_visible(self): |
1028 | + """ Check to see if the main window has the proper title """ |
1029 | + windows = self.app.get_windows() |
1030 | + window = windows[0] |
1031 | + |
1032 | + # We must assert the window title = ristretto here to keep focus of ristretto |
1033 | + # It fails with assertTrue(self.app.is_focused) |
1034 | + self.assertThat(lambda: window.title, Eventually(Contains('Image Viewer'))) |
1035 | + |
1036 | + for window in windows: |
1037 | + window.close() |
1038 | |
1039 | === added directory 'xubuntu_autopilot_tests/simple-scan' |
1040 | === added file 'xubuntu_autopilot_tests/simple-scan/__init__.py' |
1041 | --- xubuntu_autopilot_tests/simple-scan/__init__.py 1970-01-01 00:00:00 +0000 |
1042 | +++ xubuntu_autopilot_tests/simple-scan/__init__.py 2014-03-30 18:20:04 +0000 |
1043 | @@ -0,0 +1,2 @@ |
1044 | +# -*- coding: utf-8 -*- |
1045 | + |
1046 | |
1047 | === added file 'xubuntu_autopilot_tests/simple-scan/test_simple_scan.py' |
1048 | --- xubuntu_autopilot_tests/simple-scan/test_simple_scan.py 1970-01-01 00:00:00 +0000 |
1049 | +++ xubuntu_autopilot_tests/simple-scan/test_simple_scan.py 2014-03-30 18:20:04 +0000 |
1050 | @@ -0,0 +1,50 @@ |
1051 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
1052 | +# |
1053 | +# Copyright (C) 2014 |
1054 | +# |
1055 | +# Author: Thomas Molloy beetyrootey@gmail.com |
1056 | +# |
1057 | +# This program is free software; you can redistribute it and/or modify |
1058 | +# it under the terms of the GNU Lesser General Public License as published by |
1059 | +# the Free Software Foundation; version 3. |
1060 | +# |
1061 | +# This program is distributed in the hope that it will be useful, |
1062 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1063 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1064 | +# GNU Lesser General Public License for more details. |
1065 | +# |
1066 | +# You should have received a copy of the GNU Lesser General Public License |
1067 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1068 | +from autopilot.matchers import Eventually |
1069 | +from testtools.matchers import Equals, Contains |
1070 | +from autopilot.testcase import AutopilotTestCase |
1071 | +from autopilot.process import ProcessManager |
1072 | + |
1073 | +# register Simple-scan app |
1074 | +ProcessManager.register_known_application( |
1075 | + "simple-scan", |
1076 | + "simple-scan.desktop", |
1077 | + "Simple-scan") |
1078 | + |
1079 | +class SimpleScanWindowTests(AutopilotTestCase): |
1080 | + """ Window tests for the game Simple scan """ |
1081 | + |
1082 | + def setUp(self): |
1083 | + """ Basic setup instruction to run before each test """ |
1084 | + super(SimpleScanWindowTests, self).setUp() |
1085 | + self.manager = ProcessManager.create('BAMF') |
1086 | + self.app = self.manager.start_app("simple-scan") |
1087 | + # This will make sure Sudoku window you launched is focused and ready |
1088 | + # to accept your keyboard input |
1089 | + self.assertTrue(self.app.is_active) |
1090 | + |
1091 | + def test_window_visible(self): |
1092 | + """ Basic test to see if the window opens with the correct name """ |
1093 | + # We must assert the window title = Simple Scan here to keep focus of SimpleScan |
1094 | + # It fails with assertTrue(self.app.is_focused) |
1095 | + windows = self.app.get_windows() |
1096 | + self.assertTrue(len(windows) == 1) |
1097 | + mainWindow = windows[0] |
1098 | + self.assertThat(lambda: mainWindow.title, Eventually(Contains('Simple Scan'))) |
1099 | + # We must close the window else the test fails as it is unable to close it automatically |
1100 | + mainWindow.close() |
1101 | \ No newline at end of file |
1102 | |
1103 | === added directory 'xubuntu_autopilot_tests/sudoku' |
1104 | === added file 'xubuntu_autopilot_tests/sudoku/__init__.py' |
1105 | --- xubuntu_autopilot_tests/sudoku/__init__.py 1970-01-01 00:00:00 +0000 |
1106 | +++ xubuntu_autopilot_tests/sudoku/__init__.py 2014-03-30 18:20:04 +0000 |
1107 | @@ -0,0 +1,2 @@ |
1108 | +# -*- coding: utf-8 -*- |
1109 | + |
1110 | |
1111 | === added file 'xubuntu_autopilot_tests/sudoku/test_sudoku.py' |
1112 | --- xubuntu_autopilot_tests/sudoku/test_sudoku.py 1970-01-01 00:00:00 +0000 |
1113 | +++ xubuntu_autopilot_tests/sudoku/test_sudoku.py 2014-03-30 18:20:04 +0000 |
1114 | @@ -0,0 +1,49 @@ |
1115 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
1116 | +# |
1117 | +# Copyright (C) 2014 |
1118 | +# |
1119 | +# Author: Thomas Molloy beetyrootey@gmail.com |
1120 | +# |
1121 | +# This program is free software; you can redistribute it and/or modify |
1122 | +# it under the terms of the GNU Lesser General Public License as published by |
1123 | +# the Free Software Foundation; version 3. |
1124 | +# |
1125 | +# This program is distributed in the hope that it will be useful, |
1126 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1127 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1128 | +# GNU Lesser General Public License for more details. |
1129 | +# |
1130 | +# You should have received a copy of the GNU Lesser General Public License |
1131 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1132 | +from autopilot.matchers import Eventually |
1133 | +from testtools.matchers import Equals, Contains |
1134 | +from autopilot.testcase import AutopilotTestCase |
1135 | +from autopilot.process import ProcessManager |
1136 | + |
1137 | +# register sudoku app |
1138 | +ProcessManager.register_known_application( |
1139 | + "gnome-sudoku", |
1140 | + "gnome-sudoku.desktop", |
1141 | + "gnome-sudoku") |
1142 | + |
1143 | +class SudokuWindowTests(AutopilotTestCase): |
1144 | + """ Window tests for the game Sudoku """ |
1145 | + |
1146 | + def setUp(self): |
1147 | + """ Basic setup instruction to run before each test """ |
1148 | + super(SudokuWindowTests, self).setUp() |
1149 | + self.manager = ProcessManager.create('BAMF') |
1150 | + self.app = self.manager.start_app("gnome-sudoku") |
1151 | + # This will make sure Sudoku window you launched is focused and ready |
1152 | + # to accept your keyboard input |
1153 | + self.assertTrue(self.app.is_active) |
1154 | + |
1155 | + def test_window_visible(self): |
1156 | + # We must assert the window title = Sudoku here to keep focus of Sudoku |
1157 | + # It fails with assertTrue(self.app.is_focused) |
1158 | + windows = self.app.get_windows() |
1159 | + self.assertTrue(len(windows) == 1) |
1160 | + mainWindow = windows[0] |
1161 | + self.assertThat(lambda: mainWindow.title, Eventually(Contains('Sudoku'))) |
1162 | + # We must close the window else the test fails as it is unable to close it automatically |
1163 | + mainWindow.close() |
1164 | |
1165 | === added directory 'xubuntu_autopilot_tests/thunderbird' |
1166 | === added file 'xubuntu_autopilot_tests/thunderbird/__init__.py' |
1167 | --- xubuntu_autopilot_tests/thunderbird/__init__.py 1970-01-01 00:00:00 +0000 |
1168 | +++ xubuntu_autopilot_tests/thunderbird/__init__.py 2014-03-30 18:20:04 +0000 |
1169 | @@ -0,0 +1,2 @@ |
1170 | +# -*- coding: utf-8 -*- |
1171 | + |
1172 | |
1173 | === added file 'xubuntu_autopilot_tests/thunderbird/test_thunderbird.py' |
1174 | --- xubuntu_autopilot_tests/thunderbird/test_thunderbird.py 1970-01-01 00:00:00 +0000 |
1175 | +++ xubuntu_autopilot_tests/thunderbird/test_thunderbird.py 2014-03-30 18:20:04 +0000 |
1176 | @@ -0,0 +1,49 @@ |
1177 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
1178 | +# |
1179 | +# Copyright (C) 2014 |
1180 | +# |
1181 | +# Author: Thomas Molloy beetyrootey@gmail.com |
1182 | +# |
1183 | +# This program is free software; you can redistribute it and/or modify |
1184 | +# it under the terms of the GNU Lesser General Public License as published by |
1185 | +# the Free Software Foundation; version 3. |
1186 | +# |
1187 | +# This program is distributed in the hope that it will be useful, |
1188 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1189 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1190 | +# GNU Lesser General Public License for more details. |
1191 | +# |
1192 | +# You should have received a copy of the GNU Lesser General Public License |
1193 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1194 | +from autopilot.matchers import Eventually |
1195 | +from testtools.matchers import Equals, Contains |
1196 | +from autopilot.testcase import AutopilotTestCase |
1197 | +from autopilot.process import ProcessManager |
1198 | + |
1199 | +# register sudoku app |
1200 | +ProcessManager.register_known_application( |
1201 | + "thunderbird", |
1202 | + "thunderbird.desktop", |
1203 | + "thunderbird") |
1204 | + |
1205 | +class ThunderbirdWindowTests(AutopilotTestCase): |
1206 | + """ Window tests for the game Sudoku """ |
1207 | + |
1208 | + def setUp(self): |
1209 | + """ Basic setup instruction to run before each test """ |
1210 | + super(ThunderbirdWindowTests, self).setUp() |
1211 | + self.manager = ProcessManager.create('BAMF') |
1212 | + self.app = self.manager.start_app("thunderbird") |
1213 | + # This will make sure Sudoku window you launched is focused and ready |
1214 | + # to accept your keyboard input |
1215 | + self.assertTrue(self.app.is_active) |
1216 | + |
1217 | + def test_window_visible(self): |
1218 | + # We must assert the window title = Sudoku here to keep focus of Sudoku |
1219 | + # It fails with assertTrue(self.app.is_focused) |
1220 | + windows = self.app.get_windows() |
1221 | + self.assertTrue(len(windows) == 1) |
1222 | + mainWindow = windows[0] |
1223 | + self.assertThat(lambda: mainWindow.title, Eventually(Contains('Thunderbird'))) |
1224 | + # We must close the window else the test fails as it is unable to close it automatically |
1225 | + mainWindow.close() |
1226 | |
1227 | === added directory 'xubuntu_autopilot_tests/transmission-gtk' |
1228 | === added file 'xubuntu_autopilot_tests/transmission-gtk/__init__.py' |
1229 | --- xubuntu_autopilot_tests/transmission-gtk/__init__.py 1970-01-01 00:00:00 +0000 |
1230 | +++ xubuntu_autopilot_tests/transmission-gtk/__init__.py 2014-03-30 18:20:04 +0000 |
1231 | @@ -0,0 +1,2 @@ |
1232 | +# -*- coding: utf-8 -*- |
1233 | + |
1234 | |
1235 | === added file 'xubuntu_autopilot_tests/transmission-gtk/test_transmission_gtk.py' |
1236 | --- xubuntu_autopilot_tests/transmission-gtk/test_transmission_gtk.py 1970-01-01 00:00:00 +0000 |
1237 | +++ xubuntu_autopilot_tests/transmission-gtk/test_transmission_gtk.py 2014-03-30 18:20:04 +0000 |
1238 | @@ -0,0 +1,49 @@ |
1239 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
1240 | +# |
1241 | +# Copyright (C) 2014 |
1242 | +# |
1243 | +# Author: Thomas Molloy beetyrootey@gmail.com |
1244 | +# |
1245 | +# This program is free software; you can redistribute it and/or modify |
1246 | +# it under the terms of the GNU Lesser General Public License as published by |
1247 | +# the Free Software Foundation; version 3. |
1248 | +# |
1249 | +# This program is distributed in the hope that it will be useful, |
1250 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1251 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1252 | +# GNU Lesser General Public License for more details. |
1253 | +# |
1254 | +# You should have received a copy of the GNU Lesser General Public License |
1255 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1256 | +from autopilot.matchers import Eventually |
1257 | +from testtools.matchers import Equals, Contains |
1258 | +from autopilot.testcase import AutopilotTestCase |
1259 | +from autopilot.process import ProcessManager |
1260 | + |
1261 | +# register sudoku app |
1262 | +ProcessManager.register_known_application( |
1263 | + "transmission-gtk", |
1264 | + "transmission-gtk.desktop", |
1265 | + "transmission-gtk") |
1266 | + |
1267 | +class TransmissionGTKwindowTests(AutopilotTestCase): |
1268 | + """ Window tests for the game Sudoku """ |
1269 | + |
1270 | + def setUp(self): |
1271 | + """ Basic setup instruction to run before each test """ |
1272 | + super(TransmissionGTKwindowTests, self).setUp() |
1273 | + self.manager = ProcessManager.create('BAMF') |
1274 | + self.app = self.manager.start_app("transmission-gtk") |
1275 | + # This will make sure Sudoku window you launched is focused and ready |
1276 | + # to accept your keyboard input |
1277 | + self.assertTrue(self.app.is_active) |
1278 | + |
1279 | + def test_window_visible(self): |
1280 | + # We must assert the window title = Sudoku here to keep focus of Sudoku |
1281 | + # It fails with assertTrue(self.app.is_focused) |
1282 | + windows = self.app.get_windows() |
1283 | + self.assertTrue(len(windows) == 1) |
1284 | + mainWindow = windows[0] |
1285 | + self.assertThat(lambda: mainWindow.title, Eventually(Contains('Transmission'))) |
1286 | + # We must close the window else the test fails as it is unable to close it automatically |
1287 | + mainWindow.close() |
1288 | |
1289 | === added directory 'xubuntu_autopilot_tests/xfce4-appfinder' |
1290 | === added file 'xubuntu_autopilot_tests/xfce4-appfinder/__init__.py' |
1291 | --- xubuntu_autopilot_tests/xfce4-appfinder/__init__.py 1970-01-01 00:00:00 +0000 |
1292 | +++ xubuntu_autopilot_tests/xfce4-appfinder/__init__.py 2014-03-30 18:20:04 +0000 |
1293 | @@ -0,0 +1,2 @@ |
1294 | +# -*- coding: utf-8 -*- |
1295 | + |
1296 | |
1297 | === added file 'xubuntu_autopilot_tests/xfce4-appfinder/test_xfce4_appfinder.py' |
1298 | --- xubuntu_autopilot_tests/xfce4-appfinder/test_xfce4_appfinder.py 1970-01-01 00:00:00 +0000 |
1299 | +++ xubuntu_autopilot_tests/xfce4-appfinder/test_xfce4_appfinder.py 2014-03-30 18:20:04 +0000 |
1300 | @@ -0,0 +1,51 @@ |
1301 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
1302 | +# |
1303 | +# Copyright (C) 2014 |
1304 | +# |
1305 | +# Author: Thomas Molloy beetyrootey@gmail.com |
1306 | +# |
1307 | +# This program is free software; you can redistribute it and/or modify |
1308 | +# it under the terms of the GNU Lesser General Public License as published by |
1309 | +# the Free Software Foundation; version 3. |
1310 | +# |
1311 | +# This program is distributed in the hope that it will be useful, |
1312 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1313 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1314 | +# GNU Lesser General Public License for more details. |
1315 | +# |
1316 | +# You should have received a copy of the GNU Lesser General Public License |
1317 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1318 | +from autopilot.matchers import Eventually |
1319 | +from testtools.matchers import Equals, Contains |
1320 | +from autopilot.testcase import AutopilotTestCase |
1321 | +from autopilot.process import ProcessManager |
1322 | + |
1323 | +# register xfce4-appfinder app |
1324 | +ProcessManager.register_known_application( |
1325 | + "xfce4-appfinder", |
1326 | + "xfce4-appfinder.desktop", |
1327 | + "xfce4-appfinder") |
1328 | + |
1329 | +class xfce4AppfinderWindowTests(AutopilotTestCase): |
1330 | + """ Window tests for the xfce4-appfinder """ |
1331 | + |
1332 | + def setUp(self): |
1333 | + """ Basic setup instruction to run before each test """ |
1334 | + super(xfce4AppfinderWindowTests, self).setUp() |
1335 | + self.manager = ProcessManager.create('BAMF') |
1336 | + self.app = self.manager.start_app("xfce4-appfinder") |
1337 | + # This will make sure Mines window you launched is focused and ready |
1338 | + # to accept your keyboard input |
1339 | + self.assertTrue(self.app.is_active) |
1340 | + |
1341 | + def test_window_visible(self): |
1342 | + """ Check to see if the main window has the proper title """ |
1343 | + windows = self.app.get_windows() |
1344 | + window = windows[0] |
1345 | + |
1346 | + # We must assert the window title = Application Finder |
1347 | + # It fails with assertTrue(self.app.is_focused) |
1348 | + self.assertThat(lambda: window.title, Eventually(Contains('Application Finder'))) |
1349 | + |
1350 | + for window in windows: |
1351 | + window.close() |
1352 | |
1353 | === added directory 'xubuntu_autopilot_tests/xfce4-dict' |
1354 | === added file 'xubuntu_autopilot_tests/xfce4-dict/__init__.py' |
1355 | --- xubuntu_autopilot_tests/xfce4-dict/__init__.py 1970-01-01 00:00:00 +0000 |
1356 | +++ xubuntu_autopilot_tests/xfce4-dict/__init__.py 2014-03-30 18:20:04 +0000 |
1357 | @@ -0,0 +1,2 @@ |
1358 | +# -*- coding: utf-8 -*- |
1359 | + |
1360 | |
1361 | === added file 'xubuntu_autopilot_tests/xfce4-dict/test_xfce4_dict.py' |
1362 | --- xubuntu_autopilot_tests/xfce4-dict/test_xfce4_dict.py 1970-01-01 00:00:00 +0000 |
1363 | +++ xubuntu_autopilot_tests/xfce4-dict/test_xfce4_dict.py 2014-03-30 18:20:04 +0000 |
1364 | @@ -0,0 +1,51 @@ |
1365 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
1366 | +# |
1367 | +# Copyright (C) 2014 |
1368 | +# |
1369 | +# Author: Thomas Molloy beetyrootey@gmail.com |
1370 | +# |
1371 | +# This program is free software; you can redistribute it and/or modify |
1372 | +# it under the terms of the GNU Lesser General Public License as published by |
1373 | +# the Free Software Foundation; version 3. |
1374 | +# |
1375 | +# This program is distributed in the hope that it will be useful, |
1376 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1377 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1378 | +# GNU Lesser General Public License for more details. |
1379 | +# |
1380 | +# You should have received a copy of the GNU Lesser General Public License |
1381 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1382 | +from autopilot.matchers import Eventually |
1383 | +from testtools.matchers import Equals, Contains |
1384 | +from autopilot.testcase import AutopilotTestCase |
1385 | +from autopilot.process import ProcessManager |
1386 | + |
1387 | +# register xfce4-dict app |
1388 | +ProcessManager.register_known_application( |
1389 | + "xfce4-dict", |
1390 | + "xfce4-dict.desktop", |
1391 | + "xfce4-dict") |
1392 | + |
1393 | +class xfce4DictWindowTests(AutopilotTestCase): |
1394 | + """ Window tests for the dict """ |
1395 | + |
1396 | + def setUp(self): |
1397 | + """ Basic setup instruction to run before each test """ |
1398 | + super(xfce4DictWindowTests, self).setUp() |
1399 | + self.manager = ProcessManager.create('BAMF') |
1400 | + self.app = self.manager.start_app("xfce4-dict") |
1401 | + # This will make sure Mines window you launched is focused and ready |
1402 | + # to accept your keyboard input |
1403 | + self.assertTrue(self.app.is_active) |
1404 | + |
1405 | + def test_window_visible(self): |
1406 | + """ Check to see if the main window has the proper title """ |
1407 | + windows = self.app.get_windows() |
1408 | + window = windows[0] |
1409 | + |
1410 | + # We must assert the window title = Dictionary |
1411 | + # It fails with assertTrue(self.app.is_focused) |
1412 | + self.assertThat(lambda: window.title, Eventually(Contains('Dictionary'))) |
1413 | + |
1414 | + for window in windows: |
1415 | + window.close() |
1416 | |
1417 | === added directory 'xubuntu_autopilot_tests/xfce4-screenshooter' |
1418 | === added file 'xubuntu_autopilot_tests/xfce4-screenshooter/__init__.py' |
1419 | --- xubuntu_autopilot_tests/xfce4-screenshooter/__init__.py 1970-01-01 00:00:00 +0000 |
1420 | +++ xubuntu_autopilot_tests/xfce4-screenshooter/__init__.py 2014-03-30 18:20:04 +0000 |
1421 | @@ -0,0 +1,2 @@ |
1422 | +# -*- coding: utf-8 -*- |
1423 | + |
1424 | |
1425 | === added file 'xubuntu_autopilot_tests/xfce4-screenshooter/test_xfce4_screenshooter.py' |
1426 | --- xubuntu_autopilot_tests/xfce4-screenshooter/test_xfce4_screenshooter.py 1970-01-01 00:00:00 +0000 |
1427 | +++ xubuntu_autopilot_tests/xfce4-screenshooter/test_xfce4_screenshooter.py 2014-03-30 18:20:04 +0000 |
1428 | @@ -0,0 +1,51 @@ |
1429 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
1430 | +# |
1431 | +# Copyright (C) 2014 |
1432 | +# |
1433 | +# Author: Thomas Molloy beetyrootey@gmail.com |
1434 | +# |
1435 | +# This program is free software; you can redistribute it and/or modify |
1436 | +# it under the terms of the GNU Lesser General Public License as published by |
1437 | +# the Free Software Foundation; version 3. |
1438 | +# |
1439 | +# This program is distributed in the hope that it will be useful, |
1440 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1441 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1442 | +# GNU Lesser General Public License for more details. |
1443 | +# |
1444 | +# You should have received a copy of the GNU Lesser General Public License |
1445 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1446 | +from autopilot.matchers import Eventually |
1447 | +from testtools.matchers import Equals, Contains |
1448 | +from autopilot.testcase import AutopilotTestCase |
1449 | +from autopilot.process import ProcessManager |
1450 | + |
1451 | +# register xfce4-screenshooter app |
1452 | +ProcessManager.register_known_application( |
1453 | + "xfce4-screenshooter", |
1454 | + "xfce4-screenshooter.desktop", |
1455 | + "xfce4-screenshooter") |
1456 | + |
1457 | +class xfce4ScreenshooterWindowTests(AutopilotTestCase): |
1458 | + """ Window tests for the xfce4-screenshooter """ |
1459 | + |
1460 | + def setUp(self): |
1461 | + """ Basic setup instruction to run before each test """ |
1462 | + super(xfce4ScreenshooterWindowTests, self).setUp() |
1463 | + self.manager = ProcessManager.create('BAMF') |
1464 | + self.app = self.manager.start_app("xfce4-screenshooter") |
1465 | + # This will make sure Screenshooter window you launched is focused and ready |
1466 | + # to accept your keyboard input |
1467 | + self.assertTrue(self.app.is_active) |
1468 | + |
1469 | + def test_window_visible(self): |
1470 | + """ Check to see if the main window has the proper title """ |
1471 | + windows = self.app.get_windows() |
1472 | + window = windows[0] |
1473 | + |
1474 | + # We must assert the window title = Screenshot |
1475 | + # It fails with assertTrue(self.app.is_focused) |
1476 | + self.assertThat(lambda: window.title, Eventually(Contains('Screenshot'))) |
1477 | + |
1478 | + for window in windows: |
1479 | + window.close() |
1480 | |
1481 | === added directory 'xubuntu_autopilot_tests/xfce4-settings-manager' |
1482 | === added file 'xubuntu_autopilot_tests/xfce4-settings-manager/__init__.py' |
1483 | --- xubuntu_autopilot_tests/xfce4-settings-manager/__init__.py 1970-01-01 00:00:00 +0000 |
1484 | +++ xubuntu_autopilot_tests/xfce4-settings-manager/__init__.py 2014-03-30 18:20:04 +0000 |
1485 | @@ -0,0 +1,2 @@ |
1486 | +# -*- coding: utf-8 -*- |
1487 | + |
1488 | |
1489 | === added file 'xubuntu_autopilot_tests/xfce4-settings-manager/test_xfce4_settings_manager.py' |
1490 | --- xubuntu_autopilot_tests/xfce4-settings-manager/test_xfce4_settings_manager.py 1970-01-01 00:00:00 +0000 |
1491 | +++ xubuntu_autopilot_tests/xfce4-settings-manager/test_xfce4_settings_manager.py 2014-03-30 18:20:04 +0000 |
1492 | @@ -0,0 +1,66 @@ |
1493 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
1494 | +# |
1495 | +# Copyright (C) 2013 |
1496 | +# |
1497 | +# Author: Daniel Chapman daniel@chapman-mail.com |
1498 | +# |
1499 | +# This program is free software; you can redistribute it and/or modify |
1500 | +# it under the terms of the GNU Lesser General Public License as published by |
1501 | +# the Free Software Foundation; version 3. |
1502 | +# |
1503 | +# This program is distributed in the hope that it will be useful, |
1504 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1505 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1506 | +# GNU Lesser General Public License for more details. |
1507 | +# |
1508 | +# You should have received a copy of the GNU Lesser General Public License |
1509 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1510 | +from autopilot.matchers import Eventually |
1511 | +from testtools.matchers import Equals, Contains |
1512 | +from autopilot.testcase import AutopilotTestCase |
1513 | +from autopilot.process import ProcessManager |
1514 | + |
1515 | +# register xfce4-settings-manager app |
1516 | +ProcessManager.register_known_application( |
1517 | + "xfce4-settings-manager", "xfce-settings-manager.desktop", "xfce4-settings-manager") |
1518 | + |
1519 | +class xfce4SettingsManagerindowTests(AutopilotTestCase): |
1520 | + """ Window tests for the xfce4-settings-manager """ |
1521 | + |
1522 | + def setUp(self): |
1523 | + """ Basic setup instruction to run before each test """ |
1524 | + super(xfce4SettingsManagerindowTests, self).setUp() |
1525 | + self.manager = ProcessManager.create('BAMF') |
1526 | + self.app = self.manager.start_app("xfce4-settings-manager") |
1527 | + self.assertTrue(self.app.is_active) |
1528 | + |
1529 | + def test_window_visible(self): |
1530 | + """ Check to see if the main window has the proper title """ |
1531 | + windows = self.app.get_windows() |
1532 | + window = windows[0] |
1533 | + |
1534 | + # We must assert the window title = Settings |
1535 | + # It fails with assertTrue(self.app.is_focused) |
1536 | + self.assertThat(lambda: window.title, Eventually(Contains('Settings'))) |
1537 | + |
1538 | + for window in windows: |
1539 | + window.close() |
1540 | + |
1541 | + def test_main_menu_settings_visible(self, ): |
1542 | + windows = self.app.get_windows() |
1543 | + self.assertTrue(len(windows) == 1) |
1544 | + mainWindow = windows[0] |
1545 | + self.assertTrue(mainWindow.title == "Settings") |
1546 | + self.keyboard.type("Main menu") |
1547 | + self.keyboard.press("Enter") |
1548 | + self.keyboard.press("Enter") |
1549 | + mainMenu = self.manager.get_running_applications() |
1550 | + mainMenuFound = False |
1551 | + for menu in mainMenu: |
1552 | + if menu.name == "Main Menu": |
1553 | + mainMenuFound = True |
1554 | + mainMenuWindows = menu.get_windows() |
1555 | + for window in mainMenuWindows: |
1556 | + window.close() |
1557 | + return |
1558 | + self.assertTrue(mainMenuFound) |
1559 | \ No newline at end of file |
1560 | |
1561 | === added directory 'xubuntu_autopilot_tests/xfce4-taskmanager' |
1562 | === added file 'xubuntu_autopilot_tests/xfce4-taskmanager/__init__.py' |
1563 | --- xubuntu_autopilot_tests/xfce4-taskmanager/__init__.py 1970-01-01 00:00:00 +0000 |
1564 | +++ xubuntu_autopilot_tests/xfce4-taskmanager/__init__.py 2014-03-30 18:20:04 +0000 |
1565 | @@ -0,0 +1,2 @@ |
1566 | +# -*- coding: utf-8 -*- |
1567 | + |
1568 | |
1569 | === added file 'xubuntu_autopilot_tests/xfce4-taskmanager/test_xfce4_taskmanager.py' |
1570 | --- xubuntu_autopilot_tests/xfce4-taskmanager/test_xfce4_taskmanager.py 1970-01-01 00:00:00 +0000 |
1571 | +++ xubuntu_autopilot_tests/xfce4-taskmanager/test_xfce4_taskmanager.py 2014-03-30 18:20:04 +0000 |
1572 | @@ -0,0 +1,51 @@ |
1573 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
1574 | +# |
1575 | +# Copyright (C) 2014 |
1576 | +# |
1577 | +# Author: Thomas Molloy beetyrootey@gmail.com |
1578 | +# |
1579 | +# This program is free software; you can redistribute it and/or modify |
1580 | +# it under the terms of the GNU Lesser General Public License as published by |
1581 | +# the Free Software Foundation; version 3. |
1582 | +# |
1583 | +# This program is distributed in the hope that it will be useful, |
1584 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1585 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1586 | +# GNU Lesser General Public License for more details. |
1587 | +# |
1588 | +# You should have received a copy of the GNU Lesser General Public License |
1589 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1590 | +from autopilot.matchers import Eventually |
1591 | +from testtools.matchers import Equals, Contains |
1592 | +from autopilot.testcase import AutopilotTestCase |
1593 | +from autopilot.process import ProcessManager |
1594 | + |
1595 | +# register xfce4-taskmanager app |
1596 | +ProcessManager.register_known_application( |
1597 | + "xfce4-taskmanager", |
1598 | + "xfce4-taskmanager.desktop", |
1599 | + "xfce4-taskmanager") |
1600 | + |
1601 | +class xfce4TaskmanagerWindowTests(AutopilotTestCase): |
1602 | + """ Window tests for the xfce4-taskmanager """ |
1603 | + |
1604 | + def setUp(self): |
1605 | + """ Basic setup instruction to run before each test """ |
1606 | + super(xfce4TaskmanagerWindowTests, self).setUp() |
1607 | + self.manager = ProcessManager.create('BAMF') |
1608 | + self.app = self.manager.start_app("xfce4-taskmanager") |
1609 | + # This will make sure Notes window you launched is focused and ready |
1610 | + # to accept your keyboard input |
1611 | + self.assertTrue(self.app.is_active) |
1612 | + |
1613 | + def test_window_visible(self): |
1614 | + """ Check to see if the main window has the proper title """ |
1615 | + windows = self.app.get_windows() |
1616 | + window = windows[0] |
1617 | + |
1618 | + # We must assert the window title = Task Manager |
1619 | + # It fails with assertTrue(self.app.is_focused) |
1620 | + self.assertThat(lambda: window.title, Eventually(Contains('Task Manager'))) |
1621 | + |
1622 | + for window in windows: |
1623 | + window.close() |
1624 | |
1625 | === modified file 'xubuntu_autopilot_tests/xfce4-terminal/__init__.py' |
1626 | --- xubuntu_autopilot_tests/xfce4-terminal/__init__.py 2014-01-14 19:00:17 +0000 |
1627 | +++ xubuntu_autopilot_tests/xfce4-terminal/__init__.py 2014-03-30 18:20:04 +0000 |
1628 | @@ -41,4 +41,4 @@ |
1629 | self.keyboard.type('mkdir /tmp/temp-dir\n') |
1630 | self.keyboard.type('touch /tmp/temp-dir/a\n') |
1631 | self.keyboard.type('touch /tmp/temp-dir/b\n') |
1632 | - self.keyboard.type('touch /tmp/temp-dir/c\n') |
1633 | + self.keyboard.type('touch /tmp/temp-dir/c\n') |
1634 | \ No newline at end of file |
1635 | |
1636 | === modified file 'xubuntu_autopilot_tests/xfce4-terminal/test_terminal.py' |
1637 | --- xubuntu_autopilot_tests/xfce4-terminal/test_terminal.py 2014-01-14 19:00:17 +0000 |
1638 | +++ xubuntu_autopilot_tests/xfce4-terminal/test_terminal.py 2014-03-30 18:20:04 +0000 |
1639 | @@ -1,8 +1,8 @@ |
1640 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
1641 | # |
1642 | -# Copyright (C) 2013 |
1643 | +# Copyright (C) 2014 |
1644 | # |
1645 | -# Author: Daniel Chapman daniel@chapman-mail.com |
1646 | +# Author: Thomas Molloy beetyrootey@gmail.com |
1647 | # |
1648 | # This program is free software; you can redistribute it and/or modify |
1649 | # it under the terms of the GNU Lesser General Public License as published by |
Thanks for these tests! Glad to see you trying out autopilot. I'll leave a few quick comments.
You should change the author to be yourself in these tests :-) __init_ _.py, I'm confused why you have terminalapp classes, etc. Is this correct? Actually it seems all of your __init__.py are this way. They can be blank files instead if you don't have a class to put in them :-)
In gmusicbrowser/
In the gmusicbrowser test;
I take it you want the window to be the only one? get_windows( ) (len(windows) == 1)
windows = self.app.
self.assertTrue
This is ok, but note that mainWindow.title will never change as it's already set (well, the app could change it, but I don't think that's what we're looking for here :-) ) I'm not exactly sure you need the eventually here, but if so you should ensure you get the window as part of the lambda function. (lambda: mainWindow.title, Eventually( Contains( 'gmusicbrowser' )))
mainWindow = windows[0]
self.assertThat
Reviewing several apps at once is a bit hard; ideally split these up in the future :-) Overall this is a great first start. It seems you can't get introspection to work for these apps is that correct? If so, I would still like to see a bit more of the application tested if at all possible. I know using process manager will severely limit you, but it's worthwhile to see how creative you can be. Ping me on IRC @ balloons anytime for help or further info. Looking forward to seeing your tweaks.