c8c8b19672f35b65f5f81d176c7f436e872fc5d1
[profile/ivi/qtdeclarative.git] / tests / system / sys_elements.qtt
1 /****************************************************************************
2 **
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
6 **
7 ** This file is part of the test suite of the Qt Toolkit.
8 **
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** GNU Lesser General Public License Usage
11 ** This file may be used under the terms of the GNU Lesser General Public
12 ** License version 2.1 as published by the Free Software Foundation and
13 ** appearing in the file LICENSE.LGPL included in the packaging of this
14 ** file. Please review the following information to ensure the GNU Lesser
15 ** General Public License version 2.1 requirements will be met:
16 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17 **
18 ** In addition, as a special exception, Nokia gives you certain additional
19 ** rights. These rights are described in the Nokia Qt LGPL Exception
20 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
21 **
22 ** GNU General Public License Usage
23 ** Alternatively, this file may be used under the terms of the GNU General
24 ** Public License version 3.0 as published by the Free Software Foundation
25 ** and appearing in the file LICENSE.GPL included in the packaging of this
26 ** file. Please review the following information to ensure the GNU General
27 ** Public License version 3.0 requirements will be met:
28 ** http://www.gnu.org/copyleft/gpl.html.
29 **
30 ** Other Usage
31 ** Alternatively, this file may be used in accordance with the terms and
32 ** conditions contained in a signed written agreement between you and Nokia.
33 **
34 **
35 **
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41
42 //TESTED_COMPONENT=qtdeclarative
43 var adv = "Press the Advance button";
44 testcase = {
45
46     rectangle: function()
47     {
48         // Test Meta-data
49         testApplication = "Elements: Rectangle";
50         testBinary = "tests/testapplications/elements/elements";
51         testGoal = "Verify the rectangle element is shown correctly";
52         testPreconditions = "";
53         testGroups = "BAT";
54
55         // Test Steps
56         prompt(twiki('---+++ ' + testApplication + '<br><br>
57         *Goal:* ' + testGoal + '<br>
58         *Pre-Requisites:* ' + testPreconditions + '<br>
59         *Tested Binary:* ' + testBinary + '<br>
60     | Select the Rectangle list item | Verify that the Rectangle displayed in the center is small, blue, with a thin red angular border |
61     | '+adv+' | The rectangle should now be twice the size as the previous step |
62     | '+adv+' | The rectangle should now have rounded corners |
63     | '+adv+' | The rectangle color should have shifted to green |
64     | '+adv+' | The rectangle border should have increased significantly |
65     | '+adv+' | The rectangle border should have now be small, blue, with a thin red angular border |'));
66     },
67
68     image: function()
69     {
70         // Test Meta-data
71         testApplication = "Elements: Image";
72         testBinary = "tests/testapplications/elements/elements";
73         testGoal = "Verify the Image element is shown correctly";
74         testPreconditions = "";
75         testGroups = "BAT";
76
77         // Test Steps
78         prompt(twiki('---+++ ' + testApplication + '<br><br>
79         *Goal:* ' + testGoal + '<br>
80         *Pre-Requisites:* ' + testPreconditions + '<br>
81         *Tested Binary:* ' + testBinary + '<br>
82      | Select the Image list item | Verify it shows the Nokia logo, large and still slightly stretched |
83      | '+adv+' | Verify it shows the Nokia logo normally, longer horizontally |
84      | '+adv+' | Verify it shows the Nokia logo with the sides cut |
85      | '+adv+' | Verify it shows the Nokia logo repeated both horizontally and vertically |
86      | '+adv+' | Verify it shows the Nokia logo repeated vertically only |
87      | '+adv+' | Verify it shows the Nokia logo repeated horizontally only |'));
88     },
89
90     animatedimage: function()
91     {
92         // Test Meta-data
93         testApplication = "Elements: AnimatedImage";
94         testBinary = "tests/testapplications/elements/elements";
95         testGoal = "Verify the AnimatedImage element is shown correctly";
96         testPreconditions = "";
97         testGroups = "BAT";
98
99         // Test Steps
100         prompt(twiki('---+++ ' + testApplication + '<br><br>
101         *Goal:* ' + testGoal + '<br>
102         *Pre-Requisites:* ' + testPreconditions + '<br>
103         *Tested Binary:* ' + testBinary + '<br>
104      | Select the AnimatedImage list item | Verify it shows a small animated icon, but slightly stretched. |
105      | '+adv+' | Verify it shows the animated icon, large and still slightly stretched |
106      | '+adv+' | Verify it shows the animated icon normally, square |
107      | '+adv+' | Verify it shows the animated icon with the sides cut |
108      | '+adv+' | Verify it shows the animated icon repeated both horizontally and vertically |
109      | '+adv+' | Verify it shows the animated icon repeated vertically only |
110      | '+adv+' | Verify it shows the animated icon repeated horizontally only |'));
111     },
112
113     borderimage: function()
114     {
115         // Test Meta-data
116         testApplication = "Elements: BorderImage";
117         testBinary = "tests/testapplications/elements/elements";
118         testGoal = "Verify the BorderImage element is shown correctly";
119         testPreconditions = "";
120         testGroups = "BAT";
121
122         // Test Steps
123         prompt(twiki('---+++ ' + testApplication + '<br><br>
124         *Goal:* ' + testGoal + '<br>
125         *Pre-Requisites:* ' + testPreconditions + '<br>
126         *Tested Binary:* ' + testBinary + '<br>
127      | Select the BorderImage list item | Verify it shows a small framed image |
128      | '+adv+' | Verify it shows the frame, large and each side stretched |
129      | '+adv+' | Verify it shows the frame with slightly off centere sides |
130      | '+adv+' | Verify it shows the frame with uniformly repeated sides |'));
131     },
132
133     systempalette: function()
134     {
135         // Test Meta-data
136         testApplication = "Elements: SystemPalette";
137         testBinary = "tests/testapplications/elements/elements";
138         testGoal = "Verify the SystemPalette element is shown correctly";
139         testPreconditions = "";
140         testGroups = "BAT";
141
142         // Test Steps
143         prompt(twiki('---+++ ' + testApplication + '<br><br>
144         *Goal:* ' + testGoal + '<br>
145         *Pre-Requisites:* ' + testPreconditions + '<br>
146         *Tested Binary:* ' + testBinary + '<br>
147      | Select the SystemPalette list item | Verify it shows a mockup of an application |
148      | '+adv+' | Verify it shows the colors similar to the system it is running on |
149      | '+adv+' | Verify it shows the new coloring |'));
150     },
151
152     text: function()
153     {
154         // Test Meta-data
155         testApplication = "Elements: Text";
156         testBinary = "tests/testapplications/elements/elements";
157         testGoal = "Verify the Text element is shown correctly";
158         testPreconditions = "";
159         testGroups = "BAT";
160
161         // Test Steps
162         prompt(twiki('---+++ ' + testApplication + '<br><br>
163         *Goal:* ' + testGoal + '<br>
164         *Pre-Requisites:* ' + testPreconditions + '<br>
165         *Tested Binary:* ' + testBinary + '<br>
166      | Select the Text list item | Verify it shows a Hello message |
167      | '+adv+' | Verify it shows the text increased to twice the previous size, and wrapped to two lines |
168      | '+adv+' | Verify it shows the text smoothly changed color to blue over a second |
169      | '+adv+' | Verify it shows the text as blue, bolded and in italic |
170      | '+adv+' | Verify it shows the text as alternating between green and black |'));
171     },
172
173     textinput: function()
174     {
175         // Test Meta-data
176         testApplication = "Elements: TextInput";
177         testBinary = "tests/testapplications/elements/elements";
178         testGoal = "Verify the TextInput element is shown correctly";
179         testPreconditions = "";
180         testGroups = "BAT";
181
182         // Test Steps
183         prompt(twiki('---+++ ' + testApplication + '<br><br>
184         *Goal:* ' + testGoal + '<br>
185         *Pre-Requisites:* ' + testPreconditions + '<br>
186         *Tested Binary:* ' + testBinary + '<br>
187      | Select the TextInput list item | Verify it shows two fields, the green one displaying a Hello message |
188      | '+adv+' | Verify it selects the last word - TextInput - of the green field |
189      | '+adv+' | Verify it animates a copy of the selected text to the gray field |
190      | '+adv+' | Verify it shows the text as asterisks |'));
191     },
192
193     textedit: function()
194     {
195         // Test Meta-data
196         testApplication = "Elements: TextEdit";
197         testBinary = "tests/testapplications/elements/elements";
198         testGoal = "Verify the TextEdit element is shown correctly";
199         testPreconditions = "";
200         testGroups = "BAT";
201
202         // Test Steps
203         prompt(twiki('---+++ ' + testApplication + '<br><br>
204         *Goal:* ' + testGoal + '<br>
205         *Pre-Requisites:* ' + testPreconditions + '<br>
206         *Tested Binary:* ' + testBinary + '<br>
207      | Select the TextEdit list item | Verify it shows two large fields |
208      | '+adv+' | Verify it selects the last word - TextEdit - of the green field |
209      | '+adv+' | Verify it animates a copy of the selected text to the gray field |
210      | '+adv+' | Verify it shows more text, with the end disappearing past the right side of the green field |
211      | '+adv+' | Verify it shows the full text, properly wrapped within the green field |'));
212     },
213
214     fontloader: function()
215     {
216         // Test Meta-data
217         testApplication = "Elements: FontLoader";
218         testBinary = "tests/testapplications/elements/elements";
219         testGoal = "Verify the FontLoader element is shown correctly";
220         testPreconditions = "";
221         testGroups = "BAT";
222
223         // Test Steps
224         prompt(twiki('---+++ ' + testApplication + '<br><br>
225         *Goal:* ' + testGoal + '<br>
226         *Pre-Requisites:* ' + testPreconditions + '<br>
227         *Tested Binary:* ' + testBinary + '<br>
228      | Select the FontLoader list item | Verify it shows a box with a named font in the center |
229      | '+adv+' | Verify the font has changed along with the named font text |
230      | '+adv+' | Verify the font is changing every half second, for at least a few different fonts, without error |
231      | '+adv+' | Verify the font has changed to a Neon Lights font |
232      | '+adv+' | Verify the font has reverted to a named system font |'));
233     },
234
235     flipable: function() {
236         // Test Meta-data
237         testApplication = "Elements: Flipable";
238         testBinary = "tests/testapplications/elements/elements";
239         testGoal = "Verify the Flipable element is shown correctly";
240         testPreconditions = "";
241         testGroups = "BAT";
242
243         // Test Steps
244         prompt(twiki('---+++ ' + testApplication + '<br><br>
245         *Goal:* ' + testGoal + '<br>
246         *Pre-Requisites:* ' + testPreconditions + '<br>
247         *Tested Binary:* ' + testBinary + '<br>
248      | Select the Flipable list item | Verify it shows a large green rectangle |
249      | '+adv+' | Verify it slowly spins horizontally to show a red rectangle on the back |
250      | '+adv+' | Verify it again slowly spins horizontally to show a green rectangle on the front |
251      | '+adv+' | Verify it again slowly spins vertically to show a red rectangle on the back |
252      | '+adv+' | Verify it again slowly spins horizontally to show a green rectangle on the front |'));
253     },
254
255     intvalidator: function()
256     {
257         // Test Meta-data
258         testApplication = "Elements: IntValidator";
259         testBinary = "tests/testapplications/elements/elements";
260         testGoal = "Verify the IntValidator element is shown correctly";
261         testPreconditions = "";
262         testGroups = "BAT";
263
264         // Test Steps
265         prompt(twiki('---+++ ' + testApplication + '<br><br>
266         *Goal:* ' + testGoal + '<br>
267         *Pre-Requisites:* ' + testPreconditions + '<br>
268         *Tested Binary:* ' + testBinary + '<br>
269      | Select the IntValidator list item | Verify it shows a green field with the number 0. The upper and lower bounds are 30 and -50 |
270      | '+adv+' | Verify the number is now -80, and the field is now red |
271      | '+adv+' | Verify the number is now -50, and the field is now green |
272      | '+adv+' | Verify the number is now 35, and the field is now red |
273      | '+adv+' | Verify the top value has changed to 35, and the field is now green |
274      | '+adv+' | Verify the bottom has changed to 36, and the field is now red |'));
275     },
276
277     doublevalidator: function()
278     {
279         // Test Meta-data
280         testApplication = "Elements: DoubleValidator";
281         testBinary = "tests/testapplications/elements/elements";
282         testGoal = "Verify the DoubleValidator element is shown correctly";
283         testPreconditions = "";
284         testGroups = "BAT";
285
286         // Test Steps
287         prompt(twiki('---+++ ' + testApplication + '<br><br>
288         *Goal:* ' + testGoal + '<br>
289         *Pre-Requisites:* ' + testPreconditions + '<br>
290         *Tested Binary:* ' + testBinary + '<br>
291      | Select the DoubleValidator list item | Verify it shows a green field with the number 0. The upper and lower bounds are 30.06  and 30.02 |
292      | '+adv+' | Verify the number is now 30.01, and the field is now red |
293      | '+adv+' | Verify the number is now 30.02, and the field is now green |
294      | '+adv+' | Verify the number is now 30.08, and the field is now red |
295      | '+adv+' | Verify the top value has changed to 30.09, and the field is now green |
296      | '+adv+' | Verify the bottom has changed to 40.05, and the field is now red |'));
297     },
298
299     regexpvalidator: function()
300     {
301         // Test Meta-data
302         testApplication = "Elements: RegExpValidator";
303         testBinary = "tests/testapplications/elements/elements";
304         testGoal = "Verify the RegExpValidator element is shown correctly";
305         testPreconditions = "";
306         testGroups = "BAT";
307
308         // Test Steps
309         prompt(twiki('---+++ ' + testApplication + '<br><br>
310         *Goal:* ' + testGoal + '<br>
311         *Pre-Requisites:* ' + testPreconditions + '<br>
312         *Tested Binary:* ' + testBinary + '<br>
313      | Select the RegExpValidator list item | Verify it shows a green field with the text abc |
314      | '+adv+' | Verify the text is now 123, and the field is now red |
315      | '+adv+' | Verify the number is now aa, and the field is still red |
316      | '+adv+' | Verify the number is now abcd, and the field is still red |
317      | '+adv+' | Verify the regex value has changed to allow four characters, and the field is now green |'));
318     },
319
320     column: function()
321     {
322         // Test Meta-data
323         testApplication = "Elements: Column";
324         testBinary = "tests/testapplications/elements/elements";
325         testGoal = "Verify the Column element is shown correctly";
326         testPreconditions = "";
327         testGroups = "BAT";
328
329         // Test Steps
330         prompt(twiki('---+++ ' + testApplication + '<br><br>
331         *Goal:* ' + testGoal + '<br>
332         *Pre-Requisites:* ' + testPreconditions + '<br>
333         *Tested Binary:* ' + testBinary + '<br>
334      | Select the Column list item | Verify it shows three rectangles - green, red and black |
335      | '+adv+' | Verify the blue rectangle slid in to place between the red and black rectangles |'));
336     },
337
338     row: function()
339     {
340         // Test Meta-data
341         testApplication = "Elements: Row";
342         testBinary = "tests/testapplications/elements/elements";
343         testGoal = "Verify the Row element is shown correctly";
344         testPreconditions = "";
345         testGroups = "BAT";
346
347         // Test Steps
348         prompt(twiki('---+++ ' + testApplication + '<br><br>
349         *Goal:* ' + testGoal + '<br>
350         *Pre-Requisites:* ' + testPreconditions + '<br>
351         *Tested Binary:* ' + testBinary + '<br>
352      | Select the Row list item | Verify it shows three rectangles - green, red and black |
353      | '+adv+' | Verify the blue rectangle slid in to place between the red and black rectangles |'));
354     },
355
356     flow: function()
357     {
358         // Test Meta-data
359         testApplication = "Elements: Flow";
360         testBinary = "tests/testapplications/elements/elements";
361         testGoal = "Verify the Flow element is shown correctly";
362         testPreconditions = "";
363         testGroups = "BAT";
364
365         // Test Steps
366         prompt(twiki('---+++ ' + testApplication + '<br><br>
367         *Goal:* ' + testGoal + '<br>
368         *Pre-Requisites:* ' + testPreconditions + '<br>
369         *Tested Binary:* ' + testBinary + '<br>
370      | Select the Flow list item | Verify it shows three rectangles - green (1), red (2, to the right of 1) and black (4, below 1) |
371      | '+adv+' | Verify the blue rectangle appears where the black was, the black sliding to the right |
372      | '+adv+' | Verify the direction of the numbers is now in two columns |
373      | '+adv+' | Verify the direction of the numbers has now reversed, still in columns, but progressing from the right to left |'));
374     },
375
376     grid: function()
377     {
378         // Test Meta-data
379         testApplication = "Elements: Grid";
380         testBinary = "tests/testapplications/elements/elements";
381         testGoal = "Verify the Grid element is shown correctly";
382         testPreconditions = "";
383         testGroups = "BAT";
384
385         // Test Steps
386         prompt(twiki('---+++ ' + testApplication + '<br><br>
387         *Goal:* ' + testGoal + '<br>
388         *Pre-Requisites:* ' + testPreconditions + '<br>
389         *Tested Binary:* ' + testBinary + '<br>
390      | Select the Grid list item | Verify it shows four rectangles - green, a red to the right and a black below |
391      | '+adv+' | Verify the blue rectangle slid in to place previously held by the black rectangle |'));
392     },
393
394     repeater: function()
395     {
396         // Test Meta-data
397         testApplication = "Elements: Repeater";
398         testBinary = "tests/testapplications/elements/elements";
399         testGoal = "Verify the Repeater element is shown correctly";
400         testPreconditions = "";
401         testGroups = "BAT";
402
403         // Test Steps
404         prompt(twiki('---+++ ' + testApplication + '<br><br>
405         *Goal:* ' + testGoal + '<br>
406         *Pre-Requisites:* ' + testPreconditions + '<br>
407         *Tested Binary:* ' + testBinary + '<br>
408      | Select the Repeater list item | Verify it shows five blue rectangles with text and a green rectangle at the bottom |
409      | '+adv+' | Verify the third blue rectangle is now gone and the others bounced up to fill the gap |'));
410     }
411 }
412
413