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