Merge lp:~carla-sella/ubuntu-filemanager-app/test-places-fixed into lp:ubuntu-filemanager-app

Proposed by Carla Sella
Status: Merged
Approved by: Nicholas Skaggs
Approved revision: 347
Merged at revision: 328
Proposed branch: lp:~carla-sella/ubuntu-filemanager-app/test-places-fixed
Merge into: lp:ubuntu-filemanager-app
Diff against target: 449 lines (+122/-81)
6 files modified
README (+21/-3)
po/com.ubuntu.filemanager.pot (+50/-46)
src/app/qml/ui/PlacesPage.qml (+3/-0)
tests/autopilot/filemanager/__init__.py (+37/-16)
tests/autopilot/filemanager/tests/__init__.py (+1/-0)
tests/autopilot/filemanager/tests/test_places.py (+10/-16)
To merge this branch: bzr merge lp:~carla-sella/ubuntu-filemanager-app/test-places-fixed
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Nicholas Skaggs (community) Needs Fixing
Review via email: mp+241206@code.launchpad.net

Commit message

Fixed autopilot places tests for filemanager app.

Description of the change

Fixed two tests in test_places.py, but cannot test on device, so I'm proposing merge to see if in Jenkins tests pass.

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
327. By Carla Sella

Modifies README file.

328. By Carla Sella

Fixed pep8 and pyflakes.

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
Carla Sella (carla-sella) wrote :

The error is quite weired as the 'Standard' object with objectName: 'placeHome' exists and so the 'placeDevice', see https://dl.dropboxusercontent.com/u/10083981/Ubuntu%20errors/filemanager-places.png.

329. By Carla Sella

Fixed wrong syntax of objectName.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
330. By Carla Sella

Trying to verify if error is a timing issue.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
331. By Carla Sella

Fixed pep8 error.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
332. By Carla Sella

Deleted sleep.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
333. By Carla Sella

Fixed test_go_to_root_must_open_the_root_directory.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
334. By Carla Sella

Other change to test_go_to_root_must_open_the_root_directory.

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
Nicholas Skaggs (nskaggs) wrote :

The test results look good. You'll have to tweak the test about root to point to "HOME"; including our mocked home when mocked, and actual root when it's not mocked.

filemanager.tests.test_places.PlacesTestCase.test_go_to_root_must_open_the_root_directory

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

A few comments. Overall looks good.

335. By Carla Sella

Fixed test_go_to_root_must_open_the_root_directory.

Revision history for this message
Carla Sella (carla-sella) wrote :

I managed to test test_go_to_root_must_open_the_root_directory on my device and test passes now, so everything should be fine now.

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
Carla Sella (carla-sella) wrote :

@Nicholas: I do not understand why the test fails with:

MismatchError: After 10.0 seconds test failed: '/' != '/tmp/tmp2tsfl4lb'

as I suppose the root directory is "/" on every device you test, or am I wrong ?

I managed to run this test on my device and the test passes and also on the desktop.

336. By Carla Sella

Fixed timing issue.

337. By Carla Sella

Fixed syntax error.

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)
338. By Carla Sella

Fixed timing issue.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
339. By Carla Sella

Ajusted minor thing.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
340. By Carla Sella

Fixed self error.

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
Carla Sella (carla-sella) wrote :

@Nicholas,this time I do not understand the failure, even the video doesn't help.

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Carla, the error looks the same (a little better, but the same). The page is still not quite loaded, so clicking 'devices' is not registered.

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Left some comments

341. By Carla Sella

Trying other property for Places Page.

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

Hey Nicholas, looks like I found the right property to use :-).

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Awesome! I will happily approve and merge this! But I would still move the code to the open bottom edge method so it gets run by anyone who calls it. Make sense? I'd move

+ placespage.wait_select_single(
339 + "QQuickFlickable", objectName="placesFlickable")\
340 + .dragging.wait_for(False)

to the end of

_drag_bottomedge_to_open_places()

review: Needs Fixing
Revision history for this message
Carla Sella (carla-sella) wrote :

