Merge lp:~tpeeters/ubuntu-ui-toolkit/revert-ap16 into lp:ubuntu-ui-toolkit/staging

Proposed by Tim Peeters
Status: Merged
Approved by: Tim Peeters
Approved revision: 1645
Merged at revision: 1646
Proposed branch: lp:~tpeeters/ubuntu-ui-toolkit/revert-ap16
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 624 lines (+56/-152)
16 files modified
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_common.py (+1/-6)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py (+3/-5)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py (+1/-2)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_ubuntulistview.py (+5/-8)
tests/autopilot/ubuntuuitoolkit/tests/__init__.py (+6/-14)
tests/autopilot/ubuntuuitoolkit/tests/components/test_popover.py (+2/-5)
tests/autopilot/ubuntuuitoolkit/tests/components/test_textinput.py (+13/-30)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_actionbar.py (+1/-1)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_dialog.py (+2/-5)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py (+8/-34)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py (+7/-23)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitem.py (+3/-6)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.py (+0/-2)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.py (+1/-4)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_sections.py (+1/-1)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_ubuntulistview.py (+2/-6)
To merge this branch: bzr merge lp:~tpeeters/ubuntu-ui-toolkit/revert-ap16
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Tim Peeters Approve
Zoltan Balogh Approve
Review via email: mp+272004@code.launchpad.net

Commit message

Undo the MR to support AP1.6.

Description of the change

Undo the MR to support AP1.6 because AP1.6 is not ready yet.

To post a comment you must log in.
Revision history for this message
Zoltan Balogh (bzoltan) wrote :

Do it :)

review: Approve
Revision history for this message
Tim Peeters (tpeeters) wrote :

