Merge lp:~chris.gagnon/ubuntu-filemanager-app/autopilot-1.4-update into lp:ubuntu-filemanager-app

Proposed by Chris Gagnon
Status: Merged
Approved by: Francis Ginther
Approved revision: 87
Merged at revision: 86
Proposed branch: lp:~chris.gagnon/ubuntu-filemanager-app/autopilot-1.4-update
Merge into: lp:ubuntu-filemanager-app
Diff against target: 359 lines (+62/-74)
4 files modified
debian/control (+1/-1)
tests/autopilot/ubuntu_filemanager_app/emulators.py (+34/-10)
tests/autopilot/ubuntu_filemanager_app/tests/__init__.py (+7/-3)
tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py (+20/-60)
To merge this branch: bzr merge lp:~chris.gagnon/ubuntu-filemanager-app/autopilot-1.4-update
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Christopher Lee (community) Approve
Thomi Richards (community) Approve
Ubuntu File Manager Developers Pending
Review via email: mp+192702@code.launchpad.net

Commit message

Autopilot tests updated to use autopilot 1.4

Description of the change

Don't land this until we are ready to switch over to autopilot 1.4

To post a comment you must log in.
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

Hi Chris,

A few things:

39 + #Come up with a better name for this function
58 + #Come up with a better name for this function
72 + #Come up with a better name for this function

Probably should remove these comments.

Also, it looks like the only place these functions are used is in the assertions like this:

265 + self.main_view.get_many_folder_actions_popover,
266 + Eventually(Equals([])))

I'd prefer these functions to be refactored so they return a boolean, and can then be called somthing like:

def folder_actions_popover_exists()

which would take care of that naming problem as well.

Other than that, looks good.

review: Needs Fixing
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

Looks good to me!

review: Approve
Revision history for this message
Christopher Lee (veebers) wrote :

The addition of " base.get_launch_commmand " looks good to me.

Revision history for this message
Christopher Lee (veebers) wrote :

Try that again: The addition of " base.get_launch_commmand " looks good to me.

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Francis Ginther (fginther) wrote :

The trusty VM ran out of memory. Re-approving after a reboot of the VM.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Francis Ginther (fginther) wrote :

Trying one more build.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Francis Ginther (fginther) wrote :

These test failures are not a significant regression from the current dashboard results:
http://reports.qa.ubuntu.com/smokeng/trusty/touch/mako/13:20131105.1:20131031.1/4910/ubuntu-filemanager-app-autopilot/

