testability-driver-qt-sut-plugin 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -106,12 +106,12 @@ module MobyBehaviour
|
|
106
106
|
|
107
107
|
rescue Exception => e
|
108
108
|
|
109
|
-
$logger.
|
109
|
+
$logger.behaviour "FAIL;Failed set settings \"#{identifiers.to_s}\", \"#{values.to_s}\".;set_settings;"
|
110
110
|
Kernel::raise e
|
111
111
|
|
112
112
|
end
|
113
113
|
|
114
|
-
$logger.
|
114
|
+
$logger.behaviour "PASS;Operation set settings executed successfully \"#{identifiers.to_s}\", \"#{values.to_s}\".;set_settings;"
|
115
115
|
|
116
116
|
nil
|
117
117
|
end
|
@@ -159,12 +159,12 @@ module MobyBehaviour
|
|
159
159
|
|
160
160
|
rescue Exception => e
|
161
161
|
|
162
|
-
$logger.
|
162
|
+
$logger.behaviour "FAIL;Failed remove settings \"#{identifiers.to_s}\", \"#{setting_keys.to_s}\".;remove_settings;"
|
163
163
|
Kernel::raise e
|
164
164
|
|
165
165
|
end
|
166
166
|
|
167
|
-
$logger.
|
167
|
+
$logger.behaviour "PASS;Operation remove settings executed successfully \"#{identifiers.to_s}\", \"#{setting_keys.to_s}\".;remove_settings;"
|
168
168
|
|
169
169
|
nil
|
170
170
|
|
@@ -213,12 +213,12 @@ module MobyBehaviour
|
|
213
213
|
|
214
214
|
rescue Exception => e
|
215
215
|
|
216
|
-
$logger.
|
216
|
+
$logger.behaviour "FAIL;Failed read settings \"#{identifiers.to_s}\", \"#{setting_keys.to_s}\".;read_settings;"
|
217
217
|
Kernel::raise e
|
218
218
|
|
219
219
|
end
|
220
220
|
|
221
|
-
$logger.
|
221
|
+
$logger.behaviour "PASS;Operation read settings executed successfully \"#{identifiers.to_s}\", \"#{setting_keys.to_s}\".;read_settings;"
|
222
222
|
|
223
223
|
hash
|
224
224
|
|
@@ -260,12 +260,12 @@ module MobyBehaviour
|
|
260
260
|
|
261
261
|
rescue Exception => e
|
262
262
|
|
263
|
-
$logger.
|
263
|
+
$logger.behaviour "FAIL;Failed read all settings \"#{identifiers.to_s}\".;read_all_settings;"
|
264
264
|
Kernel::raise e
|
265
265
|
|
266
266
|
end
|
267
267
|
|
268
|
-
$logger.
|
268
|
+
$logger.behaviour "PASS;Operation read all settings executed successfully \"#{identifiers.to_s}\".;read_all_settings;"
|
269
269
|
|
270
270
|
hash
|
271
271
|
|
@@ -18,7 +18,8 @@
|
|
18
18
|
##
|
19
19
|
############################################################################
|
20
20
|
|
21
|
-
|
21
|
+
# use tdrivers own xml api instead of nokogiri
|
22
|
+
#require 'nokogiri'
|
22
23
|
|
23
24
|
module MobyBehaviour
|
24
25
|
|
@@ -84,12 +85,12 @@ module MobyBehaviour
|
|
84
85
|
begin
|
85
86
|
# execute the application control service request
|
86
87
|
apps = execute_command( MobyCommand::Application.new( :ListApps ) )
|
87
|
-
$logger.
|
88
|
+
$logger.behaviour "PASS;Successfully listed applications.;#{ id };sut;{};list_apps;"
|
88
89
|
|
89
90
|
rescue Exception => e
|
90
91
|
|
91
|
-
$logger.
|
92
|
-
|
92
|
+
$logger.behaviour "FAIL;Failed to list applications.;#{ id };sut;{};list_apps;"
|
93
|
+
raise RuntimeError, "Unable to list applications: Exception: #{ e.message } (#{ e.class })"
|
93
94
|
|
94
95
|
end
|
95
96
|
|
@@ -97,6 +98,39 @@ module MobyBehaviour
|
|
97
98
|
|
98
99
|
end
|
99
100
|
|
101
|
+
# == description
|
102
|
+
# Returns XML list of processes running in the target.
|
103
|
+
# \n
|
104
|
+
# == arguments
|
105
|
+
#
|
106
|
+
# == returns
|
107
|
+
# String
|
108
|
+
# description: tasMessage XML
|
109
|
+
#
|
110
|
+
# == exceptions
|
111
|
+
# RuntimeError
|
112
|
+
# description: if getting applications list throws any exception it's converted to RuntimeError with descriptive message
|
113
|
+
def list_processes
|
114
|
+
|
115
|
+
apps = nil
|
116
|
+
|
117
|
+
begin
|
118
|
+
# execute the application control service request
|
119
|
+
apps = execute_command( MobyCommand::Application.new( :ListRunningProcesses ) )
|
120
|
+
$logger.behaviour "PASS;Successfully listed processes.;#{ id };sut;{};list_processes;"
|
121
|
+
|
122
|
+
rescue Exception => e
|
123
|
+
|
124
|
+
$logger.behaviour "FAIL;Failed to list processes.;#{ id };sut;{};list_processes;"
|
125
|
+
Kernel::raise RuntimeError.new( "Unable to list processes: Exception: #{ e.message } (#{ e.class })" )
|
126
|
+
|
127
|
+
end
|
128
|
+
|
129
|
+
apps
|
130
|
+
|
131
|
+
end
|
132
|
+
|
133
|
+
|
100
134
|
# == description
|
101
135
|
# Returns XML list of applications and start times for applications started by qttasserver
|
102
136
|
# \n
|
@@ -117,12 +151,12 @@ module MobyBehaviour
|
|
117
151
|
begin
|
118
152
|
# execute the application control service request
|
119
153
|
apps = execute_command( MobyCommand::Application.new( :ListStartedApps ) )
|
120
|
-
$logger.
|
154
|
+
$logger.behaviour "PASS;Successfully listed applications.;#{ id };sut;{};list_started_apps;"
|
121
155
|
|
122
156
|
rescue Exception => e
|
123
157
|
|
124
|
-
$logger.
|
125
|
-
|
158
|
+
$logger.behaviour "FAIL;Failed to list applications.;#{ id };sut;{};list_started_apps;"
|
159
|
+
raise RuntimeError, "Unable to list started applications: Exception: #{ e.message } (#{ e.class })"
|
126
160
|
|
127
161
|
end
|
128
162
|
|
@@ -143,10 +177,10 @@ module MobyBehaviour
|
|
143
177
|
begin
|
144
178
|
# execute the application control service request
|
145
179
|
apps = execute_command( MobyCommand::Application.new( :ListCrashedApps ) )
|
146
|
-
$logger.
|
180
|
+
$logger.behaviour "PASS;Successfully listed crashed applications.;#{ id };sut;{};list_crashed_apps;"
|
147
181
|
rescue Exception => e
|
148
|
-
$logger.
|
149
|
-
|
182
|
+
$logger.behaviour "FAIL;Failed to list crashed applications.;#{ id };sut;{};list_crashed_apps;"
|
183
|
+
raise RuntimeError, "Unable to list crashed applications: Exception: #{ e.message } (#{ e.class })"
|
150
184
|
end
|
151
185
|
|
152
186
|
apps
|
@@ -191,8 +225,8 @@ module MobyBehaviour
|
|
191
225
|
# description: Timeout of %s seconds reached. %s
|
192
226
|
def execute_shell_command(command, param = { :detached => "false"} )
|
193
227
|
|
194
|
-
|
195
|
-
|
228
|
+
raise ArgumentError, "The command argument must be a non empty String." unless command.kind_of?( String ) and !command.empty?
|
229
|
+
raise ArgumentError, "The parameters argumet must be a Hash." unless param.kind_of?( Hash )
|
196
230
|
|
197
231
|
if param[:detached].nil?
|
198
232
|
param[:detached] = "false"
|
@@ -207,23 +241,28 @@ module MobyBehaviour
|
|
207
241
|
#pid = execute_command( MobyCommand::Application.new( :Shell, command, nil, nil, nil, nil, nil, nil, param ) ).to_i
|
208
242
|
|
209
243
|
pid = execute_command( MobyCommand::Application.new( :Shell, { :application_name => command, :flags => param } ) ).to_i
|
210
|
-
|
244
|
+
|
211
245
|
data = ""
|
212
246
|
if pid != 0
|
213
247
|
time = Time.new + timeout
|
214
248
|
while true
|
249
|
+
|
215
250
|
obj = shell_command(pid)
|
251
|
+
|
216
252
|
sleep 1
|
217
|
-
|
253
|
+
|
254
|
+
data += obj['output'].to_s # cast to string in case of output is nil
|
255
|
+
|
218
256
|
if Time.new > time
|
219
|
-
|
220
|
-
|
221
|
-
|
257
|
+
command_params = {:kill => 'true'}
|
258
|
+
command_output = shell_command(pid, command_params)['output']
|
259
|
+
raise RuntimeError, "Timeout of #{timeout.to_s} seconds reached. #{command_output}"
|
222
260
|
elsif obj['status'] == "RUNNING"
|
223
|
-
|
261
|
+
next
|
224
262
|
else
|
225
|
-
|
263
|
+
break
|
226
264
|
end
|
265
|
+
|
227
266
|
end
|
228
267
|
end
|
229
268
|
return data
|
@@ -266,77 +305,99 @@ module MobyBehaviour
|
|
266
305
|
# ArgumentError
|
267
306
|
# description: The command argument was not a non empty String
|
268
307
|
#
|
269
|
-
def shell_command(pid, param = {} )
|
270
|
-
|
308
|
+
def shell_command( pid, param = {} )
|
309
|
+
|
310
|
+
raise ArgumentError, "pid argument should be positive integer." unless pid.to_i > 0
|
311
|
+
|
271
312
|
param[ :status ] = 'true'
|
272
313
|
|
273
|
-
|
274
|
-
|
275
|
-
|
314
|
+
xml_source = execute_command(
|
315
|
+
MobyCommand::Application.new(
|
316
|
+
:Shell,
|
317
|
+
{
|
318
|
+
:application_name => pid.to_s,
|
319
|
+
:flags => param
|
320
|
+
}
|
321
|
+
)
|
322
|
+
).to_s
|
323
|
+
|
324
|
+
if param[ :kill ].nil?
|
276
325
|
|
277
|
-
if param[:kill].nil?
|
278
|
-
xml = Nokogiri::XML(xml_source)
|
279
326
|
data = {}
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
327
|
+
|
328
|
+
object_xml_data, unused_rule = @test_object_adapter.get_objects( MobyUtil::XML.parse_string( xml_source ), { :type => 'Response' }, true )
|
329
|
+
|
330
|
+
object_xml_data.collect{ | element |
|
331
|
+
|
332
|
+
data.merge!(
|
333
|
+
|
334
|
+
@test_object_adapter.test_object_attributes( element )
|
335
|
+
|
336
|
+
)
|
337
|
+
|
338
|
+
}
|
339
|
+
|
340
|
+
data
|
341
|
+
|
342
|
+
else
|
343
|
+
|
344
|
+
# Killed processes have no relevant data.
|
287
345
|
data = {
|
288
|
-
|
289
|
-
|
346
|
+
:status => "KILLED",
|
347
|
+
:output => xml_source
|
290
348
|
}
|
349
|
+
|
291
350
|
end
|
351
|
+
|
292
352
|
end
|
293
353
|
|
294
354
|
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
raise TypeError.new( "Input parameter not of Type: Hash.\nIt is: #{ hash_uid.class }" ) unless hash_uid.kind_of?( Hash )
|
318
|
-
the_uid = "failed with uid:" + hash_uid[:UID].to_s
|
319
|
-
fullname = @sut.fixture("launch","launch_with_uid",hash_uid)
|
320
|
-
|
321
|
-
if(fullname == the_uid)
|
322
|
-
raise fullname
|
323
|
-
end
|
324
|
-
full_shortname = fullname.rpartition('\\')[-1]
|
325
|
-
shortname = full_shortname.rpartition('.')[0]
|
326
|
-
app_child = @sut.application(:name=>shortname)
|
355
|
+
# == description
|
356
|
+
# launches application in symbian device based on UID and return launched application if succesfull.
|
357
|
+
#
|
358
|
+
# == arguments
|
359
|
+
# hash_application
|
360
|
+
# Hash
|
361
|
+
# description: Hash defining required expected attributes of the application
|
362
|
+
# example: { :UID => '' }
|
363
|
+
#
|
364
|
+
# == returns
|
365
|
+
# MobyBase::Application
|
366
|
+
# description: launched application that matched the uid
|
367
|
+
# example: -
|
368
|
+
#
|
369
|
+
# == exceptions
|
370
|
+
# TypeError
|
371
|
+
# description: Wrong argument type %s for attributes (expected Hash)
|
372
|
+
#
|
373
|
+
def launch_with_uid( hash_uid = {} )
|
374
|
+
|
375
|
+
begin
|
327
376
|
|
328
|
-
|
377
|
+
raise TypeError.new( "Input parameter not of Type: Hash.\nIt is: #{ hash_uid.class }" ) unless hash_uid.kind_of?( Hash )
|
378
|
+
the_uid = "failed with uid:" + hash_uid[:UID].to_s
|
379
|
+
fullname = @sut.fixture("launch","launch_with_uid",hash_uid)
|
380
|
+
|
381
|
+
if(fullname == the_uid)
|
382
|
+
raise fullname
|
383
|
+
end
|
384
|
+
full_shortname = fullname.rpartition('\\')[-1]
|
385
|
+
shortname = full_shortname.rpartition('.')[0]
|
386
|
+
app_child = @sut.application(:name=>shortname)
|
329
387
|
|
330
|
-
|
331
|
-
Kernel::raise e
|
388
|
+
rescue Exception
|
332
389
|
|
333
|
-
|
390
|
+
$logger.behaviour "FAIL;Failed to find application.;#{id.to_s};sut;{};application;" << (hash_uid.kind_of?( Hash ) ? hash_uid.inspect : hash_uid.class.to_s)
|
334
391
|
|
335
|
-
|
392
|
+
raise
|
336
393
|
|
337
|
-
|
394
|
+
end
|
338
395
|
|
339
|
-
|
396
|
+
$logger.behaviour "PASS;Application found.;#{id.to_s};sut;{};application;" << hash_uid.inspect
|
397
|
+
|
398
|
+
app_child
|
399
|
+
|
400
|
+
end
|
340
401
|
|
341
402
|
# == description
|
342
403
|
# Returns details about the tested target. The data is platform/device specific which will make your scripts platform dependant. For devices with mobility apis the data available from them is returned and could be somewhat similar across platforms. Memory details are returned in a fixed format so they can be used and still maintain compatibility cross platforms. However it should be noted that platforms which do not support memory details will return -1 (scripts will not break but data will not be usable).
|
@@ -349,10 +410,13 @@ module MobyBehaviour
|
|
349
410
|
def system_information
|
350
411
|
|
351
412
|
# xml_source = execute_command( MobyCommand::Application.new( :SystemInfo, nil) )
|
413
|
+
# @sut.state_object( xml_source )
|
352
414
|
|
353
|
-
|
354
|
-
|
355
|
-
|
415
|
+
@sut.state_object(
|
416
|
+
execute_command(
|
417
|
+
MobyCommand::Application.new( :SystemInfo )
|
418
|
+
)
|
419
|
+
)
|
356
420
|
|
357
421
|
end
|
358
422
|
|
@@ -439,10 +503,11 @@ module MobyBehaviour
|
|
439
503
|
begin
|
440
504
|
execute_command( command )
|
441
505
|
nil
|
442
|
-
rescue Exception
|
506
|
+
rescue Exception
|
443
507
|
|
444
|
-
$logger.
|
445
|
-
|
508
|
+
$logger.behaviour "FAIL;Failed tap_screen on coords \"#{ x }:#{ y }\";"
|
509
|
+
|
510
|
+
raise
|
446
511
|
|
447
512
|
end
|
448
513
|
|
@@ -462,10 +527,10 @@ module MobyBehaviour
|
|
462
527
|
begin
|
463
528
|
# execute the application control service request
|
464
529
|
execute_command( MobyCommand::Application.new( :CloseQttas ) )
|
465
|
-
$logger.
|
530
|
+
$logger.behaviour "PASS;Successfully closed qttas.;#{ id };sut;{};close_qttas;"
|
466
531
|
rescue Exception => e
|
467
|
-
$logger.
|
468
|
-
|
532
|
+
$logger.behaviour "FAIL;Failed to close qttas.;#{ id };sut;{};close_qttas;"
|
533
|
+
raise RuntimeError, "Unable to close qttas: Exception: #{ e.message } (#{ e.class })"
|
469
534
|
end
|
470
535
|
nil
|
471
536
|
end
|
@@ -527,12 +592,12 @@ module MobyBehaviour
|
|
527
592
|
)
|
528
593
|
)
|
529
594
|
|
530
|
-
$logger.
|
595
|
+
$logger.behaviour "PASS;Successfully started process memory logging.;#{ id };sut;{};log_process_mem_start;"
|
531
596
|
|
532
597
|
rescue Exception => e
|
533
598
|
|
534
|
-
$logger.
|
535
|
-
|
599
|
+
$logger.behaviour "FAIL;Failed to start process memory logging.;#{ id };sut;{};log_process_mem_start;"
|
600
|
+
raise RuntimeError, "Unable to start process memory logging: Exception: #{ e.message } (#{ e.class })"
|
536
601
|
|
537
602
|
end
|
538
603
|
|
@@ -568,15 +633,6 @@ module MobyBehaviour
|
|
568
633
|
log = nil
|
569
634
|
begin
|
570
635
|
|
571
|
-
=begin
|
572
|
-
log = execute_command(
|
573
|
-
MobyCommand::Application.new(
|
574
|
-
:ProcessMemLoggingStop,
|
575
|
-
thread_name,
|
576
|
-
nil, nil, nil, nil, nil, nil,
|
577
|
-
{:return_data => return_data} ) )
|
578
|
-
=end
|
579
|
-
|
580
636
|
log = execute_command(
|
581
637
|
MobyCommand::Application.new(
|
582
638
|
:ProcessMemLoggingStop,
|
@@ -584,10 +640,10 @@ module MobyBehaviour
|
|
584
640
|
)
|
585
641
|
)
|
586
642
|
|
587
|
-
$logger.
|
643
|
+
$logger.behaviour "PASS;Successfully stopped process memory logging.;#{ id };sut;{};log_process_mem_stop;"
|
588
644
|
rescue Exception => e
|
589
|
-
$logger.
|
590
|
-
|
645
|
+
$logger.behaviour "FAIL;Failed to stop process memory logging.;#{ id };sut;{};log_process_mem_stop;"
|
646
|
+
raise RuntimeError, "Unable to stop process memory logging: Exception: #{ e.message } (#{ e.class })"
|
591
647
|
end
|
592
648
|
log
|
593
649
|
end
|
@@ -627,13 +683,13 @@ module MobyBehaviour
|
|
627
683
|
)
|
628
684
|
)
|
629
685
|
|
630
|
-
$logger.
|
686
|
+
$logger.behaviour "PASS;Successfully started generating CPU load.;#{ id };sut;{};cpu_load_start;"
|
631
687
|
|
632
688
|
rescue Exception => e
|
633
689
|
|
634
|
-
$logger.
|
690
|
+
$logger.behaviour "FAIL;Failed to start generating CPU load.;#{ id };sut;{};cpu_load_start;"
|
635
691
|
|
636
|
-
|
692
|
+
raise RuntimeError, "Unable to start generating CPU load: Exception: #{ e.message } (#{ e.class })"
|
637
693
|
|
638
694
|
end
|
639
695
|
|
@@ -652,10 +708,10 @@ module MobyBehaviour
|
|
652
708
|
def cpu_load_stop
|
653
709
|
begin
|
654
710
|
status = execute_command(MobyCommand::Application.new(:CpuLoadStop) )
|
655
|
-
$logger.
|
711
|
+
$logger.behaviour "PASS;Successfully started generating CPU load.;#{ id };sut;{};cpu_load_start;"
|
656
712
|
rescue Exception => e
|
657
|
-
$logger.
|
658
|
-
|
713
|
+
$logger.behaviour "FAIL;Failed to start generating CPU load.;#{ id };sut;{};cpu_load_start;"
|
714
|
+
raise RuntimeError, "Unable to start generating CPU load: Exception: #{ e.message } (#{ e.class })"
|
659
715
|
end
|
660
716
|
end
|
661
717
|
|
@@ -686,31 +742,31 @@ module MobyBehaviour
|
|
686
742
|
interval_millis = interval*1000 # to millis
|
687
743
|
|
688
744
|
# make one refresh before execution then freeze
|
689
|
-
|
690
|
-
|
745
|
+
find_object_state = self.parameter[ :use_find_object, false ]
|
746
|
+
self.parameter[ :use_find_object] = false
|
691
747
|
|
692
748
|
app.force_refresh({:id => get_application_id})
|
693
749
|
self.freeze
|
694
750
|
|
695
751
|
#disable sleep to avoid unnecessary sleeping
|
696
|
-
|
752
|
+
self.parameter[ :sleep_disabled ] = true
|
697
753
|
|
698
754
|
ret = execute_command( MobyCommand::Group.new(interval_millis.to_i, app, block ) )
|
699
755
|
|
700
|
-
|
701
|
-
|
756
|
+
self.parameter[ :sleep_disabled ] = false
|
757
|
+
self.parameter[ :use_find_object] = find_object_state
|
702
758
|
|
703
759
|
self.unfreeze
|
704
760
|
|
705
761
|
# the behaviour returns the amout of behaviours
|
706
|
-
# sleep to avoid sending messages to the app
|
762
|
+
# sleep to avoid sending messages to the app until the
|
707
763
|
# commands have been executed
|
708
764
|
sleep ( ret * interval )
|
709
765
|
|
710
|
-
$logger.
|
766
|
+
$logger.behaviour "PASS;Successfully executed grouped behaviours.;#{ id };sut;{};group_behaviours;"
|
711
767
|
rescue Exception => e
|
712
|
-
$logger.
|
713
|
-
|
768
|
+
$logger.behaviour "FAIL;Failed to execute grouped behaviours.;#{ id };sut;{};group_behaviours;"
|
769
|
+
raise RuntimeError, "Unable to execute grouped behaviours: Exception: #{ e.message } (#{ e.class })"
|
714
770
|
end
|
715
771
|
nil
|
716
772
|
end
|
@@ -743,8 +799,8 @@ module MobyBehaviour
|
|
743
799
|
|
744
800
|
# == nodoc
|
745
801
|
# {:name => '', id => '', applicationUid => ''},[ {:objectName => '' , :className => , :text =>} ,..]
|
746
|
-
def find_object( app_details = nil, objects = nil )
|
747
|
-
execute_command( MobyCommand::FindObjectCommand.new( self, app_details, objects ) )
|
802
|
+
def find_object( app_details = nil, objects = nil, checksum = nil )
|
803
|
+
execute_command( MobyCommand::FindObjectCommand.new( self, app_details, objects, checksum ) )
|
748
804
|
end
|
749
805
|
|
750
806
|
# enable hooking for performance measurement & debug logging
|