I tried some random AP tests that were broken by r1642 and they work again.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_common.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_common.py 2015-09-21 11:19:06 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_common.py 2015-09-22 15:58:52 +0000
@@ -29,7 +29,6 @@
29 platform29 platform
30)30)
31from autopilot.introspection import dbus31from autopilot.introspection import dbus
32import ubuntuuitoolkit
3332
34logger = logging.getLogger(__name__)33logger = logging.getLogger(__name__)
3534
@@ -243,7 +242,6 @@
243 parent = self.get_parent()242 parent = self.get_parent()
244 root = self.get_root_instance()243 root = self.get_root_instance()
245 while parent.id != root.id:244 while parent.id != root.id:
246 parent = ubuntuuitoolkit.QQuickFlickable.from_proxy_object(parent)
247 if parent.is_flickable():245 if parent.is_flickable():
248 return parent246 return parent
249 parent = parent.get_parent()247 parent = parent.get_parent()
@@ -265,7 +263,4 @@
265 if top_container is None:263 if top_container is None:
266 raise ToolkitException('Could not find the top-most container.')264 raise ToolkitException('Could not find the top-most container.')
267 else:265 else:
268 from ubuntuuitoolkit._custom_proxy_objects._mainview import (266 return top_container
269 MainView
270 )
271 return MainView.from_proxy_object(top_container)
272267
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py 2015-09-21 13:54:37 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py 2015-09-22 15:58:52 +0000
@@ -20,10 +20,8 @@
20from autopilot.introspection import dbus20from autopilot.introspection import dbus
2121
22from ubuntuuitoolkit._custom_proxy_objects import (22from ubuntuuitoolkit._custom_proxy_objects import (
23 _actionbar,
24 _common,23 _common,
25 _sections,24 _tabbar
26 _tabbar,
27)25)
2826
2927
@@ -92,7 +90,7 @@
92 try:90 try:
93 # Ubuntu.Components >=1.391 # Ubuntu.Components >=1.3
94 sections = self.select_single(92 sections = self.select_single(
95 _sections.Sections, objectName='headerSectionsItem')93 'Sections', objectName='headerSectionsItem')
96 sections.click_section_button(index)94 sections.click_section_button(index)
97 except dbus.StateNotFoundError:95 except dbus.StateNotFoundError:
98 # Ubuntu.Components < 1.3, has no headerSectionsItem.96 # Ubuntu.Components < 1.3, has no headerSectionsItem.
@@ -252,7 +250,7 @@
252 try:250 try:
253 # for Ubuntu.Components 1.3251 # for Ubuntu.Components 1.3
254 actionbar = self.select_single(252 actionbar = self.select_single(
255 _actionbar.ActionBar, objectName='headerActionBar')253 'ActionBar', objectName='headerActionBar')
256 actionbar.click_action_button(action_object_name)254 actionbar.click_action_button(action_object_name)
257 except dbus.StateNotFoundError:255 except dbus.StateNotFoundError:
258 # for Ubuntu.Components < 1.3256 # for Ubuntu.Components < 1.3
259257
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py 2015-09-21 11:19:06 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py 2015-09-22 15:58:52 +0000
@@ -23,7 +23,6 @@
23from autopilot import introspection23from autopilot import introspection
2424
25from ubuntuuitoolkit._custom_proxy_objects import (25from ubuntuuitoolkit._custom_proxy_objects import (
26 AppHeader,
27 _common,26 _common,
28 popups,27 popups,
29 _tabs,28 _tabs,
@@ -65,7 +64,7 @@
65 def get_header(self):64 def get_header(self):
66 """Return the AppHeader custom proxy object of the MainView."""65 """Return the AppHeader custom proxy object of the MainView."""
67 try:66 try:
68 return self.select_single(AppHeader, objectName='MainView_Header')67 return self.select_single(objectName='MainView_Header')
69 except dbus.StateNotFoundError:68 except dbus.StateNotFoundError:
70 raise _common.ToolkitException('The main view has no header.')69 raise _common.ToolkitException('The main view has no header.')
7170
7271
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_ubuntulistview.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_ubuntulistview.py 2015-06-19 05:28:48 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_ubuntulistview.py 2015-09-22 15:58:52 +0000
@@ -14,21 +14,18 @@
14# You should have received a copy of the GNU Lesser General Public License14# You should have received a copy of the GNU Lesser General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.15# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
17from ubuntuuitoolkit._custom_proxy_objects import (17from ubuntuuitoolkit._custom_proxy_objects import _qquicklistview
18 _flickable,
19 _qquicklistview
20)
2118
2219
23class UbuntuListView11(_qquicklistview.QQuickListView):20class UbuntuListView11(_qquicklistview.QQuickListView):
24 """Autopilot helper for the UbuntuListView 1.1."""21 """Autopilot helper for the UbuntuListView 1.1."""
2522
26 def pull_to_refresh_enabled(self):23 def pull_to_refresh_enabled(self):
27 refresh = self.select_single(_flickable.PullToRefresh)24 refresh = self.select_single('PullToRefresh')
28 return refresh.enabled25 return refresh.enabled
2926
30 def manual_refresh_wait(self):27 def manual_refresh_wait(self):
31 refresh = self.select_single(_flickable.PullToRefresh)28 refresh = self.select_single('PullToRefresh')
32 if refresh.enabled:29 if refresh.enabled:
33 self.pull_to_refresh()30 self.pull_to_refresh()
34 refresh.wait_for_refresh()31 refresh.wait_for_refresh()
@@ -36,14 +33,14 @@
36 return False33 return False
3734
38 def manual_refresh_nowait(self):35 def manual_refresh_nowait(self):
39 refresh = self.select_single(_flickable.PullToRefresh)36 refresh = self.select_single('PullToRefresh')
40 if refresh.enabled:37 if refresh.enabled:
41 self.pull_to_refresh()38 self.pull_to_refresh()
42 return True39 return True
43 return False40 return False
4441
45 def wait_refresh_completed(self):42 def wait_refresh_completed(self):
46 refresh = self.select_single(_flickable.PullToRefresh)43 refresh = self.select_single('PullToRefresh')
47 if refresh.enabled:44 if refresh.enabled:
48 refresh.wait_for_refresh()45 refresh.wait_for_refresh()
49 return True46 return True
5047
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/__init__.py'
--- tests/autopilot/ubuntuuitoolkit/tests/__init__.py 2015-09-22 10:13:12 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/__init__.py 2015-09-22 15:58:52 +0000
@@ -25,7 +25,6 @@
2525
26import ubuntuuitoolkit26import ubuntuuitoolkit
27from ubuntuuitoolkit import base, fixture_setup27from ubuntuuitoolkit import base, fixture_setup
28from ubuntuuitoolkit._custom_proxy_objects._mainview import MainView
2928
3029
31_DESKTOP_FILE_CONTENTS = ("""[Desktop Entry]30_DESKTOP_FILE_CONTENTS = ("""[Desktop Entry]
@@ -109,8 +108,7 @@
109 application_name, _ = os.path.splitext(desktop_file_name)108 application_name, _ = os.path.splitext(desktop_file_name)
110 self.app = self.launch_upstart_application(109 self.app = self.launch_upstart_application(
111 application_name,110 application_name,
112 proxy_class=ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase111 emulator_base=ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase)
113 )
114112
115 def use_local_modules(self, local_modules_path):113 def use_local_modules(self, local_modules_path):
116 env_vars = [114 env_vars = [
@@ -127,9 +125,8 @@
127class QMLStringAppTestCase(UbuntuUIToolkitWithFakeAppRunningTestCase):125class QMLStringAppTestCase(UbuntuUIToolkitWithFakeAppRunningTestCase):
128 """Base test case for self tests that define the QML on an string."""126 """Base test case for self tests that define the QML on an string."""
129127
130 def setUp(self, mainview_class=MainView):128 def setUp(self):
131 super().setUp()129 super().setUp()
132 self.mainview_class = mainview_class
133 self.assertThat(130 self.assertThat(
134 self.main_view.visible, Eventually(Equals(True)))131 self.main_view.visible, Eventually(Equals(True)))
135132
@@ -143,9 +140,7 @@
143 QML code used for testing must define the objectName140 QML code used for testing must define the objectName
144 of the MainView to be 'mainView'.141 of the MainView to be 'mainView'.
145 """142 """
146 return self.mainview_class.from_proxy_object(143 return self.app.select_single(objectName='mainView')
147 self.app.select_single(objectName='mainView')
148 )
149144
150145
151class FlickDirection:146class FlickDirection:
@@ -160,10 +155,8 @@
160 test_qml_file_path = '/path/to/file.qml'155 test_qml_file_path = '/path/to/file.qml'
161 desktop_file_path = None156 desktop_file_path = None
162157
163 def setUp(self, mainview_class=MainView):158 def setUp(self):
164 super().setUp()159 super().setUp()
165 # Allow a test case to use a different CPO
166 self.mainview_class = mainview_class
167 self.pointing_device = Pointer(self.input_device_class.create())160 self.pointing_device = Pointer(self.input_device_class.create())
168 self.launch_application()161 self.launch_application()
169162
@@ -180,6 +173,7 @@
180 ]173 ]
181 self.app = self.launch_test_application(174 self.app = self.launch_test_application(
182 *self.get_command_line(command_line),175 *self.get_command_line(command_line),
176 emulator_base=ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase,
183 app_type='qt')177 app_type='qt')
184178
185 self.assertThat(179 self.assertThat(
@@ -201,9 +195,7 @@
201 QML code used for testing must define the objectName195 QML code used for testing must define the objectName
202 of the MainView to be 'mainView'.196 of the MainView to be 'mainView'.
203 """197 """
204 return self.mainview_class.from_proxy_object(198 return self.app.select_single(objectName='mainView')
205 self.app.select_single(objectName='mainView')
206 )
207199
208 def getOrientationHelper(self):200 def getOrientationHelper(self):
209 orientationHelper = self.main_view.select_many(201 orientationHelper = self.main_view.select_many(
210202
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/components/test_popover.py'
--- tests/autopilot/ubuntuuitoolkit/tests/components/test_popover.py 2015-06-19 05:28:48 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/components/test_popover.py 2015-09-22 15:58:52 +0000
@@ -18,10 +18,7 @@
1818
19import os19import os
2020
21from ubuntuuitoolkit import (21from ubuntuuitoolkit import tests
22 QQuickFlickable,
23 tests
24)
2522
2623
27class DialogScrollTestCase(tests.QMLFileAppTestCase):24class DialogScrollTestCase(tests.QMLFileAppTestCase):
@@ -43,7 +40,7 @@
43 button = self.main_view.select_single(objectName='button_huge')40 button = self.main_view.select_single(objectName='button_huge')
44 self.pointing_device.click_object(button)41 self.pointing_device.click_object(button)
45 dialog = self.main_view.select_single(objectName='dialog_huge')42 dialog = self.main_view.select_single(objectName='dialog_huge')
46 flickable = dialog.select_single(QQuickFlickable)43 flickable = dialog.select_single('QQuickFlickable')
47 buttlet = dialog.select_single(objectName='buttlet49')44 buttlet = dialog.select_single(objectName='buttlet49')
48 # We can scroll45 # We can scroll
49 self.assertFalse(flickable.atYEnd)46 self.assertFalse(flickable.atYEnd)
5047
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/components/test_textinput.py'
--- tests/autopilot/ubuntuuitoolkit/tests/components/test_textinput.py 2015-07-20 23:40:12 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/components/test_textinput.py 2015-09-22 15:58:52 +0000
@@ -23,11 +23,7 @@
23from autopilot.input._common import get_center_point23from autopilot.input._common import get_center_point
24from autopilot import platform24from autopilot import platform
2525
26from ubuntuuitoolkit import (26from ubuntuuitoolkit import tests
27 TextArea,
28 TextField,
29 tests
30)
3127
3228
33class CaretTextInputTestCase(tests.QMLFileAppTestCase):29class CaretTextInputTestCase(tests.QMLFileAppTestCase):
@@ -46,20 +42,16 @@
46 scenarios = [42 scenarios = [
47 ('textfield',43 ('textfield',
48 dict(test_qml_file_path=textfield_qml_file_path,44 dict(test_qml_file_path=textfield_qml_file_path,
49 objectName='textfield',45 objectName='textfield')),
50 cpo_class=TextField)),
51 ('textarea',46 ('textarea',
52 dict(test_qml_file_path=textarea_qml_file_path,47 dict(test_qml_file_path=textarea_qml_file_path,
53 objectName='textarea',48 objectName='textarea')),
54 cpo_class=TextArea)),
55 ('customfield',49 ('customfield',
56 dict(test_qml_file_path=customfield_qml_file_path,50 dict(test_qml_file_path=customfield_qml_file_path,
57 objectName='textfield',51 objectName='textfield')),
58 cpo_class=TextField)),
59 ('header',52 ('header',
60 dict(test_qml_file_path=header_qml_file_path,53 dict(test_qml_file_path=header_qml_file_path,
61 objectName='textfield',54 objectName='textfield')),
62 cpo_class=TextField)),
63 ]55 ]
6456
65 def get_command_line(self, command_line):57 def get_command_line(self, command_line):
@@ -68,10 +60,8 @@
6860
69 def setUp(self):61 def setUp(self):
70 super().setUp()62 super().setUp()
71 # Create either a TextField or TextArea.63 self.textfield = self.main_view.select_single(
72 self.textfield = self.cpo_class.from_proxy_object(64 objectName=self.objectName)
73 self.main_view.select_single(objectName=self.objectName)
74 )
75 self.assertFalse(self.textfield.focus)65 self.assertFalse(self.textfield.focus)
7666
77 def select_cursor(self, positionProperty):67 def select_cursor(self, positionProperty):
@@ -132,20 +122,16 @@
132 scenarios = [122 scenarios = [
133 ('textfield',123 ('textfield',
134 dict(test_qml_file_path=textfield_qml_file_path,124 dict(test_qml_file_path=textfield_qml_file_path,
135 objectName='textfield',125 objectName='textfield')),
136 cpo_class=TextField)),
137 ('textarea',126 ('textarea',
138 dict(test_qml_file_path=textarea_qml_file_path,127 dict(test_qml_file_path=textarea_qml_file_path,
139 objectName='textarea',128 objectName='textarea')),
140 cpo_class=TextField)),
141 ('customfield',129 ('customfield',
142 dict(test_qml_file_path=customfield_qml_file_path,130 dict(test_qml_file_path=customfield_qml_file_path,
143 objectName='textfield',131 objectName='textfield')),
144 cpo_class=TextField)),
145 ('header',132 ('header',
146 dict(test_qml_file_path=header_qml_file_path,133 dict(test_qml_file_path=header_qml_file_path,
147 objectName='textfield',134 objectName='textfield')),
148 cpo_class=TextField)),
149 ]135 ]
150136
151 def get_command_line(self, command_line):137 def get_command_line(self, command_line):
@@ -153,12 +139,9 @@
153 return command_line139 return command_line
154140
155 def setUp(self):141 def setUp(self):
156
157 super().setUp()142 super().setUp()
158 # textfield will either be a textfield or textarea.143 self.textfield = self.main_view.select_single(
159 self.textfield = self.cpo_class.from_proxy_object(144 objectName=self.objectName)
160 self.main_view.select_single(objectName=self.objectName)
161 )
162 self.assertFalse(self.textfield.focus)145 self.assertFalse(self.textfield.focus)
163146
164 def assert_buttons(self, texts):147 def assert_buttons(self, texts):
165148
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_actionbar.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_actionbar.py 2015-07-20 23:19:04 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_actionbar.py 2015-09-22 15:58:52 +0000
@@ -29,7 +29,7 @@
29 def setUp(self):29 def setUp(self):
30 super().setUp()30 super().setUp()
31 self.actionbar = self.app.select_single(31 self.actionbar = self.app.select_single(
32 ubuntuuitoolkit.ActionBar, objectName='ActionBar')32 'ActionBar', objectName='ActionBar')
33 self.label = self.app.select_single(33 self.label = self.app.select_single(
34 'Label', objectName='Label')34 'Label', objectName='Label')
35 self.assertEqual(self.label.text, 'No action triggered.')35 self.assertEqual(self.label.text, 'No action triggered.')
3636
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_dialog.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_dialog.py 2015-06-16 04:21:58 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_dialog.py 2015-09-22 15:58:52 +0000
@@ -16,10 +16,7 @@
1616
17import os17import os
1818
19from ubuntuuitoolkit import (19from ubuntuuitoolkit import tests
20 TextArea,
21 tests
22)
2320
2421
25class DialogTestCase(tests.QMLFileAppTestCase):22class DialogTestCase(tests.QMLFileAppTestCase):
@@ -34,7 +31,7 @@
34 self.pointing_device.click_object(open_button)31 self.pointing_device.click_object(open_button)
35 dialog = self.main_view.wait_select_single('Dialog',32 dialog = self.main_view.wait_select_single('Dialog',
36 title="Dialog")33 title="Dialog")
37 text_area = dialog.wait_select_single(TextArea,34 text_area = dialog.wait_select_single('TextArea',
38 objectName='textfield_standard')35 objectName='textfield_standard')
39 text_area.write('test')36 text_area.write('test')
40 self.assertEqual(text_area.text, 'test')37 self.assertEqual(text_area.text, 'test')
4138
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py 2015-07-21 06:37:52 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py 2015-09-22 15:58:52 +0000
@@ -79,33 +79,16 @@
79}79}
80""")80""")
8181
82 class Label(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
83 pass
84
85 scenarios = [82 scenarios = [
86 ('main view', dict(83 ('main view', dict(object_name='mainView', is_flickable=False)),
87 cpo_class=ubuntuuitoolkit.MainView,84 ('flickable', dict(object_name='flickable', is_flickable=True)),
88 object_name='mainView',85 ('list view', dict(object_name='listView', is_flickable=True)),
89 is_flickable=False)),86 ('label', dict(object_name='label', is_flickable=False))
90 ('flickable', dict(
91 cpo_class=ubuntuuitoolkit.QQuickFlickable,
92 object_name='flickable',
93 is_flickable=True)),
94 ('list view', dict(
95 cpo_class=ubuntuuitoolkit.QQuickListView,
96 object_name='listView',
97 is_flickable=True)),
98 ('label', dict(
99 cpo_class=Label,
100 object_name='label',
101 is_flickable=False))
102 ]87 ]
10388
104 def test_is_flickable(self):89 def test_is_flickable(self):
105 """Test that is_flickable identifies the elements correctly."""90 """Test that is_flickable identifies the elements correctly."""
106 element = self.app.select_single(91 element = self.app.select_single(objectName=self.object_name)
107 self.cpo_class,
108 objectName=self.object_name)
109 self.assertEqual(element.is_flickable(), self.is_flickable)92 self.assertEqual(element.is_flickable(), self.is_flickable)
11093
11194
@@ -160,9 +143,6 @@
160}143}
161""")144""")
162145
163 class Button(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
164 pass
165
166 def setUp(self):146 def setUp(self):
167 super().setUp()147 super().setUp()
168 self.flickable = self.main_view.select_single(148 self.flickable = self.main_view.select_single(
@@ -174,9 +154,7 @@
174 def test_swipe_into_view_bottom_element(self):154 def test_swipe_into_view_bottom_element(self):
175 self.main_view.close_toolbar()155 self.main_view.close_toolbar()
176156
177 button = self.main_view.select_single(157 button = self.main_view.select_single(objectName='bottomButton')
178 self.Button,
179 objectName='bottomButton')
180 button.swipe_into_view()158 button.swipe_into_view()
181159
182 self.pointing_device.click_object(button)160 self.pointing_device.click_object(button)
@@ -184,14 +162,10 @@
184162
185 def test_swipe_into_view_top_element(self):163 def test_swipe_into_view_top_element(self):
186 self.main_view.close_toolbar()164 self.main_view.close_toolbar()
187 bottomButton = self.main_view.select_single(165 bottomButton = self.main_view.select_single(objectName='bottomButton')
188 self.Button,
189 objectName='bottomButton')
190 bottomButton.swipe_into_view()166 bottomButton.swipe_into_view()
191167
192 topButton = self.main_view.select_single(168 topButton = self.main_view.select_single(objectName='topButton')
193 self.Button,
194 objectName='topButton')
195 topButton.swipe_into_view()169 topButton.swipe_into_view()
196170
197 self.pointing_device.click_object(topButton)171 self.pointing_device.click_object(topButton)
198172
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py 2015-06-17 23:26:34 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py 2015-09-22 15:58:52 +0000
@@ -22,12 +22,7 @@
22from autopilot import introspection22from autopilot import introspection
2323
24import ubuntuuitoolkit24import ubuntuuitoolkit
25from ubuntuuitoolkit import (25from ubuntuuitoolkit import tests
26 CheckBox,
27 MainView,
28 UbuntuUIToolkitCustomProxyObjectBase as ProxyBase,
29 tests
30)
3126
3227
33class HideShowTestCase(tests.QMLFileAppTestCase):28class HideShowTestCase(tests.QMLFileAppTestCase):
@@ -77,12 +72,8 @@
77 def setUp(self):72 def setUp(self):
78 super().setUp()73 super().setUp()
79 self.header = self.main_view.get_header()74 self.header = self.main_view.get_header()
80 self.label = ProxyBase.from_proxy_object(75 self.label = self.app.select_single(
81 self.app.select_single(76 'Label', objectName='clicked_label')
82 'Label',
83 objectName='clicked_label'
84 )
85 )
86 self.assertEqual(self.label.text, 'No button clicked.')77 self.assertEqual(self.label.text, 'No button clicked.')
8778
88 def test_header_custom_proxy_object(self):79 def test_header_custom_proxy_object(self):
@@ -114,9 +105,7 @@
114 self.assertEqual(self.label.text, 'Cancel button clicked.')105 self.assertEqual(self.label.text, 'Cancel button clicked.')
115106
116 def test_click_header_action_button_with_hidden_header(self):107 def test_click_header_action_button_with_hidden_header(self):
117 bottom_label = ProxyBase.from_proxy_object(108 bottom_label = self.main_view.select_single(objectName='end_label')
118 self.main_view.select_single(objectName='end_label')
119 )
120 bottom_label.swipe_into_view()109 bottom_label.swipe_into_view()
121 self.assertFalse(self.header._is_visible())110 self.assertFalse(self.header._is_visible())
122 self.header.click_action_button('action0')111 self.header.click_action_button('action0')
@@ -157,7 +146,7 @@
157146
158 def test_select_sections_with_sections_disabled(self):147 def test_select_sections_with_sections_disabled(self):
159 sectionsEnabledSwitch = self.app.select_single(148 sectionsEnabledSwitch = self.app.select_single(
160 CheckBox, objectName='sections_enabled_switch')149 'CheckBox', objectName='sections_enabled_switch')
161 sectionsEnabledSwitch.uncheck()150 sectionsEnabledSwitch.uncheck()
162 for index in [1, 0, 2]:151 for index in [1, 0, 2]:
163 self.header.switch_to_section_by_index(index)152 self.header.switch_to_section_by_index(index)
@@ -194,7 +183,7 @@
194183
195 def test_select_sections_with_sections_disabled(self):184 def test_select_sections_with_sections_disabled(self):
196 sectionsEnabledSwitch = self.app.select_single(185 sectionsEnabledSwitch = self.app.select_single(
197 CheckBox, objectName='sections_enabled_switch')186 'CheckBox', objectName='sections_enabled_switch')
198 sectionsEnabledSwitch.uncheck()187 sectionsEnabledSwitch.uncheck()
199 error = self.assertRaises(188 error = self.assertRaises(
200 ubuntuuitoolkit.ToolkitException,189 ubuntuuitoolkit.ToolkitException,
@@ -223,12 +212,7 @@
223212
224 @property213 @property
225 def main_view(self):214 def main_view(self):
226 # This change will allow the test to pass, but I don't feel this test215 return self.app.select_single(objectName='customMainView')
227 # is really relevant as it is really testing the from_proxy_method to
228 # create a MainView object.
229 return MainView.from_proxy_object(
230 self.app.select_single(objectName='customMainView')
231 )
232216
233 def test_get_header_from_custom_main_view(self):217 def test_get_header_from_custom_main_view(self):
234 """Test that we can get the header from a custom main view.218 """Test that we can get the header from a custom main view.
235219
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitem.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitem.py 2015-07-02 18:41:11 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitem.py 2015-09-22 15:58:52 +0000
@@ -17,9 +17,7 @@
17import os17import os
1818
19import ubuntuuitoolkit19import ubuntuuitoolkit
20from ubuntuuitoolkit import (20from ubuntuuitoolkit import tests
21 tests
22)
2321
2422
25class ListItemTestCase(tests.QMLFileAppTestCase):23class ListItemTestCase(tests.QMLFileAppTestCase):
@@ -29,12 +27,11 @@
29 dir_path, 'test_listitem.ListItemTestCase.qml')27 dir_path, 'test_listitem.ListItemTestCase.qml')
3028
31 def setUp(self):29 def setUp(self):
32
33 super().setUp()30 super().setUp()
34 self.list_view = self.main_view.select_single(31 self.list_view = self.main_view.select_single(
35 ubuntuuitoolkit.QQuickListView, objectName='test_view')32 ubuntuuitoolkit.QQuickListView, objectName='test_view')
36 self.test_listitem = self.main_view.select_single(33 self.test_listitem = self.main_view.select_single(
37 ubuntuuitoolkit.UCListItem, objectName='listitem0')34 'UCListItem', objectName='listitem0')
38 self.test_page = self.main_view.select_single(35 self.test_page = self.main_view.select_single(
39 objectName='test_page')36 objectName='test_page')
40 self.assertEqual(self.test_page.title, 'No action triggered')37 self.assertEqual(self.test_page.title, 'No action triggered')
@@ -96,6 +93,6 @@
96 self.assertTrue(self.test_listitem.selected)93 self.assertTrue(self.test_listitem.selected)
97 # select an other one94 # select an other one
98 listItem3 = self.main_view.select_single(95 listItem3 = self.main_view.select_single(
99 ubuntuuitoolkit.UCListItem, objectName='listitem3')96 'UCListItem', objectName='listitem3')
100 listItem3.toggle_selected()97 listItem3.toggle_selected()
101 self.assertTrue(listItem3.selected)98 self.assertTrue(listItem3.selected)
10299
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.py 2015-06-18 04:17:48 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.py 2015-09-22 15:58:52 +0000
@@ -76,8 +76,6 @@
7676
7777
78class MainView12TestCase(tests.QMLStringAppTestCase):78class MainView12TestCase(tests.QMLStringAppTestCase):
79 # veebers: Note some of these tests might be unneeded due to how the CPOs
80 # work now.
8179
82 test_qml = ("""80 test_qml = ("""
83import QtQuick 2.381import QtQuick 2.3
8482
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.py 2015-07-02 18:41:11 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.py 2015-09-22 15:58:52 +0000
@@ -23,9 +23,7 @@
23from autopilot.introspection import dbus23from autopilot.introspection import dbus
2424
25import ubuntuuitoolkit25import ubuntuuitoolkit
26from ubuntuuitoolkit import (26from ubuntuuitoolkit import tests
27 tests
28)
2927
3028
31class QQuickListViewTestCase(tests.QMLStringAppTestCase):29class QQuickListViewTestCase(tests.QMLStringAppTestCase):
@@ -206,7 +204,6 @@
206204
207 def setUp(self):205 def setUp(self):
208 super().setUp()206 super().setUp()
209
210 self.list_view = self.main_view.select_single(207 self.list_view = self.main_view.select_single(
211 ubuntuuitoolkit.QQuickListView, objectName='testListView')208 ubuntuuitoolkit.QQuickListView, objectName='testListView')
212 self.label = self.main_view.select_single(209 self.label = self.main_view.select_single(
213210
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_sections.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_sections.py 2015-07-20 23:19:04 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_sections.py 2015-09-22 15:58:52 +0000
@@ -29,7 +29,7 @@
29 def setUp(self):29 def setUp(self):
30 super().setUp()30 super().setUp()
31 self.sections = self.app.select_single(31 self.sections = self.app.select_single(
32 ubuntuuitoolkit.Sections, objectName='sections')32 'Sections', objectName='sections')
33 self.label = self.app.select_single(33 self.label = self.app.select_single(
34 'Label', objectName='label')34 'Label', objectName='label')
35 self.assertEqual(self.label.text, 'Section 0 is selected.')35 self.assertEqual(self.label.text, 'Section 0 is selected.')
3636
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_ubuntulistview.py'
--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_ubuntulistview.py 2015-06-19 05:28:48 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_ubuntulistview.py 2015-09-22 15:58:52 +0000
@@ -32,12 +32,8 @@
32 self.checkPageHeader(element.text)32 self.checkPageHeader(element.text)
33 self.main_view.wait_select_single(33 self.main_view.wait_select_single(
34 "Template", objectName="ubuntuListViewTemplate")34 "Template", objectName="ubuntuListViewTemplate")
35 self.listView = ubuntuuitoolkit.UbuntuListView11.from_proxy_object(35 self.listView = self.main_view.select_single(
36 self.main_view.select_single(36 ubuntuuitoolkit.UbuntuListView11, objectName="ubuntuListView")
37 ubuntuuitoolkit.UbuntuListView11,
38 objectName="ubuntuListView"
39 )
40 )
4137
42 def test_pull_to_refresh_enabled(self):38 def test_pull_to_refresh_enabled(self):
43 self._open_page()39 self._open_page()

Subscribers

People subscribed via source and target branches