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
data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/infologger.rb
CHANGED
@@ -122,7 +122,7 @@ module MobyBehaviour
|
|
122
122
|
# # perform the tests here...
|
123
123
|
#
|
124
124
|
# # stop logging and get data as state object
|
125
|
-
# log_data_object =
|
125
|
+
# log_data_object = @sut.state_object( @app.stop_cpu_log )
|
126
126
|
#
|
127
127
|
# # collect values from log_data_object to result array
|
128
128
|
# result = ( 0 .. log_data_object.logData.attribute( 'entryCount' ).to_i ).collect do | index |
|
@@ -245,7 +245,7 @@ module MobyBehaviour
|
|
245
245
|
# # perform the tests here...
|
246
246
|
#
|
247
247
|
# # stop logging and get data as state object
|
248
|
-
# log_data_object =
|
248
|
+
# log_data_object = @sut.state_object( @app.stop_mem_log )
|
249
249
|
#
|
250
250
|
# # collect values from log_data_object to result array
|
251
251
|
# result = ( 0 .. log_data_object.logData.attribute( 'entryCount' ).to_i ).collect do | index |
|
@@ -326,6 +326,38 @@ module MobyBehaviour
|
|
326
326
|
end
|
327
327
|
|
328
328
|
|
329
|
+
# == description
|
330
|
+
# Starts logging the power usage of the device
|
331
|
+
# NOTE: not supported on all platforms. Platforms not supporting this will return -1 values.
|
332
|
+
# Logging is done to a file in the given intervals (seconds). Small (<1) intervals may cause problems and should be avoided.
|
333
|
+
#
|
334
|
+
# The default behaviour is that a new log file will be created whenever the logging is started.
|
335
|
+
# If you need to save the old results use the append parameter to tell the logger to append the results to the existing file.
|
336
|
+
#
|
337
|
+
# == arguments
|
338
|
+
# params
|
339
|
+
# Hash
|
340
|
+
# description: Update interval and path for the log file. Interval value is in seconds.
|
341
|
+
# The file path given must exist on the target.
|
342
|
+
# Optional append parameter can also be given and if true the log file will not be cleared if one exists (by default a new file will always be started).
|
343
|
+
# example: {:interval => 1, :filePath => 'C:\Data', :append => true}
|
344
|
+
#
|
345
|
+
# == returns
|
346
|
+
# nil
|
347
|
+
# description: -
|
348
|
+
# example: -
|
349
|
+
# == exceptions
|
350
|
+
# ArgumentError
|
351
|
+
# description: For missing / wrong argument types
|
352
|
+
#
|
353
|
+
# == info
|
354
|
+
#
|
355
|
+
def log_pwr(params)
|
356
|
+
params[:action] = 'start'
|
357
|
+
execute_info('pwr', params)
|
358
|
+
end
|
359
|
+
|
360
|
+
|
329
361
|
# == description
|
330
362
|
# Stops the gpu memory logging and returns the results and xml data.
|
331
363
|
# Will return an error if the logging was not started.
|
@@ -380,7 +412,7 @@ module MobyBehaviour
|
|
380
412
|
# # perform the tests here...
|
381
413
|
#
|
382
414
|
# # stop logging and get data as state object
|
383
|
-
# log_data_object =
|
415
|
+
# log_data_object = @sut.state_object( @app.stop_gpu_log )
|
384
416
|
#
|
385
417
|
# # create arrays for the results
|
386
418
|
# total_memory = []
|
@@ -460,6 +492,117 @@ module MobyBehaviour
|
|
460
492
|
params[:action] = 'stop'
|
461
493
|
execute_info('gpu', params)
|
462
494
|
end
|
495
|
+
|
496
|
+
|
497
|
+
# == description
|
498
|
+
# Stops the power logging and returns the results and xml data.
|
499
|
+
# Will return an error if the logging was not started.
|
500
|
+
# The logging is done by writing the values to a log file.
|
501
|
+
# When the logging is stopped the file is read and a xml format of the data is returned. The file is removed.\n
|
502
|
+
#
|
503
|
+
# Top object is of type logData and name pwrUsage. It contains the number of entries. The entries are the child elements of logData element.
|
504
|
+
#
|
505
|
+
# [code]
|
506
|
+
# <object id="0" name="pwrUsage" type="logData" >
|
507
|
+
# <attributes>
|
508
|
+
# <attribute name="entryCount" >
|
509
|
+
# <value>8</value>
|
510
|
+
# </attribute>
|
511
|
+
# </attributes>
|
512
|
+
# <objects>
|
513
|
+
# [/code]
|
514
|
+
#
|
515
|
+
# Each logEntry contains a timeStamp (yyyyMMddhhmmsszzz), totalMem, usedMem, freeMem, processPrivateMem and processSharedMem. Process specific details may not always be available. \n
|
516
|
+
#
|
517
|
+
# [code]
|
518
|
+
# <object id="0" name="LogEntry" type="logEntry" >
|
519
|
+
# <attributes>
|
520
|
+
# <attribute name="timeStamp" >
|
521
|
+
# <value>20100108190741059</value>
|
522
|
+
# </attribute>
|
523
|
+
# <attribute name="voltage" >
|
524
|
+
# <value>4317</value>
|
525
|
+
# </attribute>
|
526
|
+
# <attribute name="current" >
|
527
|
+
# <value>-107</value>
|
528
|
+
# </attribute>
|
529
|
+
# </attributes>
|
530
|
+
# </object>
|
531
|
+
# [/code]
|
532
|
+
#
|
533
|
+
# You can use xpath to access the data directly to form any your own reports. Another way is to create a state object out of the data. This way you can access the data as you access ui state objects.
|
534
|
+
#
|
535
|
+
# [code]
|
536
|
+
# # start logging
|
537
|
+
# @app.log_pwr( :interval => 1, :filePath => 'C:\Data' )
|
538
|
+
#
|
539
|
+
# # perform the tests here...
|
540
|
+
#
|
541
|
+
# # stop logging and get data as state object
|
542
|
+
# log_data_object = @sut.state_object( @app.stop_pwr )
|
543
|
+
#
|
544
|
+
# # create arrays for the results
|
545
|
+
# voltage = []
|
546
|
+
# current = []
|
547
|
+
#
|
548
|
+
# # collect values from each log entry and store to results array
|
549
|
+
# ( 0 .. log_data_object.logData.attribute( 'entryCount' ).to_i ).each do | index |
|
550
|
+
#
|
551
|
+
# # store log entry reference to variable
|
552
|
+
# entry = log_data_object.logEntry( :id => index.to_s )
|
553
|
+
#
|
554
|
+
# # store entry values to array
|
555
|
+
# voltage << entry.attribute( 'voltage' ).to_i
|
556
|
+
# current << entry.attribute( 'current' ).to_i
|
557
|
+
#
|
558
|
+
# end
|
559
|
+
#
|
560
|
+
# g = Gruff::Line.new
|
561
|
+
# g.title = "Application cpu usage%"
|
562
|
+
# g.data( "voltage", voltage )
|
563
|
+
# g.data( "current", current )
|
564
|
+
# g.write( "info_pwr.png" )
|
565
|
+
# [/code]
|
566
|
+
#
|
567
|
+
# The example produces a graph which shows the power usage (values depend on the testing steps, device, platform etc...).
|
568
|
+
#
|
569
|
+
# == arguments
|
570
|
+
# params
|
571
|
+
# Hash
|
572
|
+
# description: Optional parameters.
|
573
|
+
# example: {:clearLog => true}
|
574
|
+
#
|
575
|
+
# == returns
|
576
|
+
# Xml
|
577
|
+
# description: data is returned in the same format as the ui state xml
|
578
|
+
# example: <object id="0" name="LogEntry" type="logEntry" >
|
579
|
+
# <attributes>
|
580
|
+
# <attribute name="timeStamp" >
|
581
|
+
# <value>20100108190741059</value>
|
582
|
+
# </attribute>
|
583
|
+
# <attribute name="voltage" >
|
584
|
+
# <value>4318</value>
|
585
|
+
# </attribute>
|
586
|
+
# <attribute name="current" >
|
587
|
+
# <value>-107</value>
|
588
|
+
# </attribute>
|
589
|
+
# </attributes>
|
590
|
+
# </object>
|
591
|
+
#
|
592
|
+
# == exceptions
|
593
|
+
# RuntimeError
|
594
|
+
# description: When no data has been colleted
|
595
|
+
# ArgumentError
|
596
|
+
# description: For missing / wrong argument types
|
597
|
+
#
|
598
|
+
# == info
|
599
|
+
#
|
600
|
+
def stop_pwr_log(params={})
|
601
|
+
params[:action] = 'stop'
|
602
|
+
execute_info('pwr', params)
|
603
|
+
end
|
604
|
+
|
605
|
+
|
463
606
|
|
464
607
|
# == description
|
465
608
|
# Load the cpu log without stopping the logging.
|
@@ -545,6 +688,35 @@ module MobyBehaviour
|
|
545
688
|
params[:action] = 'load'
|
546
689
|
execute_info('gpu', params)
|
547
690
|
end
|
691
|
+
|
692
|
+
|
693
|
+
# == description
|
694
|
+
# Load the power log without stopping the logging.
|
695
|
+
#
|
696
|
+
# == arguments
|
697
|
+
# params
|
698
|
+
# Hash
|
699
|
+
# description: Optional params hash. If :clearLog => true given will clear the log when loading by default log will not be cleared.
|
700
|
+
# example: {:clearLog = true}
|
701
|
+
#
|
702
|
+
#
|
703
|
+
# == returns
|
704
|
+
# Xml
|
705
|
+
# description: data is returned in the same format as the ui state xml
|
706
|
+
# example: -
|
707
|
+
#
|
708
|
+
# == exceptions
|
709
|
+
# RuntimeError
|
710
|
+
# description: When no data has been colleted
|
711
|
+
# ArgumentError
|
712
|
+
# description: For missing / wrong argument types
|
713
|
+
#
|
714
|
+
# == info
|
715
|
+
#
|
716
|
+
def load_pwr_log(params={})
|
717
|
+
params[:action] = 'load'
|
718
|
+
execute_info('pwr', params)
|
719
|
+
end
|
548
720
|
|
549
721
|
private
|
550
722
|
|
@@ -568,10 +740,10 @@ module MobyBehaviour
|
|
568
740
|
end
|
569
741
|
|
570
742
|
rescue Exception => e
|
571
|
-
$logger.
|
743
|
+
$logger.behaviour "FAIL;Failed infologger \"#{params.to_s}\".;#{service};"
|
572
744
|
Kernel::raise e
|
573
745
|
end
|
574
|
-
$logger.
|
746
|
+
$logger.behaviour "PASS;Operation infologger succeeded with params \"#{params.to_s}\".;#{service};"
|
575
747
|
ret
|
576
748
|
end
|
577
749
|
|
data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/key_press.rb
CHANGED
@@ -91,11 +91,11 @@ module MobyBehaviour
|
|
91
91
|
key.check_type [ Fixnum, Symbol, MobyCommand::KeySequence ], 'wrong argument type $1 for key (expected $2)'
|
92
92
|
|
93
93
|
# verify that keymap is defined for sut if symbol used.
|
94
|
-
raise ArgumentError, "Symbol #{ key.inspect } cannot be used due to no keymap defined for #{ @sut.id } in TDriver configuration file." if key.kind_of?( Symbol ) &&
|
94
|
+
raise ArgumentError, "Symbol #{ key.inspect } cannot be used due to no keymap defined for #{ @sut.id } in TDriver configuration file." if key.kind_of?( Symbol ) && sut_parameters.has_key?( :keymap ) == false
|
95
95
|
|
96
96
|
if key.kind_of?( Symbol )
|
97
97
|
|
98
|
-
scancode = TDriver::KeymapUtilities.fetch_keycode( key,
|
98
|
+
scancode = TDriver::KeymapUtilities.fetch_keycode( key, sut_parameters[ :keymap ] )
|
99
99
|
|
100
100
|
# convert hexadecimal (string) to fixnum
|
101
101
|
scancode = scancode.hex if scancode.kind_of?( String )
|
@@ -112,9 +112,9 @@ module MobyBehaviour
|
|
112
112
|
|
113
113
|
key.get_sequence.each do | key_event |
|
114
114
|
|
115
|
-
#tempcode =
|
115
|
+
#tempcode = sut_parameters[ :keymap ][ key_event[ :value ], nil ]
|
116
116
|
|
117
|
-
tempcode = TDriver::KeymapUtilities.fetch_keycode( key_event[ :value ],
|
117
|
+
tempcode = TDriver::KeymapUtilities.fetch_keycode( key_event[ :value ], sut_parameters[ :keymap ] )
|
118
118
|
|
119
119
|
tempcode = tempcode.hex if tempcode.kind_of?( String )
|
120
120
|
|
@@ -143,7 +143,7 @@ module MobyBehaviour
|
|
143
143
|
|
144
144
|
#Kernel::raise RuntimeError.new("Error occured during keypress (Response: %s)" % @response ) unless ( @response = @sut.execute_command(command) ) == "OK"
|
145
145
|
|
146
|
-
rescue Exception
|
146
|
+
rescue #Exception
|
147
147
|
|
148
148
|
$logger.behaviour "FAIL;Failed press_key with key \"#{ key }\".;#{ identity };press_key;"
|
149
149
|
|
data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/locale_db.rb
CHANGED
@@ -93,7 +93,8 @@ module MobyBehaviour
|
|
93
93
|
password = $parameters[ :localisation_server_password ]
|
94
94
|
|
95
95
|
db_connection = MobyUtil::DBConnection.new( db_type, host, database_file, username, password )
|
96
|
-
|
96
|
+
|
97
|
+
table_name = sut_parameters[ :localisation_server_database_tablename, "" ]
|
97
98
|
|
98
99
|
begin
|
99
100
|
tmp_path = $parameters[:tmp_folder] + "/locale_db_tmp"
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
1
2
|
############################################################################
|
2
3
|
##
|
3
4
|
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
@@ -49,32 +50,58 @@ module MobyBehaviour
|
|
49
50
|
# == description
|
50
51
|
# Calls an invokable method of the Qt test object.
|
51
52
|
# Slots and signals are automatically invokable, but other methods must be explicitly made invokable.
|
52
|
-
|
53
|
+
#
|
54
|
+
# Warning: Use with caution - function parameters must match exactly to the Qt slot. Otherwise
|
55
|
+
# behavior is undefined.
|
53
56
|
#
|
54
57
|
# == arguments
|
55
58
|
# method_name
|
56
59
|
# String
|
57
60
|
# description: name of method to invoke, including empty parenthesis
|
58
61
|
# example: "clear()"
|
62
|
+
# *params
|
63
|
+
# Array
|
64
|
+
# description: Parameters for the method. Currently primitive types (String,Fixnum,Float, boolean) are supported.
|
65
|
+
# Must match the parameters and types of the slot.
|
66
|
+
# example: 1.2, 'Hello'
|
59
67
|
#
|
60
68
|
# == returns
|
61
|
-
#
|
62
|
-
# description:
|
63
|
-
|
69
|
+
# String
|
70
|
+
# description: returns slot return value, empty string if void.
|
71
|
+
# example: "1"
|
64
72
|
#
|
65
73
|
# == exceptions
|
66
74
|
# RuntimeError
|
67
75
|
# description: invoking the method failed
|
68
|
-
def call_method( method_name )
|
76
|
+
def call_method( method_name, *params )
|
69
77
|
|
70
78
|
Kernel::raise ArgumentError.new( "Method name was empty" ) if method_name.empty?
|
71
79
|
command = command_params #in qt_behaviour
|
72
80
|
command.transitions_off
|
73
81
|
command.command_name( 'CallMethod' )
|
74
|
-
|
82
|
+
|
83
|
+
# Syntactically terrible..
|
84
|
+
pars = {'method_name' => method_name.to_s }
|
85
|
+
|
86
|
+
params.each_with_index{ |param,i|
|
87
|
+
case param
|
88
|
+
when String
|
89
|
+
key = "S"
|
90
|
+
when Fixnum
|
91
|
+
key = "I"
|
92
|
+
when Float
|
93
|
+
key = "D"
|
94
|
+
when TrueClass,FalseClass
|
95
|
+
key = "B"
|
96
|
+
else
|
97
|
+
Kernel::raise ArgumentError.new( "Method parameter #{i}: Only String,Fixunum,Float and Boolean types are supported" )
|
98
|
+
end
|
99
|
+
pars["method_param#{i}"] = key+param.to_s
|
100
|
+
}
|
101
|
+
command.command_params(pars)
|
75
102
|
command.service( 'objectManipulation' )
|
103
|
+
|
76
104
|
returnValue = @sut.execute_command( command )
|
77
|
-
Kernel::raise RuntimeError.new( "Calling method '%s' failed with error: %s" % [ method_name, returnValue ] ) if ( returnValue != "OK" )
|
78
105
|
end
|
79
106
|
|
80
107
|
# enable hooking for performance measurement & debug logging
|
data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/multitouch.rb
CHANGED
@@ -213,11 +213,11 @@ module MobyBehaviour
|
|
213
213
|
do_sleep(time)
|
214
214
|
|
215
215
|
rescue Exception => e
|
216
|
-
$logger.
|
216
|
+
$logger.behaviour "FAIL;Failed pinch_zoom with params \"#{ params.inspect }\".;#{ identity };pinch_zoom;"
|
217
217
|
Kernel::raise e
|
218
218
|
end
|
219
219
|
|
220
|
-
$logger.
|
220
|
+
$logger.behaviour "PASS;Operation pinch_zoom succeeded with params \"#{ params.inspect }\".;#{ identity };pinch_zoom;"
|
221
221
|
|
222
222
|
self
|
223
223
|
|
@@ -414,11 +414,11 @@ module MobyBehaviour
|
|
414
414
|
#wait untill the operation to finish
|
415
415
|
do_sleep( time )
|
416
416
|
rescue Exception => e
|
417
|
-
$logger.
|
417
|
+
$logger.behaviour "FAIL;Failed rotate with params \"#{ params.inspect }\".;#{ identity };rotate;"
|
418
418
|
Kernel::raise e
|
419
419
|
end
|
420
420
|
|
421
|
-
$logger.
|
421
|
+
$logger.behaviour "PASS;Operation rotate succeeded with params \"#{ params.inspect }\".;#{ identity };rotate;"
|
422
422
|
|
423
423
|
self
|
424
424
|
|
@@ -62,10 +62,10 @@ module MobyBehaviour
|
|
62
62
|
# @sut.execute_command(command)
|
63
63
|
# self.force_refresh
|
64
64
|
# rescue Exception => e
|
65
|
-
# $logger.
|
65
|
+
# $logger.behaviour "FAIL;Failed open_file with path \"#{path}\", dialog_name \"#{dialog_name}\", button \"#{button.to_s}\".;#{identity};open_file;"
|
66
66
|
# Kernel::raise e
|
67
67
|
# end
|
68
|
-
# $logger.
|
68
|
+
# $logger.behaviour "PASS;Operation file executed successfully with path \"#{path}\", dialog_name \"#{dialog_name}\", button \"#{button.to_s}\".;#{identity};open_file;"
|
69
69
|
# nil
|
70
70
|
# end
|
71
71
|
# Press Enter on the keyboard. Useful to accept crash warnings on windows
|
@@ -85,10 +85,10 @@ module MobyBehaviour
|
|
85
85
|
end
|
86
86
|
self.execute_command( MobyCommand::WidgetCommand.new( nil, nil, nil, 'PressEnter', params, nil, 'uiCommand') )
|
87
87
|
rescue Exception => e
|
88
|
-
$logger.
|
88
|
+
$logger.behaviour "FAIL;Failed to send an Enter keystroke request to the qttas server;press_enter;"
|
89
89
|
Kernel::raise e
|
90
90
|
end
|
91
|
-
$logger.
|
91
|
+
$logger.behaviour "PASS;Successfuly sent an Enter keystroke request to the qttas server;press_enter;"
|
92
92
|
nil
|
93
93
|
end
|
94
94
|
|
@@ -62,12 +62,12 @@ module MobyBehaviour
|
|
62
62
|
|
63
63
|
rescue Exception => e
|
64
64
|
|
65
|
-
$logger.
|
65
|
+
$logger.behaviour "FAIL;Failed start_recording.;#{ identity };start_recording;"
|
66
66
|
Kernel::raise e
|
67
67
|
|
68
68
|
end
|
69
69
|
|
70
|
-
$logger.
|
70
|
+
$logger.behaviour "PASS;Operation start_recording executed successfully.;#{ identity };start_recording;"
|
71
71
|
|
72
72
|
nil
|
73
73
|
end
|
@@ -88,12 +88,12 @@ module MobyBehaviour
|
|
88
88
|
|
89
89
|
rescue Exception => e
|
90
90
|
|
91
|
-
$logger.
|
91
|
+
$logger.behaviour "FAIL;Failed stop_recording.;#{ identity };stop_recording;"
|
92
92
|
Kernel::raise e
|
93
93
|
|
94
94
|
end
|
95
95
|
|
96
|
-
$logger.
|
96
|
+
$logger.behaviour "PASS;Operation stop_recording executed successfully.;#{ identity };stop_recording;"
|
97
97
|
|
98
98
|
nil
|
99
99
|
|
@@ -113,12 +113,12 @@ module MobyBehaviour
|
|
113
113
|
|
114
114
|
rescue Exception => e
|
115
115
|
|
116
|
-
$logger.
|
116
|
+
$logger.behaviour "FAIL;Failed print_recordings.;#{ identity };print_recordings;"
|
117
117
|
Kernel::raise e
|
118
118
|
|
119
119
|
end
|
120
120
|
|
121
|
-
$logger.
|
121
|
+
$logger.behaviour "PASS;Operation print_recordings executed successfully.;#{ identity };print_recordings;"
|
122
122
|
|
123
123
|
return ret
|
124
124
|
|
data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/screen_capture.rb
CHANGED
@@ -112,16 +112,16 @@ module MobyBehaviour
|
|
112
112
|
|
113
113
|
rescue Exception => e
|
114
114
|
|
115
|
-
#$logger.
|
115
|
+
#$logger.behaviour "FAIL;Failed capture_screen with format \"#{format}\", file_name \"#{file_name}\".;#{ identity };capture_screen;"
|
116
116
|
|
117
|
-
$logger.
|
117
|
+
$logger.behaviour "FAIL;Failed capture_screen with format \"%s\", file_name \"%s\".;%s;capture_screen;" % [ format, file_name, identity ]
|
118
118
|
|
119
119
|
Kernel::raise e
|
120
120
|
|
121
121
|
end
|
122
122
|
|
123
|
-
#$logger.
|
124
|
-
$logger.
|
123
|
+
#$logger.behaviour "PASS;Operation capture_screen executed successfully with format \"#{format}\", file_name \"#{file_name}\".;#{ identity };capture_screen;"
|
124
|
+
$logger.behaviour "PASS;Operation capture_screen executed successfully with format \"%s\", file_name \"%s\".;%s;capture_screen;" % [ format, file_name, identity ]
|
125
125
|
|
126
126
|
image_binary
|
127
127
|
|
@@ -205,15 +205,13 @@ module MobyBehaviour
|
|
205
205
|
|
206
206
|
rescue Exception => e
|
207
207
|
|
208
|
-
$logger.
|
209
|
-
"FAIL;Failed when searching for image on the screen.;#{ identity };find_on_screen;#{(image_or_path.respond_to?(:filename) ? image_or_path.filename : image_or_path.to_s)},#{tolerance.to_s}"
|
208
|
+
$logger.behaviour "FAIL;Failed when searching for image on the screen.;#{ identity };find_on_screen;#{(image_or_path.respond_to?(:filename) ? image_or_path.filename : image_or_path.to_s)},#{tolerance.to_s}"
|
210
209
|
|
211
210
|
Kernel::raise e
|
212
211
|
|
213
212
|
end
|
214
213
|
|
215
|
-
$logger.
|
216
|
-
"PASS;Image search completed successfully.;#{ identity };find_on_screen;#{(image_or_path.respond_to?(:filename) ? image_or_path.filename : image_or_path.to_s)},#{tolerance.to_s}"
|
214
|
+
$logger.behaviour "PASS;Image search completed successfully.;#{ identity };find_on_screen;#{(image_or_path.respond_to?(:filename) ? image_or_path.filename : image_or_path.to_s)},#{tolerance.to_s}"
|
217
215
|
|
218
216
|
result
|
219
217
|
|
@@ -258,16 +256,14 @@ module MobyBehaviour
|
|
258
256
|
result = !find_on_screen(image_or_path, tolerance).nil?
|
259
257
|
rescue Exception => exc
|
260
258
|
|
261
|
-
$logger.
|
262
|
-
"FAIL;Failed when searching for image on the screen.;#{ identity };screen_contains?;#{(image_or_path.respond_to?(:filename) ? image_or_path.filename : image_or_path.to_s)},#{tolerance.to_s}"
|
259
|
+
$logger.behaviour "FAIL;Failed when searching for image on the screen.;#{ identity };screen_contains?;#{(image_or_path.respond_to?(:filename) ? image_or_path.filename : image_or_path.to_s)},#{tolerance.to_s}"
|
263
260
|
|
264
261
|
Kernel::raise exc
|
265
262
|
|
266
263
|
|
267
264
|
end
|
268
265
|
|
269
|
-
$logger.
|
270
|
-
"PASS;Image search completed successfully.;#{ identity };screen_contains?;#{(image_or_path.respond_to?(:filename) ? image_or_path.filename : image_or_path.to_s)},#{tolerance.to_s}"
|
266
|
+
$logger.behaviour "PASS;Image search completed successfully.;#{ identity };screen_contains?;#{(image_or_path.respond_to?(:filename) ? image_or_path.filename : image_or_path.to_s)},#{tolerance.to_s}"
|
271
267
|
|
272
268
|
result
|
273
269
|
|