summaryrefslogtreecommitdiffstats
path: root/tests/system/sys_textinput.qtt
blob: 5533864c871ce5bca7afb7cdf95f15f49cfc7f26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the test suite of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/

//TESTED_COMPONENT=qtdeclarative

testcase = {

  select_text: function()
  {
       // Test meta data
       testTitle = "Text Selection";
       testBinary = "qmlscene tests/testapplications/text/text.qml";
       testGoal = "Verify text can be selected via various methods";
       testPreconditions = "None";
       testGroups = "BAT";

       // Test Steps
       prompt(twiki('---+++ ' + testTitle + '<br><br>
           *Goal:* ' + testGoal + '<br>
           *Pre-Requisites:* ' + testPreconditions + '<br>
           *Tested Binary:* ' + testBinary + '<br>

    | *Step* | *Verification* |
    | Execute '+testBinary+' | "The TextInput item displays an editable line of text." is displayed |
    | Select the Text: Short option | "Hello World" is shown |
    | Press the Select Word button | World is selected |
    | Press the Select All button | Hello World is selected |
    | Press the Select None button | No text is selected |
    | Select the Mouse: On option | |
    | Drag over some text | Only that text is selected. On a touchscreen only device the virtual keyboard may show |
    | Select the Mouse: Off option | |
    | Press the Select None button | No text is selected |
    | Drag over some text | No text is selected. On a touchscreen only device the virtual keyboard may show |'));
  },

  cut_copy_and_paste: function()
  {
      // Test meta data
      testTitle = "Cut, copy and paste";
      testBinary = "qmlscene tests/testapplications/text/text.qml";
      testGoal = "Verify selected text can be copied/cut to the clipboard, and returned";
      testPreconditions = "None";
      testGroups = "BAT";

      // Test Steps
      prompt(twiki('---+++ ' + testTitle + '<br><br>
          *Goal:* ' + testGoal + '<br>
          *Pre-Requisites:* ' + testPreconditions + '<br>
          *Tested Binary:* ' + testBinary + '<br>

    | *Step* | *Verification* |
    | Execute '+testBinary+' | "The TextInput item displays an editable line of text." is displayed |
    | Select the Text: Short option | "Hello World" is shown |
    | Press the Select All button | Hello World is selected |
    | Press the Copy Button | |
    | Press the Position End Button | Text is no longer selected, cursor is at the text end |
    | Press the Paste Button | "Hello WorldHello World" is shown  |
    | Press the Select Word button | World is highlighted |
    | Press the Cut button | World is removed from the text |
    | Press the Paste button | "Hello WorldHello World" is shown |'));
  },

  password_echo_mode: function()
  {
      // Test meta data
      testTitle = "Password Echo";
      testBinary = "qmlscene tests/testapplications/text/text.qml";
      testGoal = "Verify password echo modes display text correctly";
      testPreconditions = "None";
      testGroups = "BAT";

      // Test Steps
      prompt(twiki('---+++ ' + testTitle + '<br><br>
          *Goal:* ' + testGoal + '<br>
          *Pre-Requisites:* ' + testPreconditions + '<br>
          *Tested Binary:* ' + testBinary + '<br>

    | *Step* | *Verification* |
    | Execute '+testBinary+' | "The TextInput item displays an editable line of text." is displayed |
    | Select the Text: Short option | "Hello World" is shown |
    | Select the Echo: Password option | Hello World is now a string of asterisks |
    | Enter an exclamation mark | An asterisk is added to the string |
    | Select the Echo: None option  | No text is visible |
    | Enter an exclamation mark | No text is shown |
    | Select the Echo: OnEdit option | A string of asterisks is shown |
    | Enter an exclamation mark | An exclamation mark appears at the end of the asterisks, but shortly becomes an asterisk |
    | Select the Echo: Normal option | Hello World!!! is now displayed |'));
  },

  styling: function()
  {
       // Test meta data
       testTitle = "Text Styling";
       testBinary = "qmlscene tests/testapplications/text/text.qml";
       testGoal = "Verify text can be displayed using generic styling";
       testPreconditions = "None";
       testGroups = "BAT";

       // Test Steps
       prompt(twiki('---+++ ' + testTitle + '<br><br>
           *Goal:* ' + testGoal + '<br>
           *Pre-Requisites:* ' + testPreconditions + '<br>
           *Tested Binary:* ' + testBinary + '<br>

    | *Step* | *Verification* |
    | Execute '+testBinary+' | "The TextInput item displays an editable line of text." is displayed |
    | Select the Text: Short option | "Hello World" is shown |
    | Select the Bold: On option | Hello World is now in bold |
    | Press the Italics: On option | Hello World is now in italics |
    | Press the Strikeout: On option | Hello World now has a line passing through it |
    | Press the Underline: On option | Hello World is now underlined | '));
  },

  cursor_behavior: function()
  {
       // Test meta data
       testTitle = "Cursor Behavior";
       testBinary = "qmlscene tests/testapplications/text/text.qml";
       testGoal = "Verify the text cursor displays correctly";
       testPreconditions = "None";
       testGroups = "BAT";

       // Test Steps
       prompt(twiki('---+++ ' + testTitle + '<br><br>
           *Goal:* ' + testGoal + '<br>
           *Pre-Requisites:* ' + testPreconditions + '<br>
           *Tested Binary:* ' + testBinary + '<br>

    | *Step* | *Verification* |
    | Execute '+testBinary+' | "The TextInput item displays an editable line of text." is displayed |
    | Enter enough text into the field such that it passes beyond the far right | The text scrolls to the left when the edge is reached |
    | Select the Autoscroll: Off button | The far left edge shows the first character of the text |
    | Select the Cursor: Off option | The cursor disappears |
    | Select the Cursor: On option | The cursor appears | '));
  },

  capitalization: function()
  {
      // Test meta data
      testTitle = "Capitalization";
      testBinary = "qmlscene tests/testapplications/text/text.qml";
      testGoal = "Verify character capitalization behaves correctly";
      testPreconditions = "None";
      testGroups = "BAT";

      // Test Steps
      prompt(twiki('---+++ ' + testTitle + '<br><br>
          *Goal:* ' + testGoal + '<br>
          *Pre-Requisites:* ' + testPreconditions + '<br>
          *Tested Binary:* ' + testBinary + '<br>

    | *Step* | *Verification* |
    | Execute '+testBinary+' | "The TextInput item displays an editable line of text." is displayed |
    | Select the Cap10n: Upper option | The text is converted to all upper case |
    | Select the Cap10n: Lower option | The text is converted to all lower case |
    | Select the Cap10n: SmallCaps option | The text is converted to all small sized upper case characters |
    | Select the Cap10n: Capitals option | The text is shown with each first character of every word capitalized | '));
  }
}