Yes it makes sense, but If I put it there it fails with a StateNotFoundError.
That's quite weird as it should not make a big difference putting it at the end of _drag_bottomedge_to_open_places() compared to where it's now, but it fails :(.
Maybe it's another timing issue.

http://paste.ubuntu.com/9027177/

Revision history for this message
Carla Sella (carla-sella) wrote :

I have tried testing several properties of Places Page and QQuickFlickable ("placesFlickable") but I keep on getting test failures this is the last try: https://code.launchpad.net/~carla-sella/junk/filemanager-try with this output when ran on my device: http://paste.ubuntu.com/9046535/.
It's as if the test fails before the Places page completly loads.

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Mmm, let's wrap this up on IRC. Should be a simple solution as what you have in rev 341 works.

review: Needs Fixing
342. By Carla Sella

For checking if in Jenkins test works.

343. By Carla Sella

Fixed syntax error.

Revision history for this message
Carla Sella (carla-sella) wrote :

Nicholas: the test runs fine now on my PC and on device.
So if it passes on Jenkins it should be ok.
For the -p in launch_test_local should that be deleted or kept ?

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
Nicholas Skaggs (nskaggs) wrote :

Leave the phone mode for now; I'll file a bug right now so I don't forget so support is added for both:

https://bugs.launchpad.net/ubuntu-filemanager-app/+bug/1393973

Looks like in jenkins it's still suffering a bit from the timing issue; the page isn't quite loaded while it's trying to tap.

review: Needs Fixing
344. By Carla Sella

Added wait for active property to be true on Places Page.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
345. By Carla Sella

Fixed error in code.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
346. By Carla Sella

Deleted erroneous self.

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

=== modified file 'tests/autopilot/filemanager/__init__.py'
--- tests/autopilot/filemanager/__init__.py 2014-11-19 20:24:25 +0000
+++ tests/autopilot/filemanager/__init__.py 2014-11-19 21:23:13 +0000
@@ -71,13 +71,10 @@

     def get_folder_list_page(self):
         """Return the FolderListPage emulator of the MainView."""
- page = self.wait_select_single(FolderListPage)
- page.main_view = self
- return page
+ return self.wait_select_single(FolderListPage)

     def _go_to_place_from_places_page(self, object_name):
         placespage = self.open_places()
- self.placespage.active.wait_for(True)
         placespage.go_to_place(object_name)

     @autopilot.logging.log_action(logger.info)
@@ -107,9 +104,9 @@
             logger.error('BottomEdge element not found.')
             raise

- self.wait_select_single(
- "QQuickFlickable", objectName="placesFlickable")\
- .dragging.wait_for(False)
+ flickable = self.wait_select_single(
+ "QQuickFlickable", objectName="placesFlickable")
+ flickable.wait_until_destroyed()

     @autopilot.logging.log_action(logger.info)
     def rename(self, original_name, new_name):

review: Needs Fixing
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
347. By Carla Sella

Checked for flickable to be destroyed.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README'
2--- README 2014-08-09 19:16:02 +0000
3+++ README 2014-11-19 21:30:40 +0000
4@@ -27,7 +27,7 @@
5 password
6 4. Once created, you'll need to add the build dependencies for the app:
7 - Click on the Maintain button on your chroot
8- - On the terminal prompt that is started, type
9+ - On the terminal prompt that is started, type
10 apt-get install libtag1-dev:armhf libpam0g-dev:armhf python3
11 - Close the terminal when the installation finishes
12 5. Now you can either do a clean checkout and wait to be prompted by Qt Creator
13@@ -56,11 +56,17 @@
14
15 No additional steps are required before running the app on the desktop.
16
17+You can pass two switches to run in phone or tablet mode from the desktop:
18+
19+-p for phone mode
20+-t for tablet mode
21+
22+
23 ### On a device
24
25 Due to Qt Creator's bug #1312094 in launchpad.net, there needs to be a manual
26 workaround done before the app can run on the device:
27-
28+
29 1. Modify the desktop.in file: change the Exec line to read:
30 Exec=lib/arm-linux-gnueabihf/bin/@EXEC@
31
32@@ -147,5 +153,17 @@
33 Once the app has been built, you can go to the build directory and run:
34
35 cd tests/autopilot
36- autopilot run filemanager
37+ autopilot3 run filemanager
38+
39+You can run filemanager in phone or tablet mode passing one of these two switches:
40+
41+-p for phone mode
42+-t for tablet mode
43+
44+so:
45+
46+autopilot3 launch ../../src/app/filemanager -p
47+
48+will launch filemanager with autopilot in phone mode.
49+
50
51
52=== modified file 'po/com.ubuntu.filemanager.pot'
53--- po/com.ubuntu.filemanager.pot 2014-10-25 00:00:57 +0000
54+++ po/com.ubuntu.filemanager.pot 2014-11-19 21:30:40 +0000
55@@ -8,7 +8,7 @@
56 msgstr ""
57 "Project-Id-Version: \n"
58 "Report-Msgid-Bugs-To: \n"
59-"POT-Creation-Date: 2014-10-24 16:57-0700\n"
60+"POT-Creation-Date: 2014-11-19 21:32+0100\n"
61 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
62 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
63 "Language-Team: LANGUAGE <LL@li.org>\n"
64@@ -31,7 +31,7 @@
65 msgstr ""
66
67 #: ../src/app/qml/components/PathHistoryRow.qml:84
68-#: ../src/app/qml/ui/FolderListPage.qml:617
69+#: ../src/app/qml/ui/FolderListPage.qml:620
70 msgid "Device"
71 msgstr ""
72
73@@ -44,21 +44,21 @@
74 msgid "Open with"
75 msgstr ""
76
77-#: ../src/app/qml/filemanager.qml:90 ../src/app/qml/ui/FolderListPage.qml:102
78+#: ../src/app/qml/filemanager.qml:81 ../src/app/qml/ui/FolderListPage.qml:102
79 #: ../src/app/qml/ui/SettingsSheet.qml:31
80 msgid "Settings"
81 msgstr ""
82
83-#: ../src/app/qml/filemanager.qml:91
84+#: ../src/app/qml/filemanager.qml:82
85 msgid "Change app settings"
86 msgstr ""
87
88-#: ../src/app/qml/filemanager.qml:268 ../src/app/qml/ui/FolderListPage.qml:349
89+#: ../src/app/qml/filemanager.qml:259 ../src/app/qml/ui/FolderListPage.qml:352
90 #: ../src/app/qml/ui/ViewPopover.qml:70
91 msgid "Icons"
92 msgstr ""
93
94-#: ../src/app/qml/filemanager.qml:268 ../src/app/qml/ui/FolderListPage.qml:365
95+#: ../src/app/qml/filemanager.qml:259 ../src/app/qml/ui/FolderListPage.qml:368
96 #: ../src/app/qml/ui/ViewPopover.qml:71
97 msgid "List"
98 msgstr ""
99@@ -68,7 +68,7 @@
100 msgstr ""
101
102 #: ../src/app/qml/ui/AuthenticationDialog.qml:27
103-msgid "Enter password:"
104+msgid "Password is required to access all files"
105 msgstr ""
106
107 #: ../src/app/qml/ui/AuthenticationDialog.qml:39
108@@ -87,7 +87,7 @@
109 #: ../src/app/qml/ui/ConfirmDialogWithInput.qml:57
110 #: ../src/app/qml/ui/FileActionDialog.qml:45
111 #: ../src/app/qml/ui/FileOperationProgressDialog.qml:44
112-#: ../src/app/qml/ui/FolderListPage.qml:304
113+#: ../src/app/qml/ui/FolderListPage.qml:330
114 #: ../src/app/qml/ui/GoToDialog.qml:66
115 msgid "Cancel"
116 msgstr ""
117@@ -166,7 +166,7 @@
118
119 #: ../src/app/qml/ui/FolderListPage.qml:74
120 #: ../src/app/qml/ui/FolderListPage.qml:92
121-#: ../src/app/qml/ui/FolderListPage.qml:508
122+#: ../src/app/qml/ui/FolderListPage.qml:511
123 msgid "Properties"
124 msgstr ""
125
126@@ -178,118 +178,122 @@
127 msgid "Go To"
128 msgstr ""
129
130-#: ../src/app/qml/ui/FolderListPage.qml:176
131+#: ../src/app/qml/ui/FolderListPage.qml:116
132+msgid "Unlock full access"
133+msgstr ""
134+
135+#: ../src/app/qml/ui/FolderListPage.qml:130
136+msgid "Authentication failed"
137+msgstr ""
138+
139+#: ../src/app/qml/ui/FolderListPage.qml:202
140 #, qt-format
141 msgid "%1 file"
142 msgid_plural "%1 files"
143 msgstr[0] ""
144 msgstr[1] ""
145
146-#: ../src/app/qml/ui/FolderListPage.qml:201
147+#: ../src/app/qml/ui/FolderListPage.qml:227
148 msgid "Open in a new tab"
149 msgstr ""
150
151-#: ../src/app/qml/ui/FolderListPage.qml:209
152+#: ../src/app/qml/ui/FolderListPage.qml:235
153 msgid "Close this tab"
154 msgstr ""
155
156-#: ../src/app/qml/ui/FolderListPage.qml:222
157+#: ../src/app/qml/ui/FolderListPage.qml:248
158 msgid "Create folder"
159 msgstr ""
160
161-#: ../src/app/qml/ui/FolderListPage.qml:223
162+#: ../src/app/qml/ui/FolderListPage.qml:249
163 msgid "Enter name for new folder"
164 msgstr ""
165
166-#: ../src/app/qml/ui/FolderListPage.qml:239
167+#: ../src/app/qml/ui/FolderListPage.qml:265
168 msgid "Create file"
169 msgstr ""
170
171-#: ../src/app/qml/ui/FolderListPage.qml:240
172+#: ../src/app/qml/ui/FolderListPage.qml:266
173 msgid "Enter name for new file"
174 msgstr ""
175
176-#: ../src/app/qml/ui/FolderListPage.qml:289
177+#: ../src/app/qml/ui/FolderListPage.qml:315
178 msgid "Select"
179 msgstr ""
180
181-#: ../src/app/qml/ui/FolderListPage.qml:312
182-msgid "Unlock full access"
183-msgstr ""
184-
185-#: ../src/app/qml/ui/FolderListPage.qml:326
186-msgid "Authentication failed"
187-msgstr ""
188-
189-#: ../src/app/qml/ui/FolderListPage.qml:380
190+#: ../src/app/qml/ui/FolderListPage.qml:383
191 msgid "No files"
192 msgstr ""
193
194-#: ../src/app/qml/ui/FolderListPage.qml:400
195-#: ../src/app/qml/ui/FolderListPage.qml:482
196+#: ../src/app/qml/ui/FolderListPage.qml:403
197+#: ../src/app/qml/ui/FolderListPage.qml:485
198 msgid "Delete"
199 msgstr ""
200
201-#: ../src/app/qml/ui/FolderListPage.qml:401
202+#: ../src/app/qml/ui/FolderListPage.qml:404
203 #, qt-format
204 msgid "Are you sure you want to permanently delete '%1'?"
205 msgstr ""
206
207-#: ../src/app/qml/ui/FolderListPage.qml:424
208-#: ../src/app/qml/ui/FolderListPage.qml:495
209+#: ../src/app/qml/ui/FolderListPage.qml:409
210+msgid "Deleting files"
211+msgstr ""
212+
213+#: ../src/app/qml/ui/FolderListPage.qml:427
214+#: ../src/app/qml/ui/FolderListPage.qml:498
215 msgid "Rename"
216 msgstr ""
217
218-#: ../src/app/qml/ui/FolderListPage.qml:425
219+#: ../src/app/qml/ui/FolderListPage.qml:428
220 msgid "Enter a new name"
221 msgstr ""
222
223-#: ../src/app/qml/ui/FolderListPage.qml:434
224+#: ../src/app/qml/ui/FolderListPage.qml:437
225 msgid "Could not rename"
226 msgstr ""
227
228-#: ../src/app/qml/ui/FolderListPage.qml:435
229+#: ../src/app/qml/ui/FolderListPage.qml:438
230 msgid "Insufficient permissions or name already exists?"
231 msgstr ""
232
233-#: ../src/app/qml/ui/FolderListPage.qml:459
234+#: ../src/app/qml/ui/FolderListPage.qml:462
235 msgid "Cut"
236 msgstr ""
237
238-#: ../src/app/qml/ui/FolderListPage.qml:470
239+#: ../src/app/qml/ui/FolderListPage.qml:473
240 msgid "Copy"
241 msgstr ""
242
243-#: ../src/app/qml/ui/FolderListPage.qml:528
244+#: ../src/app/qml/ui/FolderListPage.qml:531
245 msgid "File operation error"
246 msgstr ""
247
248-#: ../src/app/qml/ui/FolderListPage.qml:588
249+#: ../src/app/qml/ui/FolderListPage.qml:591
250 msgid "~/Desktop"
251 msgstr ""
252
253-#: ../src/app/qml/ui/FolderListPage.qml:598
254+#: ../src/app/qml/ui/FolderListPage.qml:601
255 msgid "~/Public"
256 msgstr ""
257
258-#: ../src/app/qml/ui/FolderListPage.qml:600
259+#: ../src/app/qml/ui/FolderListPage.qml:603
260 msgid "~/Programs"
261 msgstr ""
262
263-#: ../src/app/qml/ui/FolderListPage.qml:602
264+#: ../src/app/qml/ui/FolderListPage.qml:605
265 msgid "~/Templates"
266 msgstr ""
267
268-#: ../src/app/qml/ui/FolderListPage.qml:615
269+#: ../src/app/qml/ui/FolderListPage.qml:618
270 msgid "Home"
271 msgstr ""
272
273-#: ../src/app/qml/ui/FolderListPage.qml:685
274+#: ../src/app/qml/ui/FolderListPage.qml:688
275 msgid "Folder not accessible"
276 msgstr ""
277
278 #. TRANSLATORS: this refers to a folder name
279-#: ../src/app/qml/ui/FolderListPage.qml:687
280+#: ../src/app/qml/ui/FolderListPage.qml:690
281 #, qt-format
282 msgid "Can not access %1"
283 msgstr ""
284@@ -302,12 +306,12 @@
285 msgid "Enter a location to go to:"
286 msgstr ""
287
288-#: ../src/app/qml/ui/GoToDialog.qml:44 ../src/app/qml/ui/PlacesPage.qml:59
289+#: ../src/app/qml/ui/GoToDialog.qml:44 ../src/app/qml/ui/PlacesPage.qml:62
290 #: ../src/app/qml/ui/PlacesPopover.qml:67
291 msgid "Location..."
292 msgstr ""
293
294-#: ../src/app/qml/ui/GoToDialog.qml:53 ../src/app/qml/ui/PlacesPage.qml:74
295+#: ../src/app/qml/ui/GoToDialog.qml:53 ../src/app/qml/ui/PlacesPage.qml:77
296 #: ../src/app/qml/ui/PlacesPopover.qml:82
297 msgid "Go"
298 msgstr ""
299
300=== modified file 'src/app/qml/ui/PlacesPage.qml'
301--- src/app/qml/ui/PlacesPage.qml 2014-10-21 18:57:13 +0000
302+++ src/app/qml/ui/PlacesPage.qml 2014-11-19 21:30:40 +0000
303@@ -27,8 +27,11 @@
304
305 title: i18n.tr("Places")
306 objectName: 'PlacesPage'
307+ // ADDED THIS PROPERTY FOR BUG #1341671 WORKAROUND
308+ property string testProperty: "justForAutopilotTests"
309
310 Flickable {
311+ objectName: "placesFlickable"
312 anchors.fill: parent
313
314 Column {
315
316=== modified file 'tests/autopilot/filemanager/__init__.py'
317--- tests/autopilot/filemanager/__init__.py 2014-10-24 14:25:32 +0000
318+++ tests/autopilot/filemanager/__init__.py 2014-11-19 21:30:40 +0000
319@@ -63,7 +63,7 @@
320 if self.showSidebar:
321 self._go_to_place_from_side_bar(object_name)
322 else:
323- self._go_to_place_from_popover(object_name)
324+ self._go_to_place_from_places_page(object_name)
325
326 def _go_to_place_from_side_bar(self, object_name):
327 side_bar = self.get_folder_list_page().get_sidebar()
328@@ -75,27 +75,40 @@
329 page.main_view = self
330 return page
331
332- def _go_to_place_from_popover(self, object_name):
333- popover = self.open_places()
334- place = popover.wait_select_single('Standard', objectName=object_name)
335- self.pointing_device.click_object(place)
336+ def _go_to_place_from_places_page(self, object_name):
337+ placespage = self.open_places()
338+ placespage.go_to_place(object_name)
339
340 @autopilot.logging.log_action(logger.info)
341 def open_places(self):
342 if not self.showSidebar:
343- self.open_toolbar().click_button('places')
344- return self._get_places_popover()
345+ self._drag_bottomedge_to_open_places()
346+ return self.wait_select_single(PlacesPage)
347 else:
348 raise FilemanagerException(
349- 'The places popover cannot be opened on wide mode.')
350-
351- def _get_places_popover(self):
352- """Return the Places popover."""
353- # XXX It would be easier if the places popover was an object
354- # that inherits from Popover, like the
355- # ActionSelectionPopover does.
356- # --elopio - 2013-07-25
357- return self.wait_select_single('Popover', objectName='placesPopover')
358+ 'The places page cannot be opened on wide mode.')
359+
360+ def _drag_bottomedge_to_open_places(self):
361+ """Bring the places page to the screen"""
362+ try:
363+ action_item = self.wait_select_single(
364+ 'ShapeItem', objectName='bottomEdgeTip')
365+ action_item.enabled.wait_for(True)
366+ start_x = (action_item.globalRect.x +
367+ (action_item.globalRect.width * 0.5))
368+ start_y = (action_item.globalRect.y +
369+ (action_item.height * 0.5))
370+ stop_y = start_y - (self.height * 0.7)
371+ self.pointing_device.drag(start_x, start_y,
372+ start_x, stop_y, rate=2)
373+
374+ except dbus.StateNotFoundError:
375+ logger.error('BottomEdge element not found.')
376+ raise
377+
378+ flickable = self.wait_select_single(
379+ "QQuickFlickable", objectName="placesFlickable")
380+ flickable.wait_until_destroyed()
381
382 @autopilot.logging.log_action(logger.info)
383 def rename(self, original_name, new_name):
384@@ -316,6 +329,14 @@
385 'Path bar is hidden in small mode.')
386
387
388+class PlacesPage(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
389+ """Places Page Autopilot emulator."""
390+
391+ def go_to_place(self, object_name):
392+ place = self.wait_select_single('Standard', objectName=object_name)
393+ self.pointing_device.click_object(place)
394+
395+
396 class FolderListView(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
397 """FolderListView Autopilot emulator."""
398
399
400=== modified file 'tests/autopilot/filemanager/tests/__init__.py'
401--- tests/autopilot/filemanager/tests/__init__.py 2014-10-10 22:29:32 +0000
402+++ tests/autopilot/filemanager/tests/__init__.py 2014-11-19 21:30:40 +0000
403@@ -84,6 +84,7 @@
404 'src', 'plugin')))
405 return self.launch_test_application(
406 self.local_location_binary,
407+ '-p',
408 '-q', self.local_location_qml,
409 app_type='qt',
410 emulator_base=ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase)
411
412=== modified file 'tests/autopilot/filemanager/tests/test_places.py'
413--- tests/autopilot/filemanager/tests/test_places.py 2014-10-25 01:21:48 +0000
414+++ tests/autopilot/filemanager/tests/test_places.py 2014-11-19 21:30:40 +0000
415@@ -25,24 +25,18 @@
416
417 def test_go_home_must_open_the_home_directory(self):
418 """Test that opens the Home bookmark from the places section."""
419- # TODO: there is no support for bottom edge folder list yet, so
420- # for now disable it
421- if self.app.main_view.showSidebar:
422- self.app.main_view.go_to_place('placeHome')
423+ self.app.main_view.go_to_place('placeHome')
424
425- folder_list_page = self.app.main_view.get_folder_list_page()
426- self.assertThat(
427- folder_list_page.get_current_path,
428- Eventually(Equals(self.fakehome)))
429+ folder_list_page = self.app.main_view.get_folder_list_page()
430+ self.assertThat(
431+ folder_list_page.get_current_path,
432+ Eventually(Equals(self.fakehome)))
433
434 def test_go_to_root_must_open_the_root_directory(self):
435 """Test that opens the Device bookmark from the places section."""
436- # TODO: there is no support for bottom edge folder list yet, so
437- # for now disable it
438- if self.app.main_view.showSidebar:
439- self.app.main_view.go_to_place('placeDevice')
440+ self.app.main_view.go_to_place('placeDevice')
441
442- folder_list_page = self.app.main_view.get_folder_list_page()
443- self.assertThat(
444- folder_list_page.get_current_path,
445- Eventually(Equals('/')))
446+ folder_list_page = self.app.main_view.get_folder_list_page()
447+ self.assertThat(
448+ folder_list_page.get_current_path,
449+ Eventually(Equals('/')))

Subscribers

People subscribed via source and target branches