testability-driver-qt-sut-plugin 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/installer/extconf.rb +1 -1
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/action.rb +5 -5
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/application.rb +174 -236
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/attribute.rb +3 -3
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/behaviour.rb +5 -5
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/configure_behaviour.rb +7 -7
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/events.rb +7 -7
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/file_transfer.rb +1 -1
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/find.rb +3 -3
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/fixture.rb +5 -5
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/gesture.rb +73 -60
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/infologger.rb +3 -3
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/key_press.rb +6 -6
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/locale_db.rb +8 -8
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/method.rb +1 -1
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/multitouch.rb +348 -329
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/os.rb +5 -5
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/qt_api_method.rb +3 -3
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/record.rb +7 -7
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/screen_capture.rb +9 -9
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/sut.rb +79 -27
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/synchronization.rb +3 -3
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/treewidgetitemcolumn.rb +5 -5
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/type_text.rb +3 -3
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/view_item.rb +5 -5
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/webkit.rb +13 -11
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/widget.rb +70 -67
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/qt.rb +1 -1
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/configure_command.rb +1 -1
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/find_object.rb +1 -1
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/fixture.rb +2 -3
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/group.rb +1 -1
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/infologger_command.rb +1 -1
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/key_sequence.rb +3 -3
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/screen_capture.rb +1 -1
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/tap.rb +1 -1
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/widget.rb +30 -14
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/plugin.rb +8 -3
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/sut/adapter.rb +160 -29
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/sut/communication.rb +6 -8
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/sut/controller.rb +13 -2
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/util/find_object_generator.rb +50 -35
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/util/message_composer.rb +129 -95
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/util/widget.rb +4 -4
- data/xml/behaviour/qt.xml +8 -12
- metadata +53 -72
data/installer/extconf.rb
CHANGED
@@ -88,12 +88,12 @@ module MobyBehaviour
|
|
88
88
|
|
89
89
|
rescue Exception => e
|
90
90
|
|
91
|
-
|
91
|
+
$logger.log "behaviour" , "FAIL;Failed hover with refresh \"#{ refresh.to_s }\".;#{ identity };hover;"
|
92
92
|
Kernel::raise e
|
93
93
|
|
94
94
|
end
|
95
95
|
|
96
|
-
|
96
|
+
$logger.log "behaviour" , "PASS;Hover operation executed successfully with refresh \"#{ refresh.to_s }\".;#{ identity };hover;"
|
97
97
|
nil
|
98
98
|
end
|
99
99
|
|
@@ -136,17 +136,17 @@ module MobyBehaviour
|
|
136
136
|
|
137
137
|
rescue Exception => e
|
138
138
|
|
139
|
-
|
139
|
+
$logger.log "behaviour" , "FAIL;Failed trigger with refresh \"#{ refresh.to_s }\".;#{ identity };trigger;"
|
140
140
|
Kernel::raise e
|
141
141
|
|
142
142
|
end
|
143
143
|
|
144
|
-
|
144
|
+
$logger.log "behaviour" , "PASS;Trigger operation executed successfully with refresh \"#{ refresh.to_s }\".;#{ identity };trigger;"
|
145
145
|
nil
|
146
146
|
end
|
147
147
|
|
148
148
|
# enable hooking for performance measurement & debug logging
|
149
|
-
|
149
|
+
TDriver::Hooking.hook_methods( self ) if defined?( TDriver::Hooking )
|
150
150
|
|
151
151
|
|
152
152
|
end # Action
|
data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/application.rb
CHANGED
@@ -17,7 +17,8 @@
|
|
17
17
|
##
|
18
18
|
############################################################################
|
19
19
|
|
20
|
-
include TDriverVerify
|
20
|
+
# why include TDriverVerify here?
|
21
|
+
#include TDriverVerify
|
21
22
|
|
22
23
|
module MobyBehaviour
|
23
24
|
|
@@ -44,277 +45,214 @@ module MobyBehaviour
|
|
44
45
|
# == objects
|
45
46
|
# Application
|
46
47
|
#
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
48
|
+
module Application
|
49
|
+
|
50
|
+
# == description
|
51
|
+
# Start to track a popup that may appear on the screen. Tracking is done based on the class name of the
|
52
|
+
# widget implementing popup functionality. Base class name can also be used in case framework level
|
53
|
+
# popup base class is available. The idea of the detection is to track info notes that appear
|
54
|
+
# on the screen for a moment and are therefore difficult to verify manually.
|
55
|
+
#
|
52
56
|
# == arguments
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
57
|
+
# class_name
|
58
|
+
# String
|
59
|
+
# description: Name of the popup implementation class. Base class name can also be used.
|
60
|
+
# example: PopupClass
|
61
|
+
#
|
62
|
+
# wait_time
|
63
|
+
# Integer
|
64
|
+
# description: How long to wait for the popup to appear
|
65
|
+
# example: 5
|
66
|
+
#
|
67
|
+
# == returns
|
68
|
+
# NilClass
|
69
|
+
# description: -
|
70
|
+
# example: -
|
71
|
+
#
|
72
|
+
def track_popup(class_name, wait_time=1)
|
73
|
+
wait_time = wait_time*1000
|
74
|
+
fixture('popup', 'waitPopup',{:className => class_name, :interval => wait_time.to_s})
|
75
|
+
end
|
76
|
+
|
77
|
+
# == description
|
78
|
+
# Verify was the popup on the screen or not. The method uses TDriver verify internally for the verification.
|
79
|
+
# If the popup was shown then the entire application ui state is returned as a test object.
|
80
|
+
# More detailed verification can be done for the object (e.g. the content of the popup, labels etc...).
|
81
|
+
# \n
|
82
|
+
# [b]NOTE:[/b] If the popup does not close the verification will fail. Detection is based on grabbing the ui state just before the popup closes.
|
83
|
+
#
|
58
84
|
# == arguments
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
85
|
+
# class_name
|
86
|
+
# String
|
87
|
+
# description: Name of the popup implementation class. Base class name can also be used.
|
88
|
+
# example: PopupClass
|
89
|
+
#
|
90
|
+
# time_out
|
91
|
+
# Integer
|
92
|
+
# description: Time in seconds for how long to wait for the popup data.
|
93
|
+
# example: 5
|
94
|
+
#
|
95
|
+
# == returns
|
96
|
+
# TestObject
|
97
|
+
# description: An ui state test object from the time the popup was detected. Can be used the same way as other test objects.
|
98
|
+
# example: -
|
99
|
+
#
|
100
|
+
#
|
101
|
+
def verify_popup(class_name, time_out = 5)
|
102
|
+
|
103
|
+
xml_source = nil
|
104
|
+
|
105
|
+
verify(time_out){
|
106
|
+
xml_source = @sut.application.fixture('popup', 'printPopup',{:className => class_name})
|
107
|
+
}
|
108
|
+
|
109
|
+
MobyBase::StateObject.new( xml_source )
|
110
|
+
|
111
|
+
end
|
112
|
+
|
113
|
+
# == description
|
114
|
+
# Taps the given objects at the same time (multitouch).
|
115
|
+
#
|
64
116
|
# == arguments
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
# duration
|
77
|
-
# Integer
|
78
|
-
# description: How long will the drag take in millis
|
79
|
-
# example: 1000
|
80
|
-
#
|
81
|
-
# == returns
|
82
|
-
# NilClass
|
83
|
-
# description: -
|
84
|
-
# example: -
|
85
|
-
#
|
86
|
-
def drag( start_x, start_y, end_x, end_y, duration = 1000 )
|
87
|
-
|
88
|
-
@sut.execute_command( MobyCommand::Drag.new( start_x, start_y, end_x, end_y, duration ) )
|
89
|
-
|
90
|
-
end
|
91
|
-
|
92
|
-
# == description
|
93
|
-
# Kills the application process
|
94
|
-
#
|
95
|
-
# == returns
|
96
|
-
# NilClass
|
97
|
-
# description: -
|
98
|
-
# example: -
|
99
|
-
#
|
100
|
-
def kill
|
101
|
-
|
102
|
-
@sut.execute_command( MobyCommand::Application.new( :Kill, self.executable_name, self.uid, self.sut, nil ) )
|
103
|
-
|
104
|
-
end
|
105
|
-
|
106
|
-
# == description
|
107
|
-
# Start to track a popup that may appear on the screen. Tracking is done based on the class name of the
|
108
|
-
# widget implementing popup functionality. Base class name can also be used in case framework level
|
109
|
-
# popup base class is available. The idea of the detection is to track info notes that appear
|
110
|
-
# on the screen for a moment and are therefore difficult to verify manually.
|
111
|
-
#
|
112
|
-
# == arguments
|
113
|
-
# class_name
|
114
|
-
# String
|
115
|
-
# description: Name of the popup implementation class. Base class name can also be used.
|
116
|
-
# example: PopupClass
|
117
|
-
#
|
118
|
-
# wait_time
|
119
|
-
# Integer
|
120
|
-
# description: How long to wait for the popup to appear
|
121
|
-
# example: 5
|
122
|
-
#
|
123
|
-
# == returns
|
124
|
-
# NilClass
|
125
|
-
# description: -
|
126
|
-
# example: -
|
127
|
-
#
|
128
|
-
def track_popup(class_name, wait_time=1)
|
129
|
-
wait_time = wait_time*1000
|
130
|
-
fixture('popup', 'waitPopup',{:className => class_name, :interval => wait_time.to_s})
|
131
|
-
end
|
132
|
-
|
133
|
-
# == description
|
134
|
-
# Verify was the popup on the screen or not. The method uses TDriver verify internally for the verification.
|
135
|
-
# If the popup was shown then the entire application ui state is returned as a test object.
|
136
|
-
# More detailed verification can be done for the object (e.g. the content of the popup, labels etc...).
|
137
|
-
# \n
|
138
|
-
# [b]NOTE:[/b] If the popup does not close the verification will fail. Detection is based on grabbing the ui state just before the popup closes.
|
139
|
-
#
|
140
|
-
# == arguments
|
141
|
-
# class_name
|
142
|
-
# String
|
143
|
-
# description: Name of the popup implementation class. Base class name can also be used.
|
144
|
-
# example: PopupClass
|
145
|
-
#
|
146
|
-
# time_out
|
147
|
-
# Integer
|
148
|
-
# description: Time in seconds for how long to wait for the popup data.
|
149
|
-
# example: 5
|
150
|
-
#
|
151
|
-
# == returns
|
152
|
-
# TestObject
|
153
|
-
# description: An ui state test object from the time the popup was detected. Can be used the same way as other test objects.
|
154
|
-
# example: -
|
155
|
-
#
|
156
|
-
#
|
157
|
-
def verify_popup(class_name, time_out = 5)
|
158
|
-
xml_source = nil
|
159
|
-
verify(time_out) {xml_source = @sut.application.fixture('popup', 'printPopup',{:className => class_name})}
|
160
|
-
MobyBase::StateObject.new( xml_source )
|
161
|
-
end
|
162
|
-
|
163
|
-
# == description
|
164
|
-
# Bring the application to foreground.\n
|
165
|
-
# \n
|
166
|
-
# [b]NOTE:[/b] Currently this works only for Symbian OS target!
|
167
|
-
#
|
168
|
-
# == returns
|
169
|
-
# NilClass
|
170
|
-
# description: -
|
171
|
-
# example: -
|
172
|
-
#
|
173
|
-
#
|
174
|
-
def bring_to_foreground
|
175
|
-
@sut.execute_command(MobyCommand::Application.new(:BringToForeground, nil, self.uid, self.sut))
|
176
|
-
end
|
177
|
-
|
178
|
-
# == description
|
179
|
-
# Taps the given objects at the same time (multitouch).
|
180
|
-
#
|
181
|
-
# == arguments
|
182
|
-
# objects
|
183
|
-
# Array
|
184
|
-
# description: Array of objects to tap.
|
185
|
-
# example: [@app.Square( :name => 'topLeft' ), @app.Square( :name => 'topRight' )]
|
186
|
-
#
|
187
|
-
# == returns
|
188
|
-
# NilClass
|
189
|
-
# description: -
|
190
|
-
# example: -
|
191
|
-
#
|
192
|
-
# == exceptions
|
117
|
+
# objects
|
118
|
+
# Array
|
119
|
+
# description: Array of objects to tap.
|
120
|
+
# example: [@app.Square( :name => 'topLeft' ), @app.Square( :name => 'topRight' )]
|
121
|
+
#
|
122
|
+
# == returns
|
123
|
+
# NilClass
|
124
|
+
# description: -
|
125
|
+
# example: -
|
126
|
+
#
|
127
|
+
# == exceptions
|
193
128
|
# ArgumentError
|
194
129
|
# description: objects is not an array
|
195
130
|
#
|
196
|
-
|
131
|
+
def tap_objects(objects)
|
197
132
|
|
198
|
-
|
133
|
+
raise ArgumentError.new("Nothing to tap") unless objects.kind_of?(Array)
|
199
134
|
|
200
|
-
|
201
|
-
|
202
|
-
|
135
|
+
multitouch_operation{
|
136
|
+
objects.each { |o| o.tap }
|
137
|
+
}
|
203
138
|
|
204
|
-
|
139
|
+
end
|
205
140
|
|
206
|
-
|
207
|
-
|
208
|
-
|
141
|
+
# == description
|
142
|
+
# Taps down the given objects at the same time (multitouch).
|
143
|
+
#
|
209
144
|
# == arguments
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
145
|
+
# objects
|
146
|
+
# Array
|
147
|
+
# description: Array of objects to tap down.
|
148
|
+
# example: [@app.Square( :name => 'topLeft' ), @app.Square( :name => 'topRight' )]
|
149
|
+
#
|
150
|
+
# == returns
|
151
|
+
# NilClass
|
152
|
+
# description: -
|
153
|
+
# example: -
|
154
|
+
#
|
155
|
+
# == exceptions
|
221
156
|
# ArgumentError
|
222
157
|
# description: objects is not an array
|
223
158
|
#
|
224
|
-
|
159
|
+
def tap_down_objects(objects)
|
225
160
|
|
226
|
-
|
161
|
+
raise ArgumentError, 'Nothing to tap' unless objects.kind_of?( Array )
|
227
162
|
|
228
|
-
|
229
|
-
|
230
|
-
|
163
|
+
multitouch_operation{
|
164
|
+
objects.each { |o| o.tap_down }
|
165
|
+
}
|
231
166
|
|
232
|
-
|
167
|
+
end
|
233
168
|
|
234
169
|
|
235
|
-
|
236
|
-
|
237
|
-
|
170
|
+
# == description
|
171
|
+
# Taps up the given objects at the same time (multitouch).
|
172
|
+
#
|
238
173
|
# == arguments
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
174
|
+
# objects
|
175
|
+
# Array
|
176
|
+
# description: Array of objects to tap up.
|
177
|
+
# example: [@app.Square( :name => 'topLeft' ), @app.Square( :name => 'topRight' )]
|
178
|
+
#
|
179
|
+
# == returns
|
180
|
+
# NilClass
|
181
|
+
# description: -
|
182
|
+
# example: -
|
183
|
+
#
|
184
|
+
# == exceptions
|
250
185
|
# ArgumentError
|
251
186
|
# description: objects is not an array
|
252
187
|
#
|
253
|
-
|
188
|
+
def tap_up_objects(objects)
|
254
189
|
|
255
|
-
|
190
|
+
raise ArgumentError, 'Nothing to tap' unless objects.kind_of?( Array )
|
256
191
|
|
257
|
-
|
258
|
-
|
259
|
-
|
192
|
+
multitouch_operation{
|
193
|
+
objects.each { |o| o.tap_up }
|
194
|
+
}
|
260
195
|
|
261
|
-
|
196
|
+
end
|
262
197
|
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
198
|
+
# == description
|
199
|
+
# Performs the given operations at the same time (when possible).\n
|
200
|
+
# \n
|
201
|
+
# [b]NOTE:[/b] Only UI behaviours can be used here (e.g. taps, gestures).
|
202
|
+
#
|
268
203
|
# == arguments
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
204
|
+
# &block
|
205
|
+
# Proc
|
206
|
+
# description: code block containing the operations to perform.
|
207
|
+
# example: {@app.ScribbleArea.tap_object(400,50)
|
208
|
+
# @app.ScribbleArea.gesture(:Right, 1, 50)}
|
209
|
+
# == returns
|
210
|
+
# NilClass
|
211
|
+
# description: -
|
212
|
+
# example: -
|
213
|
+
#
|
214
|
+
#
|
215
|
+
def multi_touch(&block)
|
216
|
+
|
217
|
+
multitouch_operation(&block)
|
218
|
+
|
219
|
+
end
|
220
|
+
|
221
|
+
private
|
222
|
+
|
223
|
+
def multitouch_operation(&block)
|
224
|
+
|
225
|
+
#make sure the situation is ok before freeze
|
226
|
+
find_object_state = @sut.parameter[ :use_find_object, false ]
|
227
|
+
@sut.parameter[ :use_find_object] = false
|
228
|
+
self.force_refresh
|
229
|
+
|
230
|
+
@sut.freeze
|
294
231
|
|
295
|
-
|
296
|
-
|
232
|
+
#disable sleep to avoid unnecessary sleeping
|
233
|
+
@sut.parameter[ :sleep_disabled ] = true
|
297
234
|
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
235
|
+
command = MobyCommand::Group.new(0, self, block )
|
236
|
+
command.set_multitouch(true)
|
237
|
+
ret = @sut.execute_command( command )
|
238
|
+
|
239
|
+
@sut.parameter[ :sleep_disabled ] = false
|
303
240
|
|
304
|
-
|
305
|
-
|
241
|
+
#sleep the biggest stored value
|
242
|
+
sleep @sut.parameter[ :skipped_sleep_time, 0 ] if @sut.parameter[ :skipped_sleep_time, 0 ] > 0
|
306
243
|
|
307
|
-
|
308
|
-
|
244
|
+
#reset values
|
245
|
+
@sut.parameter[ :skipped_sleep_time ] = 0
|
246
|
+
@sut.parameter[ :use_find_object] = find_object_state
|
247
|
+
|
248
|
+
@sut.unfreeze
|
309
249
|
|
310
|
-
@sut.unfreeze
|
311
|
-
|
312
250
|
end
|
313
|
-
|
251
|
+
|
314
252
|
# enable hooking for performance measurement & debug logging
|
315
|
-
|
253
|
+
TDriver::Hooking.hook_methods( self ) if defined?( TDriver::Hooking )
|
316
254
|
|
317
|
-
|
255
|
+
end # Application
|
318
256
|
|
319
257
|
end # QT
|
320
258
|
|