1 /****************************************************************************
3 ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
6 ** This file is part of the test suite of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
40 ****************************************************************************/
42 //TESTED_COMPONENT=qtdeclarative
46 using_section_delegates: function()
49 testTitle = "Using and changing section delegate properties";
50 testBinary = "sections.qml";
51 testSource: "$QTDIR/qtdeclarative/tests/system/listview";
52 testGoal = "Verify that a Component can be set as a section header, using various properties for different collections.";
53 testPreconditions = "None";
54 testGroups = "BAT,QtQuick 2.0";
57 prompt(twiki('---+++ ' + testTitle + '<br><br>
58 *Goal:* ' + testGoal + '<br>
59 *Pre-Requisites:* ' + testPreconditions + '<br>
60 *Tested Binary:* ' + testBinary + '<br>
61 | *Step* | *Verification* |
62 | Run '+testBinary+' | Application has started, showing a ListView |
63 | | The view shows a single character section header for each element |
64 | Press the Criteria button | The section headers now show the full name of each item |
65 | Press Property | The section headers now show the id value for the items |
66 | Press Criteria | The section headers now only show i - the first character of id |
67 | Press Property | The section headers show the first character of the item names |'));
70 updating_sections: function()
73 testTitle = "Updating Collected Sections";
74 testBinary = "sections.qml";
75 testSource: "$QTDIR/qtdeclarative/tests/system/listview";
76 testGoal = "Verify that a section is updated when items are added.";
77 testPreconditions = "None";
78 testGroups = "BAT,QtQuick 2.0";
81 prompt(twiki('---+++ ' + testTitle + '<br><br>
82 *Goal:* ' + testGoal + '<br>
83 *Pre-Requisites:* ' + testPreconditions + '<br>
84 *Tested Binary:* ' + testBinary + '<br>
85 | *Step* | *Verification* |
86 | Run '+testBinary+' | Application has started, showing a ListView |
87 | | The view shows a single character section header for each element |
88 | Press the + button | A duplicate of every name is added |
89 | | Each duplicate is place in the same section as the original |'));
92 changing_section_delegates: function()
95 testTitle = "Changing Section Delegates";
96 testBinary = "sections.qml";
97 testSource: "$QTDIR/qtdeclarative/tests/system/listview";
98 testGoal = "Verify that a section delegate can be changed.";
99 testPreconditions = "None";
100 testGroups = "BAT,QtQuick 2.0";
103 prompt(twiki('---+++ ' + testTitle + '<br><br>
104 *Goal:* ' + testGoal + '<br>
105 *Pre-Requisites:* ' + testPreconditions + '<br>
106 *Tested Binary:* ' + testBinary + '<br>
107 | *Step* | *Verification* |
108 | Run '+testBinary+' | Application has started, showing a ListView |
109 | | The view shows a single character section header for each element |
110 | Press the Delegate button | The section headers now show as light blue rectangles |
111 | Press the Criteria button | The headers show as full names, still within light blue rectangles |'));
114 altering_listview_primary_properties: function()
117 testTitle = "Altering ListView primary properties";
118 testBinary = "alteredViews.qml";
119 testSource: "$QTDIR/qtdeclarative/tests/system/listview";
120 testGoal = "Verify that the model and delegate for a ListView can be changed";
121 testPreconditions = "None";
122 testGroups = "BAT,QtQuick 2.0";
125 prompt(twiki('---+++ ' + testTitle + '<br><br>
126 *Goal:* ' + testGoal + '<br>
127 *Pre-Requisites:* ' + testPreconditions + '<br>
128 *Tested Binary:* ' + testBinary + '<br>
129 | *Step* | *Verification* |
130 | Run '+testBinary+' | Application has started, showing a ListView |
131 | | The view shows items named Model1_1 - 5, and the delegates are white with a black border |
132 | Press the Mod button | The view now shows items named Model2_1 - 5 |
133 | Press Del | The delegates are now golden with a black border |
134 | Press Mod, then Del | The view again shows items named Model1_1 - 5, and are white |'));
137 altering_listview_orientation: function()
140 testTitle = "Altering ListView orientation";
141 testBinary = "alteredViews.qml";
142 testSource: "$QTDIR/qtdeclarative/tests/system/listview";
143 testGoal = "Verify that the orientation of a listview can be changed at runtime";
144 testPreconditions = "None";
145 testGroups = "BAT,QtQuick 2.0";
148 prompt(twiki('---+++ ' + testTitle + '<br><br>
149 *Goal:* ' + testGoal + '<br>
150 *Pre-Requisites:* ' + testPreconditions + '<br>
151 *Tested Binary:* ' + testBinary + '<br>
152 | *Step* | *Verification* |
153 | Run '+testBinary+' | Application has started, showing a ListView |
154 | | The view shows items named Model1_1 - 5, and the delegates are white with a black border |
155 | Press the Ori button | The view is now displayed in a horizontal orientation |
156 | | The delegates should have resized quickly and smoothly, and the text rotated anticlockwise (both animated) |
157 | Press Del | The delegates are now golden with a black border, still in horizontal orientation |
158 | Press Ori | The view again shows in a vertical orientation, with the golden delegates |'));
161 basic_view_transition: function()
164 testTitle = "Basic View Transitions";
165 testBinary = "viewTransitions.qml";
166 testSource: "$QTDIR/qtdeclarative/tests/system/listview";
167 testGoal = "Verify a basic transition can be applied to a ListView action";
168 testPreconditions = "None";
169 testGroups = "BAT,QtQuick 2.0";
170 testRequirements = "QTBUG-21504: Enable transitions for add/move/remove operations on views";
173 prompt(twiki('---+++ ' + testTitle + '<br><br>
174 *Goal:* ' + testGoal + '<br>
175 *Pre-Requisites:* ' + testPreconditions + '<br>
176 *Tested Binary:* ' + testBinary + '<br>
177 | *Step* | *Verification* |
178 | Run '+testBinary+' | Application has started, showing a ListView |
179 | Press the Set A button | The Set A button shows green |
180 | Press Add | A new yellow item fades in after the currently selected item |
181 | | The other items slide down, with a slight delay for each item, giving it a flowing effect |
182 | Select the new item | |
183 | Press To Top | The item changes to light blue and moves to the top, curving out to the right of the ListView |
184 | Select an item near the top and press Remove | The selected item fades out |
185 | | The other items slide up, with a slight delay for each item, giving it a flowing effect |'));
188 switching_view_transition: function() {
190 testTitle = "Switching View Transitions";
191 testBinary = "viewTransitions.qml";
192 testSource: "$QTDIR/qtdeclarative/tests/system/listview";
193 testGoal = "Verify a basic ListView transition can be changed to another";
194 testPreconditions = "None";
195 testGroups = "BAT,QtQuick 2.0";
196 testRequirements = "QTBUG-21504: Enable transitions for add/move/remove operations on views";
199 prompt(twiki('---+++ ' + testTitle + '<br><br>
200 *Goal:* ' + testGoal + '<br>
201 *Pre-Requisites:* ' + testPreconditions + '<br>
202 *Tested Binary:* ' + testBinary + '<br>
203 | *Step* | *Verification* |
204 | Run '+testBinary+' | Application has started, showing a ListView |
205 | Press the Set A button | The Set A button shows green |
206 | Press Add | A new yellow item fades in after the currently selected item |
207 | | The other items slide down, with a slight delay for each item, giving it a flowing effect |
208 | Select the new item | |
209 | Press To Top | The item changes to light blue and moves to the top, curving out to the right of the ListView |
210 | Select an item near the top and press Remove | The selected item fades out |
211 | | The other items slide up, with a slight delay for each item, giving it a flowing effect |
212 | Press the Set B button | The Set B button shows green |
213 | Press Add | A new yellow item pops in after the currently selected item |
214 | | The other items tumble down in a disorderly manner |
215 | Select the new item | |
216 | Press To Top | The item changes from red to light blue and curves out to the right of the ListView, bouncing in at the top |
217 | Select an item near the top and press Remove | The selected item pops out |
218 | | The other items slide up, with a slight delay for each item, giving it a flowing effect |'));
221 different_transitions_for_every_operation: function() {
223 testTitle = "Different Transitions for all Operations";
224 testBinary = "viewTransitions.qml";
225 testSource: "$QTDIR/qtdeclarative/tests/system/listview";
226 testGoal = "Verify a different Transition can be applied to displacement from adding, moving and removing.";
227 testPreconditions = "None";
228 testGroups = "BAT,QtQuick 2.0";
229 testRequirements = "QTBUG-21504: Enable transitions for add/move/remove operations on views";
232 prompt(twiki('---+++ ' + testTitle + '<br><br>
233 *Goal:* ' + testGoal + '<br>
234 *Pre-Requisites:* ' + testPreconditions + '<br>
235 *Tested Binary:* ' + testBinary + '<br>
236 | *Step* | *Verification* |
237 | Run '+testBinary+' | Application has started, showing a ListView |
238 | Press the Set C button | The Set C button shows green |
239 | Press Add | A new yellow item swoops in from the side |
240 | | The other items jitter down, with a slight delay for each item |
241 | Select the new item | |
242 | Press To Top | The item changes from red to light blue and moves to the top, curving out to the right of the ListView |
243 | | The other items bounce down in a solid block |
244 | Select an item near the top and press Remove | The selected item fades out in a flashing manner |
245 | | The other items snap up, with a slight delay for each item |
246 | Press the Append button a few times | Each added item swoops in from alternating sides | '));
249 delegates_and_effects: function() {
250 testTitle = "Delegates and effects";
251 testBinary = "viewTransitions.qml";
252 testSource: "$QTDIR/qtdeclarative/tests/system/listview";
253 testGoal = "Verify a delegate in transition can show effects.";
254 testPreconditions = "None";
255 testGroups = "BAT,QtQuick 2.0";
256 testRequirements = "QTBUG-21504: Enable transitions for add/move/remove operations on views";
259 prompt(twiki('---+++ ' + testTitle + '<br><br>
260 *Goal:* ' + testGoal + '<br>
261 *Pre-Requisites:* ' + testPreconditions + '<br>
262 *Tested Binary:* ' + testBinary + '<br>
263 | *Step* | *Verification* |
264 | Run '+testBinary+' | Application has started, showing a ListView |
265 | Press the Set D button | The Set D button shows green |
266 | Select a lower item | The item is highlighted |
267 | Press To Top | The item fades to red particles, shifts to the top, and fades back to a normal delegate |
268 | | The other items shuffle down |'));
271 attached_onremove_property: function() {
272 testTitle = "Using the attached onRemove property";
273 testBinary = "onRemove.qml";
274 testSource: "$QTDIR/qtdeclarative/tests/system/listview";
275 testGoal = "Verify the onRemove attached property can be assigned.";
276 testPreconditions = "None";
277 testGroups = "BAT,QtQuick 2.0";
278 testRequirements = "QTBUG-21504: Enable transitions for add/move/remove operations on views";
281 prompt(twiki('---+++ ' + testTitle + '<br><br>
282 *Goal:* ' + testGoal + '<br>
283 *Pre-Requisites:* ' + testPreconditions + '<br>
284 *Tested Binary:* ' + testBinary + '<br>
285 | *Step* | *Verification* |
286 | Run '+testBinary+' | Application has started, showing a ListView |
287 | Press the <b>-</b> button | The selected item disappears in a shower of sparks |'));