Merge lp:~tpeeters/ubuntu-ui-toolkit/ap-use-qml-files into lp:ubuntu-ui-toolkit/staging
- ap-use-qml-files
- Merge into staging
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Zoltan Balogh | ||||
Approved revision: | 2069 | ||||
Merged at revision: | 2055 | ||||
Proposed branch: | lp:~tpeeters/ubuntu-ui-toolkit/ap-use-qml-files | ||||
Merge into: | lp:ubuntu-ui-toolkit/staging | ||||
Diff against target: |
2077 lines (+1056/-659) 33 files modified
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_toolbar.py (+1/-2) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.ToggleTestCase.test_with_checkbox.qml (+31/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.ToggleTestCase.test_with_switch.qml (+31/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.py (+13/-41) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_common.py (+2/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.DatePickerBaseTestCase.qml (+72/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.py (+7/-60) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.IsFlickableTestCase.qml (+34/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.SwipeFlickableTestCase.qml (+83/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.UnityFlickableTestCase.qml (+31/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py (+18/-109) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.IsFlickableTestCase.qml (+35/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.SwipeFlickableTestCase.qml (+62/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.UnityFlickableTestCase.qml (+30/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.py (+18/-90) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitems.SwipeToDeleteTestCase.qml (+79/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitems.py (+6/-68) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.GoBackTestCase.back_in_header.qml (+48/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.GoBackTestCase.back_in_toolbar.qml (+48/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.MainView10TestCase.qml (+24/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.MainView12TestCase.qml (+24/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.py (+25/-67) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.OptionSelectorCustomDelegateTestCase.qml (+60/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.OptionSelectorTestCase.qml (+42/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.py (+14/-78) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_popups.ComposerSheetTestCase.qml (+52/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_popups.py (+6/-40) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.QQuickListViewOutOfViewTestCase.qml (+62/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.py (+5/-49) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_textarea.TextAreaTestCase.qml (+30/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_textarea.py (+7/-18) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_toolbar.ToolbarTestCase.qml (+49/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_toolbar.py (+7/-37) |
||||
To merge this branch: | bzr merge lp:~tpeeters/ubuntu-ui-toolkit/ap-use-qml-files | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
ubuntu-sdk-build-bot | continuous-integration | Approve | |
Zoltan Balogh | Approve | ||
Review via email: mp+302471@code.launchpad.net |
Commit message
Use external QML files instead of embedded QML strings for autopilot tests.
Description of the change
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2068
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2068
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2068
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2068
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2069
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2069
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2069
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2069
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2069
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2069
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2069
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2069
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2069
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2069
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2069
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2069
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2069
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
1 | === modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_toolbar.py' |
2 | --- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_toolbar.py 2016-06-21 05:51:15 +0000 |
3 | +++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_toolbar.py 2016-08-09 21:14:31 +0000 |
4 | @@ -98,8 +98,7 @@ |
5 | self.pointing_device.click_object(button) |
6 | |
7 | def _get_button(self, object_name): |
8 | - return self.select_single( |
9 | - 'UbuntuToolkit::UCActionItem', objectName=object_name) |
10 | + return self.select_single(objectName=object_name) |
11 | |
12 | @autopilot_logging.log_action(logger.info) |
13 | def click_back_button(self): |
14 | |
15 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.ToggleTestCase.test_with_checkbox.qml' |
16 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.ToggleTestCase.test_with_checkbox.qml 1970-01-01 00:00:00 +0000 |
17 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.ToggleTestCase.test_with_checkbox.qml 2016-08-09 21:14:31 +0000 |
18 | @@ -0,0 +1,31 @@ |
19 | +/* |
20 | + * Copyright 2016 Canonical Ltd. |
21 | + * |
22 | + * This program is free software; you can redistribute it and/or modify |
23 | + * it under the terms of the GNU Lesser General Public License as published by |
24 | + * the Free Software Foundation; version 3. |
25 | + * |
26 | + * This program is distributed in the hope that it will be useful, |
27 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
28 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
29 | + * GNU Lesser General Public License for more details. |
30 | + * |
31 | + * You should have received a copy of the GNU Lesser General Public License |
32 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
33 | + */ |
34 | + |
35 | +import QtQuick 2.0 |
36 | +import Ubuntu.Components 1.0 |
37 | + |
38 | +MainView { |
39 | + width: units.gu(48) |
40 | + height: units.gu(60) |
41 | + objectName: "mainView" |
42 | + |
43 | + Item { |
44 | + CheckBox { |
45 | + checked: false |
46 | + objectName: "test_checkbox" |
47 | + } |
48 | + } |
49 | +} |
50 | |
51 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.ToggleTestCase.test_with_switch.qml' |
52 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.ToggleTestCase.test_with_switch.qml 1970-01-01 00:00:00 +0000 |
53 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.ToggleTestCase.test_with_switch.qml 2016-08-09 21:14:31 +0000 |
54 | @@ -0,0 +1,31 @@ |
55 | +/* |
56 | + * Copyright 2016 Canonical Ltd. |
57 | + * |
58 | + * This program is free software; you can redistribute it and/or modify |
59 | + * it under the terms of the GNU Lesser General Public License as published by |
60 | + * the Free Software Foundation; version 3. |
61 | + * |
62 | + * This program is distributed in the hope that it will be useful, |
63 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
64 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
65 | + * GNU Lesser General Public License for more details. |
66 | + * |
67 | + * You should have received a copy of the GNU Lesser General Public License |
68 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
69 | + */ |
70 | + |
71 | +import QtQuick 2.0 |
72 | +import Ubuntu.Components 1.0 |
73 | + |
74 | +MainView { |
75 | + width: units.gu(48) |
76 | + height: units.gu(60) |
77 | + objectName: "mainView" |
78 | + |
79 | + Item { |
80 | + Switch { |
81 | + checked: false |
82 | + objectName: "test_switch" |
83 | + } |
84 | + } |
85 | +} |
86 | |
87 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.py' |
88 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.py 2015-04-14 21:02:06 +0000 |
89 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_checkbox.py 2016-08-09 21:14:31 +0000 |
90 | @@ -15,6 +15,7 @@ |
91 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
92 | |
93 | import time |
94 | +import os |
95 | |
96 | from autopilot import input |
97 | from testtools.matchers import GreaterThan, LessThan |
98 | @@ -24,51 +25,22 @@ |
99 | from ubuntuuitoolkit import tests |
100 | |
101 | |
102 | -TEST_QML_WITH_CHECKBOX = (""" |
103 | -import QtQuick 2.0 |
104 | -import Ubuntu.Components 1.0 |
105 | - |
106 | -MainView { |
107 | - width: units.gu(48) |
108 | - height: units.gu(60) |
109 | - objectName: "mainView" |
110 | - |
111 | - Item { |
112 | - CheckBox { |
113 | - checked: false |
114 | - objectName: "test_checkbox" |
115 | - } |
116 | - } |
117 | -} |
118 | -""") |
119 | - |
120 | - |
121 | -TEST_QML_WITH_SWITCH = (""" |
122 | -import QtQuick 2.0 |
123 | -import Ubuntu.Components 1.0 |
124 | - |
125 | -MainView { |
126 | - width: units.gu(48) |
127 | - height: units.gu(60) |
128 | - objectName: "mainView" |
129 | - |
130 | - Item { |
131 | - Switch { |
132 | - checked: false |
133 | - objectName: "test_switch" |
134 | - } |
135 | - } |
136 | -} |
137 | -""") |
138 | - |
139 | - |
140 | -class ToggleTestCase(tests.QMLStringAppTestCase): |
141 | +class ToggleTestCase(tests.QMLFileAppTestCase): |
142 | + |
143 | + path = os.path.abspath(__file__) |
144 | + dir_path = os.path.dirname(path) |
145 | + switch_test_qml_file_path = os.path.join( |
146 | + dir_path, 'test_checkbox.ToggleTestCase.test_with_switch.qml') |
147 | + checkbox_test_qml_file_path = os.path.join( |
148 | + dir_path, 'test_checkbox.ToggleTestCase.test_with_checkbox.qml') |
149 | |
150 | scenarios = [ |
151 | ('checkbox', dict( |
152 | - test_qml=TEST_QML_WITH_CHECKBOX, objectName='test_checkbox')), |
153 | + test_qml_file_path=checkbox_test_qml_file_path, |
154 | + objectName='test_checkbox')), |
155 | ('switch', dict( |
156 | - test_qml=TEST_QML_WITH_SWITCH, objectName='test_switch')) |
157 | + test_qml_file_path=switch_test_qml_file_path, |
158 | + objectName='test_switch')) |
159 | ] |
160 | |
161 | def setUp(self): |
162 | |
163 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_common.py' |
164 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_common.py 2015-04-14 21:02:06 +0000 |
165 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_common.py 2016-08-09 21:14:31 +0000 |
166 | @@ -41,6 +41,8 @@ |
167 | ubuntuuitoolkit.check_autopilot_version() |
168 | |
169 | |
170 | +# FIXME: this class is not used anywhere, and QMLStringAppTestCase subclasses |
171 | +# no longer work (see bug 1578319), so the code below can be deleted. |
172 | class UbuntuUIToolkitCustomProxyObjectBaseTestCase(tests.QMLStringAppTestCase): |
173 | |
174 | def test_pointing_device(self): |
175 | |
176 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.DatePickerBaseTestCase.qml' |
177 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.DatePickerBaseTestCase.qml 1970-01-01 00:00:00 +0000 |
178 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.DatePickerBaseTestCase.qml 2016-08-09 21:14:31 +0000 |
179 | @@ -0,0 +1,72 @@ |
180 | +/* |
181 | + * Copyright 2016 Canonical Ltd. |
182 | + * |
183 | + * This program is free software; you can redistribute it and/or modify |
184 | + * it under the terms of the GNU Lesser General Public License as published by |
185 | + * the Free Software Foundation; version 3. |
186 | + * |
187 | + * This program is distributed in the hope that it will be useful, |
188 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
189 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
190 | + * GNU Lesser General Public License for more details. |
191 | + * |
192 | + * You should have received a copy of the GNU Lesser General Public License |
193 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
194 | + */ |
195 | + |
196 | +import QtQuick 2.0 |
197 | +import Ubuntu.Components 1.1 |
198 | +import Ubuntu.Components.Pickers 1.0 |
199 | + |
200 | +MainView { |
201 | + width: units.gu(48) |
202 | + height: units.gu(60) |
203 | + objectName: "mainView" |
204 | + |
205 | + Column { |
206 | + DatePicker { |
207 | + id: datePicker |
208 | + objectName: 'datePicker' |
209 | + mode: 'Years|Months|Days' |
210 | + maximum: { |
211 | + var d = new Date() |
212 | + d.setFullYear('2030') |
213 | + return d |
214 | + } |
215 | + minimum: { |
216 | + var d = new Date() |
217 | + d.setFullYear('1990') |
218 | + return d |
219 | + } |
220 | + date: { |
221 | + var d = new Date() |
222 | + d.setFullYear('2010') |
223 | + d.setMonth('5') |
224 | + d.setDate('15') |
225 | + return d |
226 | + } |
227 | + } |
228 | + DatePicker { |
229 | + id: timePicker |
230 | + objectName: 'timePicker' |
231 | + mode: 'Hours|Minutes|Seconds' |
232 | + maximum: { |
233 | + var d = new Date() |
234 | + d.setFullYear('2030') |
235 | + return d |
236 | + } |
237 | + minimum: { |
238 | + var d = new Date() |
239 | + d.setFullYear('1990') |
240 | + return d |
241 | + } |
242 | + date: { |
243 | + var d = new Date() |
244 | + d.setHours(12) |
245 | + d.setMinutes('30') |
246 | + d.setSeconds('30') |
247 | + return d |
248 | + } |
249 | + } |
250 | + } |
251 | +} |
252 | |
253 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.py' |
254 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.py 2015-04-14 21:02:06 +0000 |
255 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.py 2016-08-09 21:14:31 +0000 |
256 | @@ -14,72 +14,19 @@ |
257 | # You should have received a copy of the GNU Lesser General Public License |
258 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
259 | |
260 | +import os |
261 | import datetime |
262 | |
263 | import ubuntuuitoolkit |
264 | from ubuntuuitoolkit import pickers, tests |
265 | |
266 | |
267 | -class DatePickerBaseTestCase(tests.QMLStringAppTestCase): |
268 | - |
269 | - test_qml = (""" |
270 | -import QtQuick 2.0 |
271 | -import Ubuntu.Components 1.1 |
272 | -import Ubuntu.Components.Pickers 1.0 |
273 | - |
274 | -MainView { |
275 | - width: units.gu(48) |
276 | - height: units.gu(60) |
277 | - objectName: "mainView" |
278 | - |
279 | - Column { |
280 | - DatePicker { |
281 | - id: datePicker |
282 | - objectName: 'datePicker' |
283 | - mode: 'Years|Months|Days' |
284 | - maximum: { |
285 | - var d = new Date() |
286 | - d.setFullYear('2030') |
287 | - return d |
288 | - } |
289 | - minimum: { |
290 | - var d = new Date() |
291 | - d.setFullYear('1990') |
292 | - return d |
293 | - } |
294 | - date: { |
295 | - var d = new Date() |
296 | - d.setFullYear('2010') |
297 | - d.setMonth('5') |
298 | - d.setDate('15') |
299 | - return d |
300 | - } |
301 | - } |
302 | - DatePicker { |
303 | - id: timePicker |
304 | - objectName: 'timePicker' |
305 | - mode: 'Hours|Minutes|Seconds' |
306 | - maximum: { |
307 | - var d = new Date() |
308 | - d.setFullYear('2030') |
309 | - return d |
310 | - } |
311 | - minimum: { |
312 | - var d = new Date() |
313 | - d.setFullYear('1990') |
314 | - return d |
315 | - } |
316 | - date: { |
317 | - var d = new Date() |
318 | - d.setHours(12) |
319 | - d.setMinutes('30') |
320 | - d.setSeconds('30') |
321 | - return d |
322 | - } |
323 | - } |
324 | - } |
325 | -} |
326 | -""") |
327 | +class DatePickerBaseTestCase(tests.QMLFileAppTestCase): |
328 | + |
329 | + path = os.path.abspath(__file__) |
330 | + dir_path = os.path.dirname(path) |
331 | + test_qml_file_path = os.path.join( |
332 | + dir_path, 'test_date_picker.DatePickerBaseTestCase.qml') |
333 | |
334 | def setUp(self): |
335 | super().setUp() |
336 | |
337 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.IsFlickableTestCase.qml' |
338 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.IsFlickableTestCase.qml 1970-01-01 00:00:00 +0000 |
339 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.IsFlickableTestCase.qml 2016-08-09 21:14:31 +0000 |
340 | @@ -0,0 +1,34 @@ |
341 | +/* |
342 | + * Copyright 2016 Canonical Ltd. |
343 | + * |
344 | + * This program is free software; you can redistribute it and/or modify |
345 | + * it under the terms of the GNU Lesser General Public License as published by |
346 | + * the Free Software Foundation; version 3. |
347 | + * |
348 | + * This program is distributed in the hope that it will be useful, |
349 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
350 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
351 | + * GNU Lesser General Public License for more details. |
352 | + * |
353 | + * You should have received a copy of the GNU Lesser General Public License |
354 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
355 | + */ |
356 | + |
357 | +import QtQuick 2.4 |
358 | +import Ubuntu.Components 1.3 |
359 | + |
360 | +MainView { |
361 | + objectName: 'mainView' |
362 | + width: units.gu(48) |
363 | + height: units.gu(60) |
364 | + |
365 | + Flickable { |
366 | + objectName: 'flickable' |
367 | + } |
368 | + ListView { |
369 | + objectName: 'listView' |
370 | + } |
371 | + Label { |
372 | + objectName: 'label' |
373 | + } |
374 | +} |
375 | |
376 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.SwipeFlickableTestCase.qml' |
377 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.SwipeFlickableTestCase.qml 1970-01-01 00:00:00 +0000 |
378 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.SwipeFlickableTestCase.qml 2016-08-09 21:14:31 +0000 |
379 | @@ -0,0 +1,83 @@ |
380 | +/* |
381 | + * Copyright 2016 Canonical Ltd. |
382 | + * |
383 | + * This program is free software; you can redistribute it and/or modify |
384 | + * it under the terms of the GNU Lesser General Public License as published by |
385 | + * the Free Software Foundation; version 3. |
386 | + * |
387 | + * This program is distributed in the hope that it will be useful, |
388 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
389 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
390 | + * GNU Lesser General Public License for more details. |
391 | + * |
392 | + * You should have received a copy of the GNU Lesser General Public License |
393 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
394 | + */ |
395 | + |
396 | +import QtQuick 2.4 |
397 | +import Ubuntu.Components 1.3 |
398 | + |
399 | +MainView { |
400 | + width: units.gu(48) |
401 | + height: units.gu(60) |
402 | + objectName: "mainView" |
403 | + |
404 | + Label { |
405 | + id: clickedLabel |
406 | + objectName: "clickedLabel" |
407 | + text: "No element clicked." |
408 | + } |
409 | + |
410 | + Flickable { |
411 | + anchors { |
412 | + fill: parent |
413 | + topMargin: clickedLabel.height |
414 | + } |
415 | + objectName: 'flickable' |
416 | + height: units.gu(60) |
417 | + contentHeight: bottomButton.y + bottomButton.height |
418 | + contentWidth: topRightButton.x + |
419 | + Math.max(topRightButton.width, bottomRightButton.width) |
420 | + |
421 | + Button { |
422 | + id: topButton |
423 | + objectName: 'topButton' |
424 | + text: 'Top button' |
425 | + onClicked: clickedLabel.text = objectName |
426 | + } |
427 | + Rectangle { |
428 | + id: emptyRectangle |
429 | + width: units.gu(70) |
430 | + height: units.gu(80) |
431 | + anchors.top: topButton.bottom |
432 | + } |
433 | + Button { |
434 | + id: bottomButton |
435 | + objectName: 'bottomButton' |
436 | + text: 'Bottom button' |
437 | + onClicked: clickedLabel.text = objectName |
438 | + anchors.top: emptyRectangle.bottom |
439 | + } |
440 | + Button { |
441 | + id: topRightButton |
442 | + objectName: 'topRightButton' |
443 | + text: 'Top-right button' |
444 | + onClicked: clickedLabel.text = objectName |
445 | + anchors { |
446 | + top: parent.top |
447 | + left: emptyRectangle.right |
448 | + } |
449 | + } |
450 | + Button { |
451 | + id: bottomRightButton |
452 | + objectName: 'bottomRightButton' |
453 | + text: 'Bottom-right button' |
454 | + onClicked: clickedLabel.text = objectName |
455 | + anchors { |
456 | + top: emptyRectangle.bottom |
457 | + left: emptyRectangle.right |
458 | + } |
459 | + } |
460 | + } |
461 | +} |
462 | + |
463 | |
464 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.UnityFlickableTestCase.qml' |
465 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.UnityFlickableTestCase.qml 1970-01-01 00:00:00 +0000 |
466 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.UnityFlickableTestCase.qml 2016-08-09 21:14:31 +0000 |
467 | @@ -0,0 +1,31 @@ |
468 | +/* |
469 | + * Copyright 2016 Canonical Ltd. |
470 | + * |
471 | + * This program is free software; you can redistribute it and/or modify |
472 | + * it under the terms of the GNU Lesser General Public License as published by |
473 | + * the Free Software Foundation; version 3. |
474 | + * |
475 | + * This program is distributed in the hope that it will be useful, |
476 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
477 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
478 | + * GNU Lesser General Public License for more details. |
479 | + * |
480 | + * You should have received a copy of the GNU Lesser General Public License |
481 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
482 | + */ |
483 | + |
484 | +import QtQuick 2.4 |
485 | +import Ubuntu.Components 1.3 |
486 | + |
487 | +MainView { |
488 | + width: units.gu(48) |
489 | + height: units.gu(60) |
490 | + objectName: 'mainView' |
491 | + |
492 | + Flickable { |
493 | + objectName: 'testFlickable' |
494 | + width: 200; height: 200 |
495 | + contentWidth: image.width; contentHeight: image.height |
496 | + } |
497 | +} |
498 | + |
499 | |
500 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py' |
501 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py 2016-01-18 14:51:22 +0000 |
502 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py 2016-08-09 21:14:31 +0000 |
503 | @@ -16,6 +16,7 @@ |
504 | |
505 | from unittest import mock |
506 | |
507 | +import os |
508 | import testtools |
509 | import ubuntuuitoolkit |
510 | from ubuntuuitoolkit import ( |
511 | @@ -49,7 +50,7 @@ |
512 | self.assertFalse(element.is_flickable()) |
513 | |
514 | |
515 | -class IsFlickableTestCase(tests.QMLStringAppTestCase): |
516 | +class IsFlickableTestCase(tests.QMLFileAppTestCase): |
517 | """Functional test to check that is_flickable returns the right value. |
518 | |
519 | We already have tests for is_flickable with mocks, so here we just check |
520 | @@ -57,26 +58,10 @@ |
521 | |
522 | """ |
523 | |
524 | - test_qml = (""" |
525 | -import QtQuick 2.4 |
526 | -import Ubuntu.Components 1.3 |
527 | - |
528 | -MainView { |
529 | - objectName: 'mainView' |
530 | - width: units.gu(48) |
531 | - height: units.gu(60) |
532 | - |
533 | - Flickable { |
534 | - objectName: 'flickable' |
535 | - } |
536 | - ListView { |
537 | - objectName: 'listView' |
538 | - } |
539 | - Label { |
540 | - objectName: 'label' |
541 | - } |
542 | -} |
543 | -""") |
544 | + path = os.path.abspath(__file__) |
545 | + dir_path = os.path.dirname(path) |
546 | + test_qml_file_path = os.path.join( |
547 | + dir_path, 'test_flickable.IsFlickableTestCase.qml') |
548 | |
549 | scenarios = [ |
550 | ('main view', dict(object_name='mainView', is_flickable=False)), |
551 | @@ -93,76 +78,12 @@ |
552 | |
553 | # FIXME: Only left-to-right (where x=0 is leftmost) layouts are taken into |
554 | # account. Add support for horizontal flicking with right-to-left layouts. |
555 | -class SwipeFlickableTestCase(tests.QMLStringAppTestCase): |
556 | - |
557 | - test_qml = (""" |
558 | -import QtQuick 2.4 |
559 | -import Ubuntu.Components 1.3 |
560 | - |
561 | -MainView { |
562 | - width: units.gu(48) |
563 | - height: units.gu(60) |
564 | - objectName: "mainView" |
565 | - |
566 | - Label { |
567 | - id: clickedLabel |
568 | - objectName: "clickedLabel" |
569 | - text: "No element clicked." |
570 | - } |
571 | - |
572 | - Flickable { |
573 | - anchors { |
574 | - fill: parent |
575 | - topMargin: clickedLabel.height |
576 | - } |
577 | - objectName: 'flickable' |
578 | - height: units.gu(60) |
579 | - contentHeight: bottomButton.y + bottomButton.height |
580 | - contentWidth: topRightButton.x + |
581 | - Math.max(topRightButton.width, bottomRightButton.width) |
582 | - |
583 | - Button { |
584 | - id: topButton |
585 | - objectName: 'topButton' |
586 | - text: 'Top button' |
587 | - onClicked: clickedLabel.text = objectName |
588 | - } |
589 | - Rectangle { |
590 | - id: emptyRectangle |
591 | - width: units.gu(70) |
592 | - height: units.gu(80) |
593 | - anchors.top: topButton.bottom |
594 | - } |
595 | - Button { |
596 | - id: bottomButton |
597 | - objectName: 'bottomButton' |
598 | - text: 'Bottom button' |
599 | - onClicked: clickedLabel.text = objectName |
600 | - anchors.top: emptyRectangle.bottom |
601 | - } |
602 | - Button { |
603 | - id: topRightButton |
604 | - objectName: 'topRightButton' |
605 | - text: 'Top-right button' |
606 | - onClicked: clickedLabel.text = objectName |
607 | - anchors { |
608 | - top: parent.top |
609 | - left: emptyRectangle.right |
610 | - } |
611 | - } |
612 | - Button { |
613 | - id: bottomRightButton |
614 | - objectName: 'bottomRightButton' |
615 | - text: 'Bottom-right button' |
616 | - onClicked: clickedLabel.text = objectName |
617 | - anchors { |
618 | - top: emptyRectangle.bottom |
619 | - left: emptyRectangle.right |
620 | - } |
621 | - } |
622 | - } |
623 | -} |
624 | -""") |
625 | +class SwipeFlickableTestCase(tests.QMLFileAppTestCase): |
626 | + |
627 | + path = os.path.abspath(__file__) |
628 | + dir_path = os.path.dirname(path) |
629 | + test_qml_file_path = os.path.join( |
630 | + dir_path, 'test_flickable.SwipeFlickableTestCase.qml') |
631 | |
632 | def setUp(self): |
633 | super().setUp() |
634 | @@ -393,24 +314,12 @@ |
635 | self.assertEqual('Could not swipe in the flickable.', str(error)) |
636 | |
637 | |
638 | -class UnityFlickableTestCase(tests.QMLStringAppTestCase): |
639 | - |
640 | - test_qml = (""" |
641 | -import QtQuick 2.4 |
642 | -import Ubuntu.Components 1.3 |
643 | - |
644 | -MainView { |
645 | - width: units.gu(48) |
646 | - height: units.gu(60) |
647 | - objectName: 'mainView' |
648 | - |
649 | - Flickable { |
650 | - objectName: 'testFlickable' |
651 | - width: 200; height: 200 |
652 | - contentWidth: image.width; contentHeight: image.height |
653 | - } |
654 | -} |
655 | -""") |
656 | +class UnityFlickableTestCase(tests.QMLFileAppTestCase): |
657 | + |
658 | + path = os.path.abspath(__file__) |
659 | + dir_path = os.path.dirname(path) |
660 | + test_qml_file_path = os.path.join( |
661 | + dir_path, 'test_flickable.UnityFlickableTestCase.qml') |
662 | |
663 | def get_command_line(self, command_line): |
664 | command_line.append('-engine') |
665 | |
666 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.IsFlickableTestCase.qml' |
667 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.IsFlickableTestCase.qml 1970-01-01 00:00:00 +0000 |
668 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.IsFlickableTestCase.qml 2016-08-09 21:14:31 +0000 |
669 | @@ -0,0 +1,35 @@ |
670 | +/* |
671 | + * Copyright 2016 Canonical Ltd. |
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 | + */ |
685 | + |
686 | +import QtQuick 2.0 |
687 | +import Ubuntu.Components 1.0 |
688 | +import Ubuntu.Components.ListItems 1.0 as ListItem |
689 | + |
690 | +MainView { |
691 | + objectName: 'mainView' |
692 | + width: units.gu(48) |
693 | + height: units.gu(60) |
694 | + |
695 | + Flickable { |
696 | + objectName: 'flickable' |
697 | + } |
698 | + ListView { |
699 | + objectName: 'listView' |
700 | + } |
701 | + Label { |
702 | + objectName: 'label' |
703 | + } |
704 | +} |
705 | |
706 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.SwipeFlickableTestCase.qml' |
707 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.SwipeFlickableTestCase.qml 1970-01-01 00:00:00 +0000 |
708 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.SwipeFlickableTestCase.qml 2016-08-09 21:14:31 +0000 |
709 | @@ -0,0 +1,62 @@ |
710 | +/* |
711 | + * Copyright 2016 Canonical Ltd. |
712 | + * |
713 | + * This program is free software; you can redistribute it and/or modify |
714 | + * it under the terms of the GNU Lesser General Public License as published by |
715 | + * the Free Software Foundation; version 3. |
716 | + * |
717 | + * This program is distributed in the hope that it will be useful, |
718 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
719 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
720 | + * GNU Lesser General Public License for more details. |
721 | + * |
722 | + * You should have received a copy of the GNU Lesser General Public License |
723 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
724 | + */ |
725 | + |
726 | +import QtQuick 2.0 |
727 | +import Ubuntu.Components 1.0 |
728 | + |
729 | +MainView { |
730 | + width: units.gu(48) |
731 | + height: units.gu(60) |
732 | + objectName: "mainView" |
733 | + |
734 | + Label { |
735 | + id: clickedLabel |
736 | + objectName: "clickedLabel" |
737 | + text: "No element clicked." |
738 | + } |
739 | + |
740 | + Flickable { |
741 | + anchors { |
742 | + fill: parent |
743 | + topMargin: clickedLabel.height |
744 | + // It can't be at the bottom, or the toolbar will be opened |
745 | + // when we try to click it. |
746 | + bottomMargin: units.gu(10) |
747 | + } |
748 | + objectName: 'flickable' |
749 | + height: units.gu(60) |
750 | + contentHeight: bottomButton.y + bottomButton.height |
751 | + |
752 | + Button { |
753 | + id: topButton |
754 | + objectName: 'topButton' |
755 | + text: 'Top button' |
756 | + onClicked: clickedLabel.text = objectName |
757 | + } |
758 | + Rectangle { |
759 | + id: emptyRectangle |
760 | + height: units.gu(80) |
761 | + anchors.top: topButton.bottom |
762 | + } |
763 | + Button { |
764 | + id: bottomButton |
765 | + objectName: 'bottomButton' |
766 | + text: 'Bottom button' |
767 | + onClicked: clickedLabel.text = objectName |
768 | + anchors.top: emptyRectangle.bottom |
769 | + } |
770 | + } |
771 | +} |
772 | |
773 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.UnityFlickableTestCase.qml' |
774 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.UnityFlickableTestCase.qml 1970-01-01 00:00:00 +0000 |
775 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.UnityFlickableTestCase.qml 2016-08-09 21:14:31 +0000 |
776 | @@ -0,0 +1,30 @@ |
777 | +/* |
778 | + * Copyright 2016 Canonical Ltd. |
779 | + * |
780 | + * This program is free software; you can redistribute it and/or modify |
781 | + * it under the terms of the GNU Lesser General Public License as published by |
782 | + * the Free Software Foundation; version 3. |
783 | + * |
784 | + * This program is distributed in the hope that it will be useful, |
785 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
786 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
787 | + * GNU Lesser General Public License for more details. |
788 | + * |
789 | + * You should have received a copy of the GNU Lesser General Public License |
790 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
791 | + */ |
792 | + |
793 | +import QtQuick 2.0 |
794 | +import Ubuntu.Components 1.0 |
795 | + |
796 | +MainView { |
797 | + width: units.gu(48) |
798 | + height: units.gu(60) |
799 | + objectName: 'mainView' |
800 | + |
801 | + Flickable { |
802 | + objectName: 'testFlickable' |
803 | + width: 200; height: 200 |
804 | + contentWidth: image.width; contentHeight: image.height |
805 | + } |
806 | +} |
807 | |
808 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.py' |
809 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.py 2016-01-18 15:39:13 +0000 |
810 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable_uitk10.py 2016-08-09 21:14:31 +0000 |
811 | @@ -15,6 +15,7 @@ |
812 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
813 | |
814 | from unittest import mock |
815 | +import os |
816 | |
817 | import testtools |
818 | import ubuntuuitoolkit |
819 | @@ -49,7 +50,7 @@ |
820 | self.assertFalse(element.is_flickable()) |
821 | |
822 | |
823 | -class IsFlickableTestCase(tests.QMLStringAppTestCase): |
824 | +class IsFlickableTestCase(tests.QMLFileAppTestCase): |
825 | """Functional test to check that is_flickable returns the right value. |
826 | |
827 | We already have tests for is_flickable with mocks, so here we just check |
828 | @@ -57,27 +58,10 @@ |
829 | |
830 | """ |
831 | |
832 | - test_qml = (""" |
833 | -import QtQuick 2.0 |
834 | -import Ubuntu.Components 1.0 |
835 | -import Ubuntu.Components.ListItems 1.0 as ListItem |
836 | - |
837 | -MainView { |
838 | - objectName: 'mainView' |
839 | - width: units.gu(48) |
840 | - height: units.gu(60) |
841 | - |
842 | - Flickable { |
843 | - objectName: 'flickable' |
844 | - } |
845 | - ListView { |
846 | - objectName: 'listView' |
847 | - } |
848 | - Label { |
849 | - objectName: 'label' |
850 | - } |
851 | -} |
852 | -""") |
853 | + path = os.path.abspath(__file__) |
854 | + dir_path = os.path.dirname(path) |
855 | + test_qml_file_path = os.path.join( |
856 | + dir_path, 'test_flickable_uitk10.IsFlickableTestCase.qml') |
857 | |
858 | scenarios = [ |
859 | ('main view', dict(object_name='mainView', is_flickable=False)), |
860 | @@ -92,56 +76,12 @@ |
861 | self.assertEqual(element.is_flickable(), self.is_flickable) |
862 | |
863 | |
864 | -class SwipeFlickableTestCase(tests.QMLStringAppTestCase): |
865 | - |
866 | - test_qml = (""" |
867 | -import QtQuick 2.0 |
868 | -import Ubuntu.Components 1.0 |
869 | - |
870 | -MainView { |
871 | - width: units.gu(48) |
872 | - height: units.gu(60) |
873 | - objectName: "mainView" |
874 | - |
875 | - Label { |
876 | - id: clickedLabel |
877 | - objectName: "clickedLabel" |
878 | - text: "No element clicked." |
879 | - } |
880 | - |
881 | - Flickable { |
882 | - anchors { |
883 | - fill: parent |
884 | - topMargin: clickedLabel.height |
885 | - // It can't be at the bottom, or the toolbar will be opened |
886 | - // when we try to click it. |
887 | - bottomMargin: units.gu(10) |
888 | - } |
889 | - objectName: 'flickable' |
890 | - height: units.gu(60) |
891 | - contentHeight: bottomButton.y + bottomButton.height |
892 | - |
893 | - Button { |
894 | - id: topButton |
895 | - objectName: 'topButton' |
896 | - text: 'Top button' |
897 | - onClicked: clickedLabel.text = objectName |
898 | - } |
899 | - Rectangle { |
900 | - id: emptyRectangle |
901 | - height: units.gu(80) |
902 | - anchors.top: topButton.bottom |
903 | - } |
904 | - Button { |
905 | - id: bottomButton |
906 | - objectName: 'bottomButton' |
907 | - text: 'Bottom button' |
908 | - onClicked: clickedLabel.text = objectName |
909 | - anchors.top: emptyRectangle.bottom |
910 | - } |
911 | - } |
912 | -} |
913 | -""") |
914 | +class SwipeFlickableTestCase(tests.QMLFileAppTestCase): |
915 | + |
916 | + path = os.path.abspath(__file__) |
917 | + dir_path = os.path.dirname(path) |
918 | + test_qml_file_path = os.path.join( |
919 | + dir_path, 'test_flickable_uitk10.SwipeFlickableTestCase.qml') |
920 | |
921 | def setUp(self): |
922 | super().setUp() |
923 | @@ -271,24 +211,12 @@ |
924 | self.assertEqual('Could not swipe in the flickable.', str(error)) |
925 | |
926 | |
927 | -class UnityFlickableTestCase(tests.QMLStringAppTestCase): |
928 | - |
929 | - test_qml = (""" |
930 | -import QtQuick 2.0 |
931 | -import Ubuntu.Components 1.0 |
932 | - |
933 | -MainView { |
934 | - width: units.gu(48) |
935 | - height: units.gu(60) |
936 | - objectName: 'mainView' |
937 | - |
938 | - Flickable { |
939 | - objectName: 'testFlickable' |
940 | - width: 200; height: 200 |
941 | - contentWidth: image.width; contentHeight: image.height |
942 | - } |
943 | -} |
944 | -""") |
945 | +class UnityFlickableTestCase(tests.QMLFileAppTestCase): |
946 | + |
947 | + path = os.path.abspath(__file__) |
948 | + dir_path = os.path.dirname(path) |
949 | + test_qml_file_path = os.path.join( |
950 | + dir_path, 'test_flickable_uitk10.UnityFlickableTestCase.qml') |
951 | |
952 | def get_command_line(self, command_line): |
953 | command_line.append('-engine') |
954 | |
955 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitems.SwipeToDeleteTestCase.qml' |
956 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitems.SwipeToDeleteTestCase.qml 1970-01-01 00:00:00 +0000 |
957 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitems.SwipeToDeleteTestCase.qml 2016-08-09 21:14:31 +0000 |
958 | @@ -0,0 +1,79 @@ |
959 | +/* |
960 | + * Copyright 2016 Canonical Ltd. |
961 | + * |
962 | + * This program is free software; you can redistribute it and/or modify |
963 | + * it under the terms of the GNU Lesser General Public License as published by |
964 | + * the Free Software Foundation; version 3. |
965 | + * |
966 | + * This program is distributed in the hope that it will be useful, |
967 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
968 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
969 | + * GNU Lesser General Public License for more details. |
970 | + * |
971 | + * You should have received a copy of the GNU Lesser General Public License |
972 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
973 | + */ |
974 | + |
975 | +import QtQuick 2.0 |
976 | +import Ubuntu.Components 1.0 |
977 | +import Ubuntu.Components.ListItems 1.0 |
978 | + |
979 | +MainView { |
980 | + width: units.gu(48) |
981 | + height: units.gu(60) |
982 | + objectName: "mainView" |
983 | + |
984 | + Page { |
985 | + |
986 | + ListModel { |
987 | + id: testModel |
988 | + |
989 | + ListElement { |
990 | + name: "listitem_destroyed_on_remove_with_confirm" |
991 | + label: "Item destroyed on remove with confirmation" |
992 | + confirm: true |
993 | + } |
994 | + ListElement { |
995 | + name: "listitem_destroyed_on_remove_without_confirm" |
996 | + label: "Item destroyed on remove without confirmation" |
997 | + confirm: false |
998 | + } |
999 | + } |
1000 | + |
1001 | + Column { |
1002 | + anchors { fill: parent } |
1003 | + |
1004 | + Standard { |
1005 | + objectName: "listitem_standard" |
1006 | + confirmRemoval: true |
1007 | + removable: true |
1008 | + text: 'Slide to remove' |
1009 | + } |
1010 | + |
1011 | + Empty { |
1012 | + objectName: "listitem_empty" |
1013 | + } |
1014 | + |
1015 | + Standard { |
1016 | + objectName: "listitem_without_confirm" |
1017 | + confirmRemoval: false |
1018 | + removable: true |
1019 | + text: "Item without delete confirmation" |
1020 | + } |
1021 | + |
1022 | + ListView { |
1023 | + anchors { left: parent.left; right: parent.right } |
1024 | + height: childrenRect.height |
1025 | + model: testModel |
1026 | + |
1027 | + delegate: Standard { |
1028 | + removable: true |
1029 | + confirmRemoval: confirm |
1030 | + onItemRemoved: testModel.remove(index) |
1031 | + text: label |
1032 | + objectName: name |
1033 | + } |
1034 | + } |
1035 | + } |
1036 | + } |
1037 | +} |
1038 | |
1039 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitems.py' |
1040 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitems.py 2015-04-14 21:02:06 +0000 |
1041 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitems.py 2016-08-09 21:14:31 +0000 |
1042 | @@ -48,74 +48,12 @@ |
1043 | listitems.Subtitled, listitems.Base)) |
1044 | |
1045 | |
1046 | -class SwipeToDeleteTestCase(tests.QMLStringAppTestCase): |
1047 | - |
1048 | - test_qml = (""" |
1049 | -import QtQuick 2.0 |
1050 | -import Ubuntu.Components 1.0 |
1051 | -import Ubuntu.Components.ListItems 1.0 |
1052 | - |
1053 | - |
1054 | -MainView { |
1055 | - width: units.gu(48) |
1056 | - height: units.gu(60) |
1057 | - objectName: "mainView" |
1058 | - |
1059 | - Page { |
1060 | - |
1061 | - ListModel { |
1062 | - id: testModel |
1063 | - |
1064 | - ListElement { |
1065 | - name: "listitem_destroyed_on_remove_with_confirm" |
1066 | - label: "Item destroyed on remove with confirmation" |
1067 | - confirm: true |
1068 | - } |
1069 | - ListElement { |
1070 | - name: "listitem_destroyed_on_remove_without_confirm" |
1071 | - label: "Item destroyed on remove without confirmation" |
1072 | - confirm: false |
1073 | - } |
1074 | - } |
1075 | - |
1076 | - Column { |
1077 | - anchors { fill: parent } |
1078 | - |
1079 | - Standard { |
1080 | - objectName: "listitem_standard" |
1081 | - confirmRemoval: true |
1082 | - removable: true |
1083 | - text: 'Slide to remove' |
1084 | - } |
1085 | - |
1086 | - Empty { |
1087 | - objectName: "listitem_empty" |
1088 | - } |
1089 | - |
1090 | - Standard { |
1091 | - objectName: "listitem_without_confirm" |
1092 | - confirmRemoval: false |
1093 | - removable: true |
1094 | - text: "Item without delete confirmation" |
1095 | - } |
1096 | - |
1097 | - ListView { |
1098 | - anchors { left: parent.left; right: parent.right } |
1099 | - height: childrenRect.height |
1100 | - model: testModel |
1101 | - |
1102 | - delegate: Standard { |
1103 | - removable: true |
1104 | - confirmRemoval: confirm |
1105 | - onItemRemoved: testModel.remove(index) |
1106 | - text: label |
1107 | - objectName: name |
1108 | - } |
1109 | - } |
1110 | - } |
1111 | - } |
1112 | -} |
1113 | -""") |
1114 | +class SwipeToDeleteTestCase(tests.QMLFileAppTestCase): |
1115 | + |
1116 | + path = os.path.abspath(__file__) |
1117 | + dir_path = os.path.dirname(path) |
1118 | + test_qml_file_path = os.path.join( |
1119 | + dir_path, 'test_listitems.SwipeToDeleteTestCase.qml') |
1120 | |
1121 | def setUp(self): |
1122 | super().setUp() |
1123 | |
1124 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.GoBackTestCase.back_in_header.qml' |
1125 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.GoBackTestCase.back_in_header.qml 1970-01-01 00:00:00 +0000 |
1126 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.GoBackTestCase.back_in_header.qml 2016-08-09 21:14:31 +0000 |
1127 | @@ -0,0 +1,48 @@ |
1128 | +/* |
1129 | + * Copyright 2016 Canonical Ltd. |
1130 | + * |
1131 | + * This program is free software; you can redistribute it and/or modify |
1132 | + * it under the terms of the GNU Lesser General Public License as published by |
1133 | + * the Free Software Foundation; version 3. |
1134 | + * |
1135 | + * This program is distributed in the hope that it will be useful, |
1136 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1137 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1138 | + * GNU Lesser General Public License for more details. |
1139 | + * |
1140 | + * You should have received a copy of the GNU Lesser General Public License |
1141 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1142 | + */ |
1143 | + |
1144 | +import QtQuick 2.0 |
1145 | +import Ubuntu.Components 1.0 |
1146 | + |
1147 | +MainView { |
1148 | + width: units.gu(48) |
1149 | + height: units.gu(60) |
1150 | + objectName: "mainView" |
1151 | + useDeprecatedToolbar: false |
1152 | + |
1153 | + PageStack { |
1154 | + id: pageStack |
1155 | + Component.onCompleted: push(page0) |
1156 | + |
1157 | + Page { |
1158 | + id: page0 |
1159 | + title: "Page 0" |
1160 | + visible: false |
1161 | + |
1162 | + Button { |
1163 | + objectName: "go_to_page1" |
1164 | + text: "Go to page 1" |
1165 | + onClicked: pageStack.push(page1) |
1166 | + } |
1167 | + } |
1168 | + |
1169 | + Page { |
1170 | + id: page1 |
1171 | + title: "Page 1" |
1172 | + visible: false |
1173 | + } |
1174 | + } |
1175 | +} |
1176 | |
1177 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.GoBackTestCase.back_in_toolbar.qml' |
1178 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.GoBackTestCase.back_in_toolbar.qml 1970-01-01 00:00:00 +0000 |
1179 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.GoBackTestCase.back_in_toolbar.qml 2016-08-09 21:14:31 +0000 |
1180 | @@ -0,0 +1,48 @@ |
1181 | +/* |
1182 | + * Copyright 2016 Canonical Ltd. |
1183 | + * |
1184 | + * This program is free software; you can redistribute it and/or modify |
1185 | + * it under the terms of the GNU Lesser General Public License as published by |
1186 | + * the Free Software Foundation; version 3. |
1187 | + * |
1188 | + * This program is distributed in the hope that it will be useful, |
1189 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1190 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1191 | + * GNU Lesser General Public License for more details. |
1192 | + * |
1193 | + * You should have received a copy of the GNU Lesser General Public License |
1194 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1195 | + */ |
1196 | + |
1197 | +import QtQuick 2.0 |
1198 | +import Ubuntu.Components 1.0 |
1199 | + |
1200 | +MainView { |
1201 | + width: units.gu(48) |
1202 | + height: units.gu(60) |
1203 | + objectName: "mainView" |
1204 | + useDeprecatedToolbar: true |
1205 | + |
1206 | + PageStack { |
1207 | + id: pageStack |
1208 | + Component.onCompleted: push(page0) |
1209 | + |
1210 | + Page { |
1211 | + id: page0 |
1212 | + title: "Page 0" |
1213 | + visible: false |
1214 | + |
1215 | + Button { |
1216 | + objectName: "go_to_page1" |
1217 | + text: "Go to page 1" |
1218 | + onClicked: pageStack.push(page1) |
1219 | + } |
1220 | + } |
1221 | + |
1222 | + Page { |
1223 | + id: page1 |
1224 | + title: "Page 1" |
1225 | + visible: false |
1226 | + } |
1227 | + } |
1228 | +} |
1229 | |
1230 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.MainView10TestCase.qml' |
1231 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.MainView10TestCase.qml 1970-01-01 00:00:00 +0000 |
1232 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.MainView10TestCase.qml 2016-08-09 21:14:31 +0000 |
1233 | @@ -0,0 +1,24 @@ |
1234 | +/* |
1235 | + * Copyright 2016 Canonical Ltd. |
1236 | + * |
1237 | + * This program is free software; you can redistribute it and/or modify |
1238 | + * it under the terms of the GNU Lesser General Public License as published by |
1239 | + * the Free Software Foundation; version 3. |
1240 | + * |
1241 | + * This program is distributed in the hope that it will be useful, |
1242 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1243 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1244 | + * GNU Lesser General Public License for more details. |
1245 | + * |
1246 | + * You should have received a copy of the GNU Lesser General Public License |
1247 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1248 | + */ |
1249 | + |
1250 | +import QtQuick 2.0 |
1251 | +import Ubuntu.Components 1.0 |
1252 | + |
1253 | +MainView { |
1254 | + width: units.gu(48) |
1255 | + height: units.gu(60) |
1256 | + objectName: "mainView" |
1257 | +} |
1258 | |
1259 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.MainView12TestCase.qml' |
1260 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.MainView12TestCase.qml 1970-01-01 00:00:00 +0000 |
1261 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.MainView12TestCase.qml 2016-08-09 21:14:31 +0000 |
1262 | @@ -0,0 +1,24 @@ |
1263 | +/* |
1264 | + * Copyright 2016 Canonical Ltd. |
1265 | + * |
1266 | + * This program is free software; you can redistribute it and/or modify |
1267 | + * it under the terms of the GNU Lesser General Public License as published by |
1268 | + * the Free Software Foundation; version 3. |
1269 | + * |
1270 | + * This program is distributed in the hope that it will be useful, |
1271 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1272 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1273 | + * GNU Lesser General Public License for more details. |
1274 | + * |
1275 | + * You should have received a copy of the GNU Lesser General Public License |
1276 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1277 | + */ |
1278 | + |
1279 | +import QtQuick 2.3 |
1280 | +import Ubuntu.Components 1.2 |
1281 | + |
1282 | +MainView { |
1283 | + width: units.gu(48) |
1284 | + height: units.gu(60) |
1285 | + objectName: "mainView" |
1286 | +} |
1287 | |
1288 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.py' |
1289 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.py 2015-09-22 15:56:35 +0000 |
1290 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.py 2016-08-09 21:14:31 +0000 |
1291 | @@ -14,24 +14,19 @@ |
1292 | # You should have received a copy of the GNU Lesser General Public License |
1293 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
1294 | |
1295 | +import os |
1296 | from unittest import mock |
1297 | |
1298 | import ubuntuuitoolkit |
1299 | from ubuntuuitoolkit import tests |
1300 | |
1301 | |
1302 | -class MainView10TestCase(tests.QMLStringAppTestCase): |
1303 | - |
1304 | - test_qml = (""" |
1305 | -import QtQuick 2.0 |
1306 | -import Ubuntu.Components 1.0 |
1307 | - |
1308 | -MainView { |
1309 | - width: units.gu(48) |
1310 | - height: units.gu(60) |
1311 | - objectName: "mainView" |
1312 | -} |
1313 | -""") |
1314 | +class MainView10TestCase(tests.QMLFileAppTestCase): |
1315 | + |
1316 | + path = os.path.abspath(__file__) |
1317 | + dir_path = os.path.dirname(path) |
1318 | + test_qml_file_path = os.path.join( |
1319 | + dir_path, 'test_main_view.MainView10TestCase.qml') |
1320 | |
1321 | def test_main_view_custom_proxy_object(self): |
1322 | self.assertIsInstance(self.main_view, ubuntuuitoolkit.MainView) |
1323 | @@ -75,18 +70,12 @@ |
1324 | str(error), 'The MainView has no Tabs.') |
1325 | |
1326 | |
1327 | -class MainView12TestCase(tests.QMLStringAppTestCase): |
1328 | - |
1329 | - test_qml = (""" |
1330 | -import QtQuick 2.3 |
1331 | -import Ubuntu.Components 1.2 |
1332 | - |
1333 | -MainView { |
1334 | - width: units.gu(48) |
1335 | - height: units.gu(60) |
1336 | - objectName: "mainView" |
1337 | -} |
1338 | -""") |
1339 | +class MainView12TestCase(tests.QMLFileAppTestCase): |
1340 | + |
1341 | + path = os.path.abspath(__file__) |
1342 | + dir_path = os.path.dirname(path) |
1343 | + test_qml_file_path = os.path.join( |
1344 | + dir_path, 'test_main_view.MainView12TestCase.qml') |
1345 | |
1346 | def test_main_view_custom_proxy_object(self): |
1347 | self.assertIsInstance(self.main_view, ubuntuuitoolkit.MainView) |
1348 | @@ -128,51 +117,20 @@ |
1349 | str(error), 'The MainView has no Toolbar.') |
1350 | |
1351 | |
1352 | -TEST_GO_BACK_QML_FORMAT = (""" |
1353 | -import QtQuick 2.0 |
1354 | -import Ubuntu.Components 1.0 |
1355 | - |
1356 | -MainView {{ |
1357 | - width: units.gu(48) |
1358 | - height: units.gu(60) |
1359 | - objectName: "mainView" |
1360 | - useDeprecatedToolbar: {use_deprecated_toolbar} |
1361 | - |
1362 | - PageStack {{ |
1363 | - id: pageStack |
1364 | - Component.onCompleted: push(page0) |
1365 | - |
1366 | - Page {{ |
1367 | - id: page0 |
1368 | - title: "Page 0" |
1369 | - visible: false |
1370 | - |
1371 | - Button {{ |
1372 | - objectName: "go_to_page1" |
1373 | - text: "Go to page 1" |
1374 | - onClicked: pageStack.push(page1) |
1375 | - }} |
1376 | - }} |
1377 | - |
1378 | - Page {{ |
1379 | - id: page1 |
1380 | - title: "Page 1" |
1381 | - visible: false |
1382 | - }} |
1383 | - }} |
1384 | -}} |
1385 | -""") |
1386 | - |
1387 | - |
1388 | -class GoBackTestCase(tests.QMLStringAppTestCase): |
1389 | +class GoBackTestCase(tests.QMLFileAppTestCase): |
1390 | + |
1391 | + path = os.path.abspath(__file__) |
1392 | + dir_path = os.path.dirname(path) |
1393 | + toolbar_test_qml_file_path = os.path.join( |
1394 | + dir_path, 'test_main_view.GoBackTestCase.back_in_toolbar.qml') |
1395 | + header_test_qml_file_path = os.path.join( |
1396 | + dir_path, 'test_main_view.GoBackTestCase.back_in_header.qml') |
1397 | |
1398 | scenarios = [ |
1399 | - ('back in toolbar', dict( |
1400 | - test_qml=TEST_GO_BACK_QML_FORMAT.format( |
1401 | - use_deprecated_toolbar='true'))), |
1402 | - ('back in header', dict( |
1403 | - test_qml=TEST_GO_BACK_QML_FORMAT.format( |
1404 | - use_deprecated_toolbar='false'))) |
1405 | + ('back_in_toolbar', dict( |
1406 | + test_qml_file_path=toolbar_test_qml_file_path)), |
1407 | + ('back_in_header', dict( |
1408 | + test_qml_file_path=header_test_qml_file_path)) |
1409 | ] |
1410 | |
1411 | def setUp(self): |
1412 | |
1413 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.OptionSelectorCustomDelegateTestCase.qml' |
1414 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.OptionSelectorCustomDelegateTestCase.qml 1970-01-01 00:00:00 +0000 |
1415 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.OptionSelectorCustomDelegateTestCase.qml 2016-08-09 21:14:31 +0000 |
1416 | @@ -0,0 +1,60 @@ |
1417 | +/* |
1418 | + * Copyright 2016 Canonical Ltd. |
1419 | + * |
1420 | + * This program is free software; you can redistribute it and/or modify |
1421 | + * it under the terms of the GNU Lesser General Public License as published by |
1422 | + * the Free Software Foundation; version 3. |
1423 | + * |
1424 | + * This program is distributed in the hope that it will be useful, |
1425 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1426 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1427 | + * GNU Lesser General Public License for more details. |
1428 | + * |
1429 | + * You should have received a copy of the GNU Lesser General Public License |
1430 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1431 | + */ |
1432 | + |
1433 | +import QtQuick 2.0 |
1434 | +import Ubuntu.Components 1.0 |
1435 | + |
1436 | +MainView { |
1437 | + width: units.gu(48) |
1438 | + height: units.gu(60) |
1439 | + objectName: "mainView" |
1440 | + |
1441 | + Page{ |
1442 | + |
1443 | + Column { |
1444 | + anchors.left: parent.left |
1445 | + anchors.right: parent.right |
1446 | + anchors.fill: parent |
1447 | + |
1448 | + spacing: units.gu(3) |
1449 | + |
1450 | + Component { |
1451 | + id: valueSelectorDelegate |
1452 | + OptionSelectorDelegate { |
1453 | + text: label |
1454 | + objectName: name |
1455 | + } |
1456 | + } |
1457 | + |
1458 | + ListModel { |
1459 | + id: valueModel |
1460 | + ListElement { name: "one"; label: "Value 1" } |
1461 | + ListElement { name: "two"; label: "Value 2" } |
1462 | + ListElement { name: "three"; label: "Value 3" } |
1463 | + ListElement { name: "four"; label: "Value 4" } |
1464 | + ListElement { name: "five"; label: "Value 5" } |
1465 | + } |
1466 | + |
1467 | + OptionSelector { |
1468 | + id: valueSelector |
1469 | + objectName: "test_option_selector_collapsed" |
1470 | + text: "Collapsed" |
1471 | + delegate: valueSelectorDelegate |
1472 | + model: valueModel |
1473 | + } |
1474 | + } |
1475 | + } |
1476 | +} |
1477 | |
1478 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.OptionSelectorTestCase.qml' |
1479 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.OptionSelectorTestCase.qml 1970-01-01 00:00:00 +0000 |
1480 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.OptionSelectorTestCase.qml 2016-08-09 21:14:31 +0000 |
1481 | @@ -0,0 +1,42 @@ |
1482 | +/* |
1483 | + * Copyright 2016 Canonical Ltd. |
1484 | + * |
1485 | + * This program is free software; you can redistribute it and/or modify |
1486 | + * it under the terms of the GNU Lesser General Public License as published by |
1487 | + * the Free Software Foundation; version 3. |
1488 | + * |
1489 | + * This program is distributed in the hope that it will be useful, |
1490 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1491 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1492 | + * GNU Lesser General Public License for more details. |
1493 | + * |
1494 | + * You should have received a copy of the GNU Lesser General Public License |
1495 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1496 | + */ |
1497 | + |
1498 | +import QtQuick 2.0 |
1499 | +import Ubuntu.Components 1.0 |
1500 | + |
1501 | +MainView { |
1502 | + width: units.gu(48) |
1503 | + height: units.gu(120) |
1504 | + objectName: "mainView" |
1505 | + |
1506 | + Column { |
1507 | + anchors.fill: parent |
1508 | + anchors.left: parent.left |
1509 | + anchors.right: parent.right |
1510 | + spacing: units.gu(3) |
1511 | + |
1512 | + OptionSelector { |
1513 | + objectName: "option_selector" |
1514 | + text: i18n.tr("option_selector") |
1515 | + expanded: true |
1516 | + model: [i18n.tr("Red"), |
1517 | + i18n.tr("Blue"), |
1518 | + i18n.tr("Green"), |
1519 | + i18n.tr("Yellow"), |
1520 | + i18n.tr("Black")] |
1521 | + } |
1522 | + } |
1523 | +} |
1524 | |
1525 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.py' |
1526 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.py 2015-04-14 21:02:06 +0000 |
1527 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_optionselector.py 2016-08-09 21:14:31 +0000 |
1528 | @@ -14,58 +14,18 @@ |
1529 | # You should have received a copy of the GNU Lesser General Public License |
1530 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
1531 | |
1532 | +import os |
1533 | import ubuntuuitoolkit |
1534 | from ubuntuuitoolkit import tests |
1535 | |
1536 | |
1537 | -class OptionSelectorCustomDelegateTestCase(tests.QMLStringAppTestCase): |
1538 | - |
1539 | - test_qml = (""" |
1540 | -import QtQuick 2.0 |
1541 | -import Ubuntu.Components 1.0 |
1542 | - |
1543 | -MainView { |
1544 | - width: units.gu(48) |
1545 | - height: units.gu(60) |
1546 | - objectName: "mainView" |
1547 | - |
1548 | - Page{ |
1549 | - |
1550 | - Column { |
1551 | - anchors.left: parent.left |
1552 | - anchors.right: parent.right |
1553 | - anchors.fill: parent |
1554 | - |
1555 | - spacing: units.gu(3) |
1556 | - |
1557 | - Component { |
1558 | - id: valueSelectorDelegate |
1559 | - OptionSelectorDelegate { |
1560 | - text: label |
1561 | - objectName: name |
1562 | - } |
1563 | - } |
1564 | - |
1565 | - ListModel { |
1566 | - id: valueModel |
1567 | - ListElement { name: "one"; label: "Value 1" } |
1568 | - ListElement { name: "two"; label: "Value 2" } |
1569 | - ListElement { name: "three"; label: "Value 3" } |
1570 | - ListElement { name: "four"; label: "Value 4" } |
1571 | - ListElement { name: "five"; label: "Value 5" } |
1572 | - } |
1573 | - |
1574 | - OptionSelector { |
1575 | - id: valueSelector |
1576 | - objectName: "test_option_selector_collapsed" |
1577 | - text: "Collapsed" |
1578 | - delegate: valueSelectorDelegate |
1579 | - model: valueModel |
1580 | - } |
1581 | - } |
1582 | - } |
1583 | -} |
1584 | -""") |
1585 | +class OptionSelectorCustomDelegateTestCase(tests.QMLFileAppTestCase): |
1586 | + |
1587 | + path = os.path.abspath(__file__) |
1588 | + dir_path = os.path.dirname(path) |
1589 | + test_qml_file_path = os.path.join( |
1590 | + dir_path, |
1591 | + 'test_optionselector.OptionSelectorCustomDelegateTestCase.qml') |
1592 | |
1593 | def setUp(self): |
1594 | super().setUp() |
1595 | @@ -119,36 +79,12 @@ |
1596 | self.assertEqual(2, self.option_selector.selectedIndex) |
1597 | |
1598 | |
1599 | -class OptionSelectorTestCase(tests.QMLStringAppTestCase): |
1600 | - |
1601 | - test_qml = (""" |
1602 | -import QtQuick 2.0 |
1603 | -import Ubuntu.Components 1.0 |
1604 | - |
1605 | -MainView { |
1606 | - width: units.gu(48) |
1607 | - height: units.gu(120) |
1608 | - objectName: "mainView" |
1609 | - |
1610 | - Column { |
1611 | - anchors.fill: parent |
1612 | - anchors.left: parent.left |
1613 | - anchors.right: parent.right |
1614 | - spacing: units.gu(3) |
1615 | - |
1616 | - OptionSelector { |
1617 | - objectName: "option_selector" |
1618 | - text: i18n.tr("option_selector") |
1619 | - expanded: true |
1620 | - model: [i18n.tr("Red"), |
1621 | - i18n.tr("Blue"), |
1622 | - i18n.tr("Green"), |
1623 | - i18n.tr("Yellow"), |
1624 | - i18n.tr("Black")] |
1625 | - } |
1626 | - } |
1627 | -} |
1628 | -""") |
1629 | +class OptionSelectorTestCase(tests.QMLFileAppTestCase): |
1630 | + |
1631 | + path = os.path.abspath(__file__) |
1632 | + dir_path = os.path.dirname(path) |
1633 | + test_qml_file_path = os.path.join( |
1634 | + dir_path, 'test_optionselector.OptionSelectorTestCase.qml') |
1635 | |
1636 | def setUp(self): |
1637 | super().setUp() |
1638 | |
1639 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_popups.ComposerSheetTestCase.qml' |
1640 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_popups.ComposerSheetTestCase.qml 1970-01-01 00:00:00 +0000 |
1641 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_popups.ComposerSheetTestCase.qml 2016-08-09 21:14:31 +0000 |
1642 | @@ -0,0 +1,52 @@ |
1643 | +/* |
1644 | + * Copyright 2016 Canonical Ltd. |
1645 | + * |
1646 | + * This program is free software; you can redistribute it and/or modify |
1647 | + * it under the terms of the GNU Lesser General Public License as published by |
1648 | + * the Free Software Foundation; version 3. |
1649 | + * |
1650 | + * This program is distributed in the hope that it will be useful, |
1651 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1652 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1653 | + * GNU Lesser General Public License for more details. |
1654 | + * |
1655 | + * You should have received a copy of the GNU Lesser General Public License |
1656 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1657 | + */ |
1658 | + |
1659 | +import QtQuick 2.0 |
1660 | +import Ubuntu.Components 1.0 |
1661 | +import Ubuntu.Components.Popups 1.0 |
1662 | + |
1663 | +MainView { |
1664 | + width: units.gu(48) |
1665 | + height: units.gu(60) |
1666 | + objectName: "mainView" |
1667 | + |
1668 | + Button { |
1669 | + objectName: "openComposerSheetButton" |
1670 | + text: "Open Composer Sheet" |
1671 | + onClicked: PopupUtils.open(testComposerSheet); |
1672 | + } |
1673 | + |
1674 | + Label { |
1675 | + id: "label" |
1676 | + objectName: "actionLabel" |
1677 | + anchors.centerIn: parent |
1678 | + text: "No action taken." |
1679 | + } |
1680 | + |
1681 | + Component { |
1682 | + id: testComposerSheet |
1683 | + ComposerSheet { |
1684 | + id: sheet |
1685 | + objectName: "testComposerSheet" |
1686 | + onCancelClicked: { |
1687 | + label.text = "Cancel selected." |
1688 | + } |
1689 | + onConfirmClicked: { |
1690 | + label.text = "Confirm selected." |
1691 | + } |
1692 | + } |
1693 | + } |
1694 | +} |
1695 | |
1696 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_popups.py' |
1697 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_popups.py 2015-09-30 15:10:11 +0000 |
1698 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_popups.py 2016-08-09 21:14:31 +0000 |
1699 | @@ -110,46 +110,12 @@ |
1700 | str(error), 'The popover is not open.') |
1701 | |
1702 | |
1703 | -class ComposerSheetTestCase(tests.QMLStringAppTestCase): |
1704 | - |
1705 | - test_qml = (""" |
1706 | -import QtQuick 2.0 |
1707 | -import Ubuntu.Components 1.0 |
1708 | -import Ubuntu.Components.Popups 1.0 |
1709 | - |
1710 | -MainView { |
1711 | - width: units.gu(48) |
1712 | - height: units.gu(60) |
1713 | - objectName: "mainView" |
1714 | - |
1715 | - Button { |
1716 | - objectName: "openComposerSheetButton" |
1717 | - text: "Open Composer Sheet" |
1718 | - onClicked: PopupUtils.open(testComposerSheet); |
1719 | - } |
1720 | - |
1721 | - Label { |
1722 | - id: "label" |
1723 | - objectName: "actionLabel" |
1724 | - anchors.centerIn: parent |
1725 | - text: "No action taken." |
1726 | - } |
1727 | - |
1728 | - Component { |
1729 | - id: testComposerSheet |
1730 | - ComposerSheet { |
1731 | - id: sheet |
1732 | - objectName: "testComposerSheet" |
1733 | - onCancelClicked: { |
1734 | - label.text = "Cancel selected." |
1735 | - } |
1736 | - onConfirmClicked: { |
1737 | - label.text = "Confirm selected." |
1738 | - } |
1739 | - } |
1740 | - } |
1741 | -} |
1742 | -""") |
1743 | +class ComposerSheetTestCase(tests.QMLFileAppTestCase): |
1744 | + |
1745 | + path = os.path.abspath(__file__) |
1746 | + dir_path = os.path.dirname(path) |
1747 | + test_qml_file_path = os.path.join( |
1748 | + dir_path, 'test_popups.ComposerSheetTestCase.qml') |
1749 | |
1750 | def setUp(self): |
1751 | super().setUp() |
1752 | |
1753 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.QQuickListViewOutOfViewTestCase.qml' |
1754 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.QQuickListViewOutOfViewTestCase.qml 1970-01-01 00:00:00 +0000 |
1755 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.QQuickListViewOutOfViewTestCase.qml 2016-08-09 21:14:31 +0000 |
1756 | @@ -0,0 +1,62 @@ |
1757 | +/* |
1758 | + * Copyright 2016 Canonical Ltd. |
1759 | + * |
1760 | + * This program is free software; you can redistribute it and/or modify |
1761 | + * it under the terms of the GNU Lesser General Public License as published by |
1762 | + * the Free Software Foundation; version 3. |
1763 | + * |
1764 | + * This program is distributed in the hope that it will be useful, |
1765 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1766 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1767 | + * GNU Lesser General Public License for more details. |
1768 | + * |
1769 | + * You should have received a copy of the GNU Lesser General Public License |
1770 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1771 | + */ |
1772 | + |
1773 | +import QtQuick 2.0 |
1774 | +import Ubuntu.Components 1.0 |
1775 | +import Ubuntu.Components.ListItems 1.0 as ListItem |
1776 | + |
1777 | +MainView { |
1778 | + width: units.gu(48) |
1779 | + height: units.gu(20) |
1780 | + objectName: "mainView" |
1781 | + |
1782 | + Page { |
1783 | + |
1784 | + Flickable { |
1785 | + |
1786 | + Column { |
1787 | + id: column |
1788 | + width: units.gu(48) |
1789 | + // The column height is greater than the main view height, so |
1790 | + // the bottom of the list is out of view. |
1791 | + height: units.gu(40) |
1792 | + |
1793 | + Label { |
1794 | + id: clickedLabel |
1795 | + objectName: "clickedLabel" |
1796 | + text: "No element clicked." |
1797 | + } |
1798 | + |
1799 | + ListView { |
1800 | + id: testListView |
1801 | + objectName: "testListView" |
1802 | + anchors.left: parent.left |
1803 | + anchors.right: parent.right |
1804 | + height: column.height - clickedLabel.paintedHeight |
1805 | + clip: true |
1806 | + model: 20 |
1807 | + |
1808 | + delegate: ListItem.Standard { |
1809 | + objectName: "testListElement%1".arg(index) |
1810 | + text: "test list element %1".arg(index) |
1811 | + onClicked: clickedLabel.text = objectName |
1812 | + height: units.gu(5) |
1813 | + } |
1814 | + } |
1815 | + } |
1816 | + } |
1817 | + } |
1818 | +} |
1819 | |
1820 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.py' |
1821 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.py 2016-01-20 17:35:53 +0000 |
1822 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.py 2016-08-09 21:14:31 +0000 |
1823 | @@ -150,57 +150,13 @@ |
1824 | str(error), 'List element with objectName "unexisting" not found.') |
1825 | |
1826 | |
1827 | -class QQuickListViewOutOfViewTestCase(tests.QMLStringAppTestCase): |
1828 | +class QQuickListViewOutOfViewTestCase(tests.QMLFileAppTestCase): |
1829 | """Test that we can make elements visible when the list is out of view.""" |
1830 | |
1831 | - test_qml = (""" |
1832 | -import QtQuick 2.0 |
1833 | -import Ubuntu.Components 1.0 |
1834 | -import Ubuntu.Components.ListItems 1.0 as ListItem |
1835 | - |
1836 | -MainView { |
1837 | - width: units.gu(48) |
1838 | - height: units.gu(20) |
1839 | - objectName: "mainView" |
1840 | - |
1841 | - Page { |
1842 | - |
1843 | - Flickable { |
1844 | - |
1845 | - Column { |
1846 | - id: column |
1847 | - width: units.gu(48) |
1848 | - // The column height is greater than the main view height, so |
1849 | - // the bottom of the list is out of view. |
1850 | - height: units.gu(40) |
1851 | - |
1852 | - Label { |
1853 | - id: clickedLabel |
1854 | - objectName: "clickedLabel" |
1855 | - text: "No element clicked." |
1856 | - } |
1857 | - |
1858 | - ListView { |
1859 | - id: testListView |
1860 | - objectName: "testListView" |
1861 | - anchors.left: parent.left |
1862 | - anchors.right: parent.right |
1863 | - height: column.height - clickedLabel.paintedHeight |
1864 | - clip: true |
1865 | - model: 20 |
1866 | - |
1867 | - delegate: ListItem.Standard { |
1868 | - objectName: "testListElement%1".arg(index) |
1869 | - text: "test list element %1".arg(index) |
1870 | - onClicked: clickedLabel.text = objectName |
1871 | - height: units.gu(5) |
1872 | - } |
1873 | - } |
1874 | - } |
1875 | - } |
1876 | - } |
1877 | -} |
1878 | -""") |
1879 | + path = os.path.abspath(__file__) |
1880 | + dir_path = os.path.dirname(path) |
1881 | + test_qml_file_path = os.path.join( |
1882 | + dir_path, 'test_qquicklistview.QQuickListViewOutOfViewTestCase.qml') |
1883 | |
1884 | def setUp(self): |
1885 | super().setUp() |
1886 | |
1887 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_textarea.TextAreaTestCase.qml' |
1888 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_textarea.TextAreaTestCase.qml 1970-01-01 00:00:00 +0000 |
1889 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_textarea.TextAreaTestCase.qml 2016-08-09 21:14:31 +0000 |
1890 | @@ -0,0 +1,30 @@ |
1891 | +/* |
1892 | + * Copyright 2016 Canonical Ltd. |
1893 | + * |
1894 | + * This program is free software; you can redistribute it and/or modify |
1895 | + * it under the terms of the GNU Lesser General Public License as published by |
1896 | + * the Free Software Foundation; version 3. |
1897 | + * |
1898 | + * This program is distributed in the hope that it will be useful, |
1899 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1900 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1901 | + * GNU Lesser General Public License for more details. |
1902 | + * |
1903 | + * You should have received a copy of the GNU Lesser General Public License |
1904 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1905 | + */ |
1906 | + |
1907 | +import QtQuick 2.0 |
1908 | +import Ubuntu.Components 1.0 |
1909 | + |
1910 | +MainView { |
1911 | + width: units.gu(48) |
1912 | + height: units.gu(60) |
1913 | + objectName: "mainView" |
1914 | + |
1915 | + Item { |
1916 | + TextArea { |
1917 | + objectName: "simple_text_area" |
1918 | + } |
1919 | + } |
1920 | +} |
1921 | |
1922 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_textarea.py' |
1923 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_textarea.py 2015-06-17 15:06:48 +0000 |
1924 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_textarea.py 2016-08-09 21:14:31 +0000 |
1925 | @@ -14,30 +14,19 @@ |
1926 | # You should have received a copy of the GNU Lesser General Public License |
1927 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
1928 | |
1929 | +import os |
1930 | from testtools.matchers import GreaterThan |
1931 | |
1932 | import ubuntuuitoolkit |
1933 | from ubuntuuitoolkit import tests |
1934 | |
1935 | |
1936 | -class TextAreaTestCase(tests.QMLStringAppTestCase): |
1937 | - |
1938 | - test_qml = (""" |
1939 | -import QtQuick 2.0 |
1940 | -import Ubuntu.Components 1.0 |
1941 | - |
1942 | -MainView { |
1943 | - width: units.gu(48) |
1944 | - height: units.gu(60) |
1945 | - objectName: "mainView" |
1946 | - |
1947 | - Item { |
1948 | - TextArea { |
1949 | - objectName: "simple_text_area" |
1950 | - } |
1951 | - } |
1952 | -} |
1953 | -""") |
1954 | +class TextAreaTestCase(tests.QMLFileAppTestCase): |
1955 | + |
1956 | + path = os.path.abspath(__file__) |
1957 | + dir_path = os.path.dirname(path) |
1958 | + test_qml_file_path = os.path.join( |
1959 | + dir_path, 'test_textarea.TextAreaTestCase.qml') |
1960 | |
1961 | def setUp(self): |
1962 | super().setUp() |
1963 | |
1964 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_toolbar.ToolbarTestCase.qml' |
1965 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_toolbar.ToolbarTestCase.qml 1970-01-01 00:00:00 +0000 |
1966 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_toolbar.ToolbarTestCase.qml 2016-08-09 21:14:31 +0000 |
1967 | @@ -0,0 +1,49 @@ |
1968 | +/* |
1969 | + * Copyright 2016 Canonical Ltd. |
1970 | + * |
1971 | + * This program is free software; you can redistribute it and/or modify |
1972 | + * it under the terms of the GNU Lesser General Public License as published by |
1973 | + * the Free Software Foundation; version 3. |
1974 | + * |
1975 | + * This program is distributed in the hope that it will be useful, |
1976 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1977 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1978 | + * GNU Lesser General Public License for more details. |
1979 | + * |
1980 | + * You should have received a copy of the GNU Lesser General Public License |
1981 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1982 | + */ |
1983 | + |
1984 | +import QtQuick 2.0 |
1985 | +import Ubuntu.Components 1.0 |
1986 | + |
1987 | +MainView { |
1988 | + width: units.gu(50) |
1989 | + height: units.gu(50) |
1990 | + objectName: "mainView" |
1991 | + |
1992 | + // Make sure that for these tests the toolbar starts closed. |
1993 | + Component.onCompleted: { |
1994 | + __propagated.toolbar.close(); |
1995 | + } |
1996 | + |
1997 | + Page { |
1998 | + |
1999 | + Label { |
2000 | + id: "label" |
2001 | + objectName: "clicked_label" |
2002 | + anchors.centerIn: parent |
2003 | + text: "Button not clicked." |
2004 | + } |
2005 | + |
2006 | + tools: ToolbarItems { |
2007 | + ToolbarButton { |
2008 | + objectName: "buttonName" |
2009 | + action: Action { |
2010 | + text: "buttonText" |
2011 | + onTriggered: label.text = "Button clicked." |
2012 | + } |
2013 | + } |
2014 | + } |
2015 | + } |
2016 | +} |
2017 | |
2018 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_toolbar.py' |
2019 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_toolbar.py 2015-04-14 21:02:06 +0000 |
2020 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_toolbar.py 2016-08-09 21:14:31 +0000 |
2021 | @@ -14,49 +14,19 @@ |
2022 | # You should have received a copy of the GNU Lesser General Public License |
2023 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
2024 | |
2025 | +import os |
2026 | from unittest import mock |
2027 | |
2028 | import ubuntuuitoolkit |
2029 | from ubuntuuitoolkit import tests |
2030 | |
2031 | |
2032 | -class ToolbarTestCase(tests.QMLStringAppTestCase): |
2033 | - |
2034 | - test_qml = (""" |
2035 | -import QtQuick 2.0 |
2036 | -import Ubuntu.Components 1.0 |
2037 | - |
2038 | -MainView { |
2039 | - width: units.gu(50) |
2040 | - height: units.gu(50) |
2041 | - objectName: "mainView" |
2042 | - |
2043 | - // Make sure that for these tests the toolbar starts closed. |
2044 | - Component.onCompleted: { |
2045 | - __propagated.toolbar.close(); |
2046 | - } |
2047 | - |
2048 | - Page { |
2049 | - |
2050 | - Label { |
2051 | - id: "label" |
2052 | - objectName: "clicked_label" |
2053 | - anchors.centerIn: parent |
2054 | - text: "Button not clicked." |
2055 | - } |
2056 | - |
2057 | - tools: ToolbarItems { |
2058 | - ToolbarButton { |
2059 | - objectName: "buttonName" |
2060 | - action: Action { |
2061 | - text: "buttonText" |
2062 | - onTriggered: label.text = "Button clicked." |
2063 | - } |
2064 | - } |
2065 | - } |
2066 | - } |
2067 | -} |
2068 | -""") |
2069 | +class ToolbarTestCase(tests.QMLFileAppTestCase): |
2070 | + |
2071 | + path = os.path.abspath(__file__) |
2072 | + dir_path = os.path.dirname(path) |
2073 | + test_qml_file_path = os.path.join( |
2074 | + dir_path, 'test_toolbar.ToolbarTestCase.qml') |
2075 | |
2076 | def setUp(self): |
2077 | super().setUp() |
FAILED: Continuous integration, rev:2068 /jenkins. ubuntu. com/ubuntu- sdk/job/ ubuntu- ui-toolkit- ci-i386- gles-stable/ 934/ /jenkins. ubuntu. com/ubuntu- sdk/job/ generic- update- mp/4988/ console
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild: /jenkins. ubuntu. com/ubuntu- sdk/job/ ubuntu- ui-toolkit- ci-i386- gles-stable/ 934/rebuild
https:/