As a result, I'm manually merging these changes to complete the autopilot 1.4 effort.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2013-08-30 17:49:35 +0000
3+++ debian/control 2013-11-04 23:02:37 +0000
4@@ -21,7 +21,7 @@
5
6 Package: ubuntu-filemanager-app-autopilot
7 Architecture: all
8-Depends: libautopilot-qt,
9+Depends: libautopilot-qt (>= 1.4),
10 libqt5test5,
11 python-mock,
12 ubuntu-ui-toolkit-autopilot,
13
14=== modified file 'tests/autopilot/ubuntu_filemanager_app/emulators.py'
15--- tests/autopilot/ubuntu_filemanager_app/emulators.py 2013-08-09 18:41:35 +0000
16+++ tests/autopilot/ubuntu_filemanager_app/emulators.py 2013-11-04 23:02:37 +0000
17@@ -20,6 +20,7 @@
18 import time
19
20 from autopilot import input
21+from autopilot.introspection import dbus
22
23 from ubuntuuitoolkit import emulators as toolkit_emulators
24
25@@ -35,13 +36,21 @@
26
27 def get_file_actions_popover(self):
28 """Return the ActionSelectionPopover emulator of the file actions."""
29- return self.select_single(
30+ return self.wait_select_single(
31 ActionSelectionPopover, objectName='fileActionsPopover')
32
33 def get_folder_actions_popover(self):
34 """Return the ActionSelectionPopover emulator of the folder actions."""
35- return self.select_single(
36- ActionSelectionPopover, objectName='folderActionsPopover')
37+ return self.wait_select_single(
38+ ActionSelectionPopover, objectName='folderActionsPopover')
39+
40+ def folder_actions_popover_exists(self):
41+ """Boolean, checks if the Actions Popover exists."""
42+ popover = self.select_many(
43+ ActionSelectionPopover, objectName='folderActionsPopover')
44+ if popover == '[]':
45+ return True
46+ return False
47
48 def get_places_popover(self):
49 """Return the Places popover."""
50@@ -57,18 +66,36 @@
51
52 def get_file_details_popover(self):
53 """Return the FileDetailsPopover emulator."""
54- return self.select_single(FileDetailsPopover)
55+ return self.wait_select_single(FileDetailsPopover)
56
57 def get_file_action_dialog(self):
58 """Return the FileActionDialog emulator."""
59- return self.select_single(FileActionDialog)
60+ return self.wait_select_single(FileActionDialog)
61+
62+ def file_action_dialog_exists(self):
63+ """Boolean checks if the FileActionDialog exists."""
64+ dialog = self.select_many(FileActionDialog)
65+ if dialog == '[]':
66+ return True
67+ return False
68
69 def get_confirm_dialog(self):
70- dialog = self.select_single(ConfirmDialog)
71- if dialog is None:
72+ """Return a confirm dialog emulator"""
73+ try:
74+ dialog = self.select_single(ConfirmDialog)
75+ except dbus.StateNotFoundError:
76 dialog = self.select_single(ConfirmDialogWithInput)
77 return dialog
78
79+ def confirm_dialog_exists(self):
80+ """Boolean checks if a confirm dialog exists"""
81+ dialog = self.select_many(ConfirmDialog)
82+ if dialog == '[]':
83+ dialog = self.select_many(ConfirmDialogWithInput)
84+ if dialog == '[]':
85+ return True
86+ return False
87+
88
89 class Sidebar(toolkit_emulators.UbuntuUIToolkitEmulatorBase):
90 """PlacesSidebar Autopilot emulator."""
91@@ -232,9 +259,6 @@
92
93 """
94 button = self._get_button(text)
95- if button is None:
96- raise ValueError(
97- 'Button with text "{0}" not found.'.format(text))
98 self.pointing_device.click_object(button)
99
100 def _get_button(self, text):
101
102=== modified file 'tests/autopilot/ubuntu_filemanager_app/tests/__init__.py'
103--- tests/autopilot/ubuntu_filemanager_app/tests/__init__.py 2013-10-14 20:56:55 +0000
104+++ tests/autopilot/ubuntu_filemanager_app/tests/__init__.py 2013-11-04 23:02:37 +0000
105@@ -16,9 +16,13 @@
106 from autopilot.platform import model
107 from autopilot.testcase import AutopilotTestCase
108
109-from ubuntuuitoolkit import emulators as toolkit_emulators
110 from ubuntu_filemanager_app import emulators
111
112+from ubuntuuitoolkit import (
113+ base,
114+ emulators as toolkit_emulators
115+)
116+
117
118 class FileManagerTestCase(AutopilotTestCase):
119
120@@ -75,14 +79,14 @@
121
122 def launch_test_local(self):
123 self.app = self.launch_test_application(
124- "qmlscene",
125+ base.get_qmlscene_launch_command(),
126 self.local_location,
127 app_type='qt',
128 emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)
129
130 def launch_test_installed(self):
131 self.app = self.launch_test_application(
132- "qmlscene",
133+ base.get_qmlscene_launch_command(),
134 self.installed_location,
135 "--desktop_file_hint="
136 "/usr/share/applications/ubuntu-filemanager-app.desktop",
137
138=== modified file 'tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py'
139--- tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py 2013-10-14 20:56:55 +0000
140+++ tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py 2013-11-04 23:02:37 +0000
141@@ -27,7 +27,7 @@
142 from autopilot import process
143 from autopilot.platform import model
144 from autopilot.matchers import Eventually
145-from testtools.matchers import Equals, NotEquals, Not, Is
146+from testtools.matchers import Equals
147
148 from ubuntu_filemanager_app.tests import FileManagerTestCase
149
150@@ -58,9 +58,6 @@
151 def _assert_number_of_files(self, expected_number_of_files, home=True):
152 if home:
153 expected_number_of_files += self.original_file_count
154- self.assertThat(
155- self.main_view.get_folder_list_page,
156- Eventually(Not(Is(None))))
157 folder_list_page = self.main_view.get_folder_list_page()
158 self.assertThat(
159 folder_list_page.get_number_of_files_from_list,
160@@ -70,16 +67,10 @@
161 Eventually(Equals(expected_number_of_files)))
162
163 def _get_file_by_name(self, name):
164- self.assertThat(
165- self.main_view.get_folder_list_page,
166- Eventually(Not(Is(None))))
167 folder_list_page = self.main_view.get_folder_list_page()
168 return folder_list_page.get_file_by_name(name)
169
170 def _get_file_by_index(self, index):
171- self.assertThat(
172- self.main_view.get_folder_list_page,
173- Eventually(Not(Is(None))))
174 folder_list_page = self.main_view.get_folder_list_page()
175 return folder_list_page.get_file_by_index(index)
176
177@@ -121,14 +112,8 @@
178
179 def _do_action_on_file(self, file_, action):
180 file_.open_actions_popover()
181- self.assertThat(
182- self.main_view.get_file_actions_popover,
183- Eventually(NotEquals(None)))
184 file_actions_popover = self.main_view.get_file_actions_popover()
185 file_actions_popover.click_button(action)
186- self.assertThat(
187- self.main_view.get_file_actions_popover,
188- Eventually(Equals(None)))
189
190 def _cancel_confirm_dialog(self):
191 confirm_dialog = self.main_view.get_confirm_dialog()
192@@ -165,9 +150,8 @@
193 original_apps = process_manager.get_running_applications()
194
195 dialog.open()
196- self.assertThat(
197- self.main_view.get_file_action_dialog,
198- Eventually(Equals(None)))
199+ #make sure the dialog is open
200+ self.main_view.get_file_action_dialog()
201 # Filtering copied from
202 # AutopilotTestCase._compare_system_with_app_snapshot.
203 current_apps = self.process_manager.get_running_applications()
204@@ -197,8 +181,9 @@
205 self._do_action_on_file(first_dir, action='Rename')
206 self._confirm_dialog(new_name)
207
208- self.assertThat(
209- self.main_view.get_confirm_dialog, Eventually(Equals(None)))
210+ #make sure confirm dialog is open
211+ self.main_view.get_confirm_dialog()
212+
213 self.assertThat(
214 lambda: first_dir.fileName, Eventually(Equals(new_name)))
215
216@@ -222,9 +207,6 @@
217 first_file = self._get_file_by_name(dir_path)
218 first_file.open_actions_popover()
219
220- self.assertThat(
221- self.main_view.get_file_actions_popover,
222- Eventually(Not(Is(None))))
223 file_actions_popover = self.main_view.get_file_actions_popover()
224 self.assertThat(
225 lambda: file_actions_popover.visible, Eventually(Equals(True)))
226@@ -252,8 +234,10 @@
227 dialog = self.main_view.get_file_action_dialog()
228 dialog.visible.wait_for(True)
229 dialog.cancel()
230+
231 self.assertThat(
232- self.main_view.get_file_action_dialog, Eventually(Equals(None)))
233+ self.main_view.file_action_dialog_exists,
234+ Eventually(Equals(False)))
235
236 def test_cancel_rename_directory(self):
237 dir_path = self._make_directory_in_home()
238@@ -264,7 +248,7 @@
239 self._cancel_confirm_dialog()
240
241 self.assertThat(
242- self.main_view.get_confirm_dialog, Eventually(Equals(None)))
243+ self.main_view.confirm_dialog_exists, Eventually(Equals(False)))
244 self.assertThat(
245 lambda: first_dir.fileName, Eventually(Equals(dir_name)))
246
247@@ -277,8 +261,7 @@
248 self._cancel_confirm_dialog()
249
250 self.assertThat(
251- self.main_view.get_confirm_dialog,
252- Eventually(Equals(None)))
253+ self.main_view.confirm_dialog_exists, Eventually(Equals(False)))
254 self.assertThat(
255 lambda: first_file.fileName,
256 Eventually(Equals(file_name)))
257@@ -293,7 +276,7 @@
258 self._confirm_dialog(new_name)
259
260 self.assertThat(
261- self.main_view.get_confirm_dialog, Eventually(Equals(None)))
262+ self.main_view.confirm_dialog_exists, Eventually(Equals(False)))
263 self.assertThat(
264 lambda: first_file.fileName, Eventually(Equals(new_name)))
265
266@@ -341,10 +324,6 @@
267 toolbar = self.main_view.open_toolbar()
268 toolbar.click_button('actions')
269
270- self.assertThat(
271- self.main_view.get_folder_actions_popover,
272- Eventually(Not(Is(None))))
273-
274 folder_actions_popover = self.main_view.get_folder_actions_popover()
275 folder_actions_popover.click_button('Create New Folder')
276 self._confirm_dialog(dir_name)
277@@ -408,15 +387,11 @@
278 toolbar = self.main_view.open_toolbar()
279 toolbar.click_button('actions')
280
281- self.assertThat(
282- self.main_view.get_folder_actions_popover,
283- Eventually(Not(Is(None))))
284-
285 folder_actions_popover = self.main_view.get_folder_actions_popover()
286 folder_actions_popover.click_button('Paste 1 File')
287 self.assertThat(
288- self.main_view.get_folder_actions_popover,
289- Eventually(Equals(None)))
290+ self.main_view.folder_actions_popover_exists,
291+ Eventually(Equals(False)))
292
293 # Check that the directory is there.
294 self._assert_number_of_files(1, home=False)
295@@ -458,15 +433,11 @@
296 toolbar = self.main_view.open_toolbar()
297 toolbar.click_button('actions')
298
299- self.assertThat(
300- self.main_view.get_folder_actions_popover,
301- Eventually(Not(Is(None))))
302-
303 folder_actions_popover = self.main_view.get_folder_actions_popover()
304 folder_actions_popover.click_button('Paste 1 File')
305 self.assertThat(
306- self.main_view.get_folder_actions_popover,
307- Eventually(Equals(None)))
308+ self.main_view.folder_actions_popover_exists,
309+ Eventually(Equals(False)))
310
311 # Check that the directory is there.
312 self._assert_number_of_files(1, home=False)
313@@ -508,16 +479,12 @@
314 toolbar = self.main_view.open_toolbar()
315 toolbar.click_button('actions')
316
317- self.assertThat(
318- self.main_view.get_folder_actions_popover,
319- Eventually(Not(Is(None))))
320-
321 folder_actions_popover = self.main_view.get_folder_actions_popover()
322 folder_actions_popover.click_button('Paste 1 File')
323
324 self.assertThat(
325- self.main_view.get_folder_actions_popover,
326- Eventually(Equals(None)))
327+ self.main_view.folder_actions_popover_exists,
328+ Eventually(Equals(False)))
329
330 # Check that the file is there.
331 self._assert_number_of_files(1)
332@@ -558,15 +525,11 @@
333 toolbar = self.main_view.open_toolbar()
334 toolbar.click_button('actions')
335
336- self.assertThat(
337- self.main_view.get_folder_actions_popover,
338- Eventually(Not(Is(None))))
339-
340 folder_actions_popover = self.main_view.get_folder_actions_popover()
341 folder_actions_popover.click_button('Paste 1 File')
342 self.assertThat(
343- self.main_view.get_folder_actions_popover,
344- Eventually(Equals(None)))
345+ self.main_view.folder_actions_popover_exists,
346+ Eventually(Equals(False)))
347
348 # Check that the file is there.
349 self._assert_number_of_files(1, home=False)
350@@ -620,9 +583,6 @@
351 first_file = self._get_file_by_name(file_name)
352 first_file.open_actions_popover()
353
354- self.assertThat(
355- self.main_view.get_file_actions_popover,
356- Eventually(Not(Is(None))))
357 file_actions_popover = self.main_view.get_file_actions_popover()
358 self.assertThat(
359 lambda: file_actions_popover.visible, Eventually(Equals(True)))

Subscribers

People subscribed via source and target branches