Merge lp:~ibelieve/ubuntu-filemanager-app/fix-autopilot-tests into lp:ubuntu-filemanager-app

Proposed by Michael Spencer
Status: Merged
Approved by: Nicholas Skaggs
Approved revision: 61
Merged at revision: 59
Proposed branch: lp:~ibelieve/ubuntu-filemanager-app/fix-autopilot-tests
Merge into: lp:ubuntu-filemanager-app
Diff against target: 122 lines (+43/-33)
3 files modified
PlacesPopover.qml (+2/-0)
tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py (+40/-32)
ubuntu-filemanager-app.qml (+1/-1)
To merge this branch: bzr merge lp:~ibelieve/ubuntu-filemanager-app/fix-autopilot-tests
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Nicholas Skaggs (community) Approve
Review via email: mp+180430@code.launchpad.net

Commit message

Fixed broken autopilot tests that use the Places popover

Description of the change

Fixes broken autopilot tests caused by hacks to fix bugs in the UI toolkit caused by having a Suru theme.

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)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
60. By Michael Spencer

Added check for desktop mode for open file autopilot test

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

Fixed pep8 errors

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

working on my device, fixes the errors. +1

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) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'PlacesPopover.qml'
2--- PlacesPopover.qml 2013-08-06 17:40:06 +0000
3+++ PlacesPopover.qml 2013-08-15 22:09:11 +0000
4@@ -124,6 +124,8 @@
5 model: places
6
7 delegate: Standard {
8+ property string name: folderName(path)
9+
10 Label {
11 anchors.left: parent.left
12 anchors.leftMargin: units.gu(8)
13
14=== modified file 'tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py'
15--- tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py 2013-08-13 21:46:44 +0000
16+++ tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py 2013-08-15 22:09:11 +0000
17@@ -25,6 +25,7 @@
18 import shutil
19
20 from autopilot import process
21+from autopilot.platform import model
22 from autopilot.matchers import Eventually
23 from testtools.matchers import Equals, NotEquals
24
25@@ -136,37 +137,44 @@
26 self.assertThat(
27 list_view.get_current_path, Eventually(Equals(expected_path)))
28
29- def test_open_file(self):
30- self._make_file_in_home()
31-
32- first_file = self._get_file_by_index(0)
33- self.pointing_device.click_object(first_file)
34-
35- dialog = self.main_view.get_file_action_dialog()
36- dialog.visible.wait_for(True)
37-
38- process_manager = process.ProcessManager.create()
39- original_apps = process_manager.get_running_applications()
40-
41- dialog.open()
42- self.assertThat(
43- self.main_view.get_file_action_dialog, Eventually(Equals(None)))
44- # Filtering copied from
45- # AutopilotTestCase._compare_system_with_app_snapshot.
46- current_apps = self.process_manager.get_running_applications()
47- new_apps = filter(
48- lambda i: i not in original_apps, current_apps)
49- # Assert that only one window was opened.
50- self.assertEqual(len(new_apps), 1)
51- new_app = new_apps[0]
52- self.assertEqual(len(new_app.get_windows()), 1)
53-
54- # TODO assert that the file was opened on the right application. This
55- # depends on what's the default application to open a text file. Maybe
56- # we can get this information with XDG. --elopio - 2013-07-25
57- # Close the opened window.
58- window = new_app.get_windows()[0]
59- window.close()
60+ # We can't do this testcase on phablet devices because of a lack of
61+ # Mir backend in autopilot
62+ # see https://bugs.launchpad.net/autopilot/+bug/1209004
63+ if model() == "Desktop":
64+ def test_open_file(self):
65+ self._make_file_in_home()
66+
67+ first_file = self._get_file_by_index(0)
68+ self.pointing_device.click_object(first_file)
69+
70+ dialog = self.main_view.get_file_action_dialog()
71+ dialog.visible.wait_for(True)
72+
73+ process_manager = process.ProcessManager.create()
74+ original_apps = process_manager.get_running_applications()
75+
76+ dialog.open()
77+ self.assertThat(
78+ self.main_view.get_file_action_dialog,
79+ Eventually(Equals(None)))
80+ # Filtering copied from
81+ # AutopilotTestCase._compare_system_with_app_snapshot.
82+ current_apps = self.process_manager.get_running_applications()
83+ new_apps = filter(
84+ lambda i: i not in original_apps, current_apps)
85+ # Assert that only one window was opened.
86+ self.assertEqual(len(new_apps), 1)
87+ new_app = new_apps[0]
88+ self.assertEqual(len(new_app.get_windows()), 1)
89+
90+ # TODO assert that the file was opened on the right
91+ # application. This depends on what's the default application
92+ # to open a text file. Maybe we can get this information
93+ # with XDG. --elopio - 2013-07-25
94+
95+ # Close the opened window.
96+ window = new_app.get_windows()[0]
97+ window.close()
98
99 def test_open_directory(self):
100 dir_path = self._make_directory_in_home()
101@@ -559,7 +567,7 @@
102 places_popover = self.main_view.get_places_popover()
103 places = places_popover.select_many('Standard')
104 for place in places:
105- if place.text == text:
106+ if place.name == text:
107 return place
108 raise ValueError(
109 'Place "{0}" not found.'.format(text))
110
111=== modified file 'ubuntu-filemanager-app.qml'
112--- ubuntu-filemanager-app.qml 2013-08-06 17:40:06 +0000
113+++ ubuntu-filemanager-app.qml 2013-08-15 22:09:11 +0000
114@@ -32,7 +32,7 @@
115 objectName: "filemanager"
116 applicationName: "ubuntu-filemanager-app"
117
118- width: units.gu(100)
119+ width: units.gu(50)
120 height: units.gu(75)
121
122 property alias filemanager: root

Subscribers

People subscribed via source and target branches