testability-driver-qt-sut-plugin 1.1.1 → 1.2.0
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/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/action.rb +7 -6
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/application.rb +190 -182
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/attribute.rb +2 -2
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/behaviour.rb +17 -17
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/configure_behaviour.rb +6 -6
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/events.rb +6 -6
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/find.rb +2 -2
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/fixture.rb +10 -14
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/fps.rb +7 -7
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/gesture.rb +387 -338
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/infologger.rb +177 -5
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/key_press.rb +5 -5
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/locale_db.rb +2 -1
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/method.rb +34 -7
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/multitouch.rb +4 -4
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/os.rb +4 -4
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/record.rb +6 -6
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/screen_capture.rb +8 -12
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/settings.rb +8 -8
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/sut.rb +171 -115
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/synchronization.rb +2 -2
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/treewidgetitemcolumn.rb +11 -7
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/type_text.rb +2 -2
- 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 -13
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/widget.rb +54 -63
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/find_object.rb +45 -28
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/version.rb +34 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/widget.rb +2 -2
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/application.rb +174 -121
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/find_object.rb +35 -26
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/version.rb +56 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/plugin.rb +64 -16
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/sut/adapter.rb +138 -40
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/sut/communication.rb +91 -83
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/util/find_object_generator.rb +222 -44
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/util/message_composer.rb +176 -10
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/util/widget.rb +2 -2
- data/xml/behaviour/qt.xml +12 -0
- metadata +7 -5
@@ -81,19 +81,20 @@ module MobyBehaviour
|
|
81
81
|
command = command_params #in qt_behaviour
|
82
82
|
command.object_type( :Action )
|
83
83
|
command.command_name( 'Hover' )
|
84
|
-
command.
|
84
|
+
command.set_object_id( @parent.id )
|
85
85
|
command.command_params( 'id' => id )
|
86
|
+
|
86
87
|
@sut.execute_command( command )
|
87
88
|
self.force_refresh({:id => get_application_id}) if refresh
|
88
89
|
|
89
90
|
rescue Exception => e
|
90
91
|
|
91
|
-
$logger.
|
92
|
+
$logger.behaviour "FAIL;Failed hover with refresh \"#{ refresh.to_s }\".;#{ identity };hover;"
|
92
93
|
Kernel::raise e
|
93
94
|
|
94
95
|
end
|
95
96
|
|
96
|
-
$logger.
|
97
|
+
$logger.behaviour "PASS;Hover operation executed successfully with refresh \"#{ refresh.to_s }\".;#{ identity };hover;"
|
97
98
|
nil
|
98
99
|
end
|
99
100
|
|
@@ -128,7 +129,7 @@ module MobyBehaviour
|
|
128
129
|
command = command_params #in qt_behaviour
|
129
130
|
command.object_type( :Action )
|
130
131
|
command.command_name( 'Trigger' )
|
131
|
-
command.
|
132
|
+
command.set_object_id( @parent.id )
|
132
133
|
command.command_params( 'id'=>id )
|
133
134
|
|
134
135
|
@sut.execute_command( command )
|
@@ -136,12 +137,12 @@ module MobyBehaviour
|
|
136
137
|
|
137
138
|
rescue Exception => e
|
138
139
|
|
139
|
-
$logger.
|
140
|
+
$logger.behaviour "FAIL;Failed trigger with refresh \"#{ refresh.to_s }\".;#{ identity };trigger;"
|
140
141
|
Kernel::raise e
|
141
142
|
|
142
143
|
end
|
143
144
|
|
144
|
-
$logger.
|
145
|
+
$logger.behaviour "PASS;Trigger operation executed successfully with refresh \"#{ refresh.to_s }\".;#{ identity };trigger;"
|
145
146
|
nil
|
146
147
|
end
|
147
148
|
|
data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/application.rb
CHANGED
@@ -45,232 +45,240 @@ module MobyBehaviour
|
|
45
45
|
# == objects
|
46
46
|
# Application
|
47
47
|
#
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
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
|
+
#
|
56
56
|
# == arguments
|
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
|
-
|
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
|
+
|
74
|
+
wait_time = wait_time * 1000
|
75
|
+
|
76
|
+
fixture( 'popup', 'waitPopup',{ :className => class_name, :interval => wait_time.to_s } )
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
# == description
|
81
|
+
# Verify was the popup on the screen or not. The method uses TDriver verify internally for the verification.
|
82
|
+
# If the popup was shown then the entire application ui state is returned as a test object.
|
83
|
+
# More detailed verification can be done for the object (e.g. the content of the popup, labels etc...).
|
84
|
+
# \n
|
85
|
+
# [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.
|
86
|
+
#
|
84
87
|
# == arguments
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
88
|
+
# class_name
|
89
|
+
# String
|
90
|
+
# description: Name of the popup implementation class. Base class name can also be used.
|
91
|
+
# example: PopupClass
|
92
|
+
#
|
93
|
+
# time_out
|
94
|
+
# Integer
|
95
|
+
# description: Time in seconds for how long to wait for the popup data.
|
96
|
+
# example: 5
|
97
|
+
#
|
98
|
+
# == returns
|
99
|
+
# TestObject
|
100
|
+
# description: An ui state test object from the time the popup was detected. Can be used the same way as other test objects.
|
101
|
+
# example: -
|
102
|
+
#
|
103
|
+
def verify_popup( class_name, time_out = 5 )
|
104
|
+
|
105
|
+
response = nil
|
106
|
+
|
107
|
+
verify( time_out ){
|
108
|
+
|
109
|
+
response = @sut.application.fixture( 'popup', 'printPopup', { :className => class_name } )
|
110
|
+
|
107
111
|
}
|
108
112
|
|
109
|
-
|
113
|
+
@sut.state_object( response )
|
110
114
|
|
111
|
-
|
115
|
+
end
|
112
116
|
|
113
|
-
|
114
|
-
|
115
|
-
|
117
|
+
# == description
|
118
|
+
# Taps the given objects at the same time (multitouch).
|
119
|
+
#
|
116
120
|
# == arguments
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
121
|
+
# objects
|
122
|
+
# Array
|
123
|
+
# description: Array of objects to tap.
|
124
|
+
# example: [@app.Square( :name => 'topLeft' ), @app.Square( :name => 'topRight' )]
|
125
|
+
#
|
126
|
+
# == returns
|
127
|
+
# NilClass
|
128
|
+
# description: -
|
129
|
+
# example: -
|
130
|
+
#
|
131
|
+
# == exceptions
|
128
132
|
# ArgumentError
|
129
133
|
# description: objects is not an array
|
130
134
|
#
|
131
|
-
|
135
|
+
def tap_objects(objects)
|
132
136
|
|
133
|
-
|
137
|
+
raise ArgumentError.new("Nothing to tap") unless objects.kind_of?(Array)
|
134
138
|
|
135
|
-
|
136
|
-
|
137
|
-
|
139
|
+
multitouch_operation{
|
140
|
+
objects.each { |o| o.tap }
|
141
|
+
}
|
138
142
|
|
139
|
-
|
143
|
+
end
|
140
144
|
|
141
|
-
|
142
|
-
|
143
|
-
|
145
|
+
# == description
|
146
|
+
# Taps down the given objects at the same time (multitouch).
|
147
|
+
#
|
144
148
|
# == arguments
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
149
|
+
# objects
|
150
|
+
# Array
|
151
|
+
# description: Array of objects to tap down.
|
152
|
+
# example: [@app.Square( :name => 'topLeft' ), @app.Square( :name => 'topRight' )]
|
153
|
+
#
|
154
|
+
# == returns
|
155
|
+
# NilClass
|
156
|
+
# description: -
|
157
|
+
# example: -
|
158
|
+
#
|
159
|
+
# == exceptions
|
156
160
|
# ArgumentError
|
157
161
|
# description: objects is not an array
|
158
162
|
#
|
159
|
-
|
163
|
+
def tap_down_objects(objects)
|
160
164
|
|
161
|
-
|
165
|
+
raise ArgumentError, 'Nothing to tap' unless objects.kind_of?( Array )
|
162
166
|
|
163
|
-
|
164
|
-
|
165
|
-
|
167
|
+
multitouch_operation{
|
168
|
+
objects.each { |o| o.tap_down }
|
169
|
+
}
|
166
170
|
|
167
|
-
|
171
|
+
end
|
168
172
|
|
169
173
|
|
170
|
-
|
171
|
-
|
172
|
-
|
174
|
+
# == description
|
175
|
+
# Taps up the given objects at the same time (multitouch).
|
176
|
+
#
|
173
177
|
# == arguments
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
178
|
+
# objects
|
179
|
+
# Array
|
180
|
+
# description: Array of objects to tap up.
|
181
|
+
# example: [@app.Square( :name => 'topLeft' ), @app.Square( :name => 'topRight' )]
|
182
|
+
#
|
183
|
+
# == returns
|
184
|
+
# NilClass
|
185
|
+
# description: -
|
186
|
+
# example: -
|
187
|
+
#
|
188
|
+
# == exceptions
|
185
189
|
# ArgumentError
|
186
190
|
# description: objects is not an array
|
187
191
|
#
|
188
|
-
|
192
|
+
def tap_up_objects(objects)
|
189
193
|
|
190
|
-
|
194
|
+
raise ArgumentError, 'Nothing to tap' unless objects.kind_of?( Array )
|
191
195
|
|
192
|
-
|
193
|
-
|
194
|
-
|
196
|
+
multitouch_operation{
|
197
|
+
objects.each { |o| o.tap_up }
|
198
|
+
}
|
195
199
|
|
196
|
-
|
200
|
+
end
|
197
201
|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
202
|
+
# == description
|
203
|
+
# Performs the given operations at the same time (when possible).\n
|
204
|
+
# \n
|
205
|
+
# [b]NOTE:[/b] Only UI behaviours can be used here (e.g. taps, gestures).
|
206
|
+
#
|
203
207
|
# == arguments
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
208
|
+
# &block
|
209
|
+
# Proc
|
210
|
+
# description: code block containing the operations to perform.
|
211
|
+
# example: {@app.ScribbleArea.tap_object(400,50)
|
212
|
+
# @app.ScribbleArea.gesture(:Right, 1, 50)}
|
213
|
+
# == returns
|
214
|
+
# NilClass
|
215
|
+
# description: -
|
216
|
+
# example: -
|
217
|
+
#
|
218
|
+
#
|
219
|
+
def multi_touch(&block)
|
220
|
+
|
221
|
+
multitouch_operation( &block )
|
222
|
+
|
223
|
+
end
|
224
|
+
|
225
|
+
# == description
|
226
|
+
# Resizes the application window so that width becomes height and vice versa.
|
227
|
+
#
|
224
228
|
# == arguments
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
229
|
+
# Symbol
|
230
|
+
# direction
|
231
|
+
# description: For future support
|
232
|
+
#
|
233
|
+
# == returns
|
234
|
+
# NilClass
|
235
|
+
# description: -
|
236
|
+
# example: -
|
237
|
+
#
|
238
|
+
def change_orientation( direction = nil )
|
239
|
+
|
240
|
+
fixture('qt','change_orientation')
|
241
|
+
|
242
|
+
end
|
243
|
+
|
244
|
+
private
|
245
|
+
|
246
|
+
def multitouch_operation( &block )
|
247
|
+
|
248
|
+
# make sure the situation is ok before freeze
|
249
|
+
find_object_state = @sut.parameter[ :use_find_object, false ]
|
250
|
+
|
251
|
+
@sut.parameter[ :use_find_object ] = false
|
252
|
+
self.force_refresh
|
253
|
+
|
254
|
+
@sut.freeze
|
249
255
|
|
250
|
-
|
251
|
-
|
256
|
+
#disable sleep to avoid unnecessary sleeping
|
257
|
+
@sut.parameter[ :sleep_disabled ] = true
|
258
|
+
|
259
|
+
command = MobyCommand::Group.new( 0, self, block )
|
260
|
+
|
261
|
+
command.set_multitouch( true )
|
252
262
|
|
253
|
-
|
254
|
-
command.set_multitouch(true)
|
255
|
-
ret = @sut.execute_command( command )
|
263
|
+
@sut.execute_command( command )
|
256
264
|
|
257
|
-
|
265
|
+
@sut.parameter[ :sleep_disabled ] = false
|
258
266
|
|
259
|
-
|
260
|
-
|
267
|
+
# sleep the biggest stored value
|
268
|
+
sleep @sut.parameter[ :skipped_sleep_time, 0 ].to_f if @sut.parameter[ :skipped_sleep_time, 0 ].to_f > 0
|
261
269
|
|
262
|
-
|
263
|
-
|
264
|
-
|
270
|
+
# reset values
|
271
|
+
@sut.parameter[ :skipped_sleep_time ] = 0
|
272
|
+
@sut.parameter[ :use_find_object] = find_object_state
|
265
273
|
|
266
|
-
|
274
|
+
@sut.unfreeze
|
267
275
|
|
268
276
|
end
|
269
|
-
|
277
|
+
|
270
278
|
# enable hooking for performance measurement & debug logging
|
271
279
|
TDriver::Hooking.hook_methods( self ) if defined?( TDriver::Hooking )
|
272
280
|
|
273
|
-
|
281
|
+
end # Application
|
274
282
|
|
275
283
|
end # QT
|
276
284
|
|