testability-driver-qt-sut-plugin 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/env.rb +26 -0
  2. data/installer/extconf.rb +62 -0
  3. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin.rb +23 -0
  4. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/action.rb +156 -0
  5. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/application.rb +318 -0
  6. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/attribute.rb +227 -0
  7. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/behaviour.rb +140 -0
  8. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/configure_behaviour.rb +317 -0
  9. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/events.rb +165 -0
  10. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/file_transfer.rb +333 -0
  11. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/find.rb +80 -0
  12. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/fixture.rb +178 -0
  13. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/gesture.rb +906 -0
  14. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/infologger.rb +604 -0
  15. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/key_press.rb +152 -0
  16. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/locale_db.rb +151 -0
  17. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/method.rb +85 -0
  18. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/multitouch.rb +455 -0
  19. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/os.rb +100 -0
  20. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/qt_api_method.rb +148 -0
  21. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/record.rb +124 -0
  22. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/screen_capture.rb +283 -0
  23. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/sut.rb +492 -0
  24. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/synchronization.rb +113 -0
  25. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/treewidgetitemcolumn.rb +93 -0
  26. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/type_text.rb +97 -0
  27. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/view_item.rb +97 -0
  28. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/webkit.rb +230 -0
  29. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/widget.rb +663 -0
  30. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/action.rb +30 -0
  31. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/configure_command.rb +38 -0
  32. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/drag.rb +44 -0
  33. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/find_object.rb +50 -0
  34. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/fixture.rb +45 -0
  35. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/group.rb +48 -0
  36. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/infologger_command.rb +38 -0
  37. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/qt.rb +170 -0
  38. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/tap.rb +54 -0
  39. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/widget.rb +226 -0
  40. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/application.rb +264 -0
  41. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/configure_command.rb +60 -0
  42. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/find_object.rb +114 -0
  43. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/fixture.rb +67 -0
  44. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/group.rb +52 -0
  45. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/infologger_command.rb +62 -0
  46. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/key_sequence.rb +99 -0
  47. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/screen_capture.rb +54 -0
  48. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/tap.rb +51 -0
  49. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/widget.rb +72 -0
  50. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/plugin.rb +119 -0
  51. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/sut/adapter.rb +225 -0
  52. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/sut/communication.rb +154 -0
  53. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/sut/controller.rb +58 -0
  54. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/util/fixture_parameter.rb +77 -0
  55. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/util/widget.rb +82 -0
  56. data/lib/testability-driver-qt-sut-plugin.rb +24 -0
  57. data/xml/behaviour/qt.xml +717 -0
  58. data/xml/defaults/sut_qt.xml +9 -0
  59. data/xml/keymap/qt.xml +321 -0
  60. data/xml/template/qt.xml +124 -0
  61. metadata +141 -0
@@ -0,0 +1,154 @@
1
+ ############################################################################
2
+ ##
3
+ ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4
+ ## All rights reserved.
5
+ ## Contact: Nokia Corporation (testabilitydriver@nokia.com)
6
+ ##
7
+ ## This file is part of TDriver.
8
+ ##
9
+ ## If you have questions regarding the use of this file, please contact
10
+ ## Nokia at testabilitydriver@nokia.com .
11
+ ##
12
+ ## This library is free software; you can redistribute it and/or
13
+ ## modify it under the terms of the GNU Lesser General Public
14
+ ## License version 2.1 as published by the Free Software Foundation
15
+ ## and appearing in the file LICENSE.LGPL included in the packaging
16
+ ## of this file.
17
+ ##
18
+ ############################################################################
19
+
20
+ require 'zlib'
21
+
22
+ module MobyController
23
+
24
+ module QT
25
+
26
+ module Comms
27
+
28
+ # Command types
29
+ ERROR_MSG = 0
30
+ VALID_MSG = 1
31
+ OK_MESSAGE = "OK"
32
+
33
+ class Inflator
34
+
35
+ def self.inflate( response )
36
+ # strip 4 extra bytes written by qt compression, return empty string if no raw data found, otherwise inflate it
37
+ ( raw_data = response[ 4 .. -1 ] ).empty? ? "" : Zlib::Inflate.inflate( raw_data )
38
+ end
39
+
40
+ # enable hooking for performance measurement & debug logging
41
+ MobyUtil::Hooking.instance.hook_methods( self ) if defined?( MobyUtil::Hooking )
42
+
43
+ end
44
+
45
+ # deprecated: see send_service_request#adapter.rb
46
+ # Wrapper for protocol message.
47
+ class QTResponse
48
+
49
+ attr_accessor :msg_body, :flag, :crc, :message_id
50
+
51
+ # deprecated: see send_service_request#adapter.rb
52
+ # Initialize QT Response.
53
+ # == params
54
+ # command_flag Indicator flad for message type (error or ok)
55
+ # message_code 0 or an error code
56
+ # msg_body Body of the message. For command a simple "OK" message for ui state the xml document as string
57
+ # == returns
58
+ def initialize( command_flag, msg_body, crc, message_id )
59
+
60
+
61
+ @flag, @msg_body, @crc, @message_id = command_flag, msg_body, crc, message_id
62
+
63
+ end
64
+
65
+ # deprecated: see send_service_request#adapter.rb
66
+ def validate_message( msg_id )
67
+
68
+ #check that response matches the request
69
+ if @message_id != msg_id
70
+
71
+ MobyUtil::Logger.instance.log "fatal" , "Response to request did not match: \"#{@message_id}\"!=\"#{msg_id.to_s}\""
72
+ MobyUtil::Logger.instance.log "fatal" , @msg_body
73
+
74
+ Kernel::raise RuntimeError.new("Response to request did not match: \"#{@message_id}\"!=\"#{msg_id.to_s}\"")
75
+
76
+ end
77
+
78
+ #raise error if error flag
79
+ Kernel::raise RuntimeError.new( @msg_body ) if @flag == Comms::ERROR_MSG
80
+
81
+ end
82
+
83
+ # enable hooking for performance measurement & debug logging
84
+ MobyUtil::Hooking.instance.hook_methods( self ) if defined?( MobyUtil::Hooking )
85
+
86
+ end #class
87
+
88
+ # Message generator for qt tas messages
89
+ class MessageGenerator
90
+
91
+ def self.generate( message_data, message_flag = VALID_MSG )
92
+
93
+ MobyController::QT::Comms::QtMessage.new( message_flag, message_data )
94
+
95
+ end
96
+
97
+ # enable hooking for performance measurement & debug logging
98
+ MobyUtil::Hooking.instance.hook_methods( self ) if defined?( MobyUtil::Hooking )
99
+
100
+ end
101
+
102
+ class QtMessage
103
+
104
+ attr_reader :flag, :data, :crc, :compression, :size
105
+ attr_accessor :message_id
106
+
107
+ def initialize( message_flag, message_data )
108
+ # message flag
109
+ @flag = message_flag
110
+
111
+ # no compression by default
112
+ @compression = 1
113
+
114
+ # compress message body if size is greater than 1000 bytes
115
+ deflate if ( @size = ( @data = message_data ).size ) > 1000
116
+
117
+ # calculate outgoing message crc; sent in message header to receiver for data validation
118
+ @crc = CRC::Crc16.crc16_ibm( @data, 0xffff )
119
+ end
120
+
121
+ def make_binary_message( message_id )
122
+
123
+ [ @flag, @size, @crc, @compression, message_id, @data ].pack( 'CISCIa*' )
124
+
125
+ end
126
+
127
+ def compression
128
+ @compression
129
+ end
130
+
131
+ def deflate
132
+ @compression = 2
133
+ #qUncompress required the data length at the beginning so append it
134
+ #the bytes need to be arranged in the below method (see QByteArray::qUncompress)
135
+ @data = [
136
+ (@data.size & 0xff000000) >> 24, (@data.size & 0x00ff0000) >> 16,
137
+ (@data.size & 0x0000ff00) >> 8, (@data.size & 0x000000ff),
138
+ Zlib::Deflate.deflate( @data, 9)
139
+ ].pack('C4a*')
140
+
141
+ # update data size
142
+ @size = @data.size
143
+
144
+ end
145
+
146
+ # enable hooking for performance measurement & debug logging
147
+ MobyUtil::Hooking.instance.hook_methods( self ) if defined?( MobyUtil::Hooking )
148
+
149
+ end # class
150
+
151
+ end # module Comms
152
+
153
+ end
154
+ end
@@ -0,0 +1,58 @@
1
+ ############################################################################
2
+ ##
3
+ ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4
+ ## All rights reserved.
5
+ ## Contact: Nokia Corporation (testabilitydriver@nokia.com)
6
+ ##
7
+ ## This file is part of TDriver.
8
+ ##
9
+ ## If you have questions regarding the use of this file, please contact
10
+ ## Nokia at testabilitydriver@nokia.com .
11
+ ##
12
+ ## This library is free software; you can redistribute it and/or
13
+ ## modify it under the terms of the GNU Lesser General Public
14
+ ## License version 2.1 as published by the Free Software Foundation
15
+ ## and appearing in the file LICENSE.LGPL included in the packaging
16
+ ## of this file.
17
+ ##
18
+ ############################################################################
19
+
20
+ module MobyController
21
+
22
+ module QT
23
+
24
+ module SutController
25
+
26
+ def disconnect
27
+
28
+ @sut_adapter.disconnect
29
+
30
+ end
31
+
32
+ def connect( id )
33
+
34
+ @sut_adapter.connect( id )
35
+
36
+ end
37
+
38
+ def received_bytes
39
+
40
+ @sut_adapter.socket_received_bytes
41
+
42
+ end
43
+
44
+ def sent_bytes
45
+
46
+ @sut_adapter.socket_sent_bytes
47
+
48
+ end
49
+
50
+ # enable hooking for performance measurement & debug logging
51
+ MobyUtil::Hooking.instance.hook_methods( self ) if defined?( MobyUtil::Hooking )
52
+
53
+
54
+ end # SutController
55
+
56
+ end # QT
57
+
58
+ end # MobyController
@@ -0,0 +1,77 @@
1
+ ############################################################################
2
+ ##
3
+ ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4
+ ## All rights reserved.
5
+ ## Contact: Nokia Corporation (testabilitydriver@nokia.com)
6
+ ##
7
+ ## This file is part of TDriver.
8
+ ##
9
+ ## If you have questions regarding the use of this file, please contact
10
+ ## Nokia at testabilitydriver@nokia.com .
11
+ ##
12
+ ## This library is free software; you can redistribute it and/or
13
+ ## modify it under the terms of the GNU Lesser General Public
14
+ ## License version 2.1 as published by the Free Software Foundation
15
+ ## and appearing in the file LICENSE.LGPL included in the packaging
16
+ ## of this file.
17
+ ##
18
+ ############################################################################
19
+
20
+
21
+
22
+ module MobyUtil
23
+
24
+ class FixtureParameter
25
+
26
+ attr_accessor :parameters
27
+
28
+ def initialize( *args )
29
+ @parameters = []
30
+ # accept array as multiple arguments, hash for one argument
31
+ args = [ [ args.first ] ] if args.size == 1 && args.first.kind_of?( Hash )
32
+ args.each{ | argument | add_parameter( argument.first ) }
33
+ end
34
+
35
+ def add_parameter( hash )
36
+
37
+ Kernel::raise ArgumentError.new("Argument :value and :type must be defined. Actual hash: #{ hash.inspect }") unless hash.has_key?( :type ) and hash.has_key?( :value )
38
+
39
+ @parameters.push( hash )
40
+
41
+ end
42
+
43
+ def remove_parameter( index_or_range )
44
+
45
+ # value can be range or index, or array of ranges or indexes
46
+ @parameters.slice!( index_or_range )
47
+
48
+ end
49
+
50
+ def list_parameters
51
+
52
+ return @parameters.inspect
53
+
54
+ end
55
+
56
+ def to_s
57
+
58
+ Nokogiri::XML::Builder.new{
59
+
60
+ fixture_parameters{
61
+
62
+ parameters.each_index{ | index |
63
+
64
+ parameter( parameters[index].merge( :id => index) )
65
+
66
+ }
67
+
68
+ }
69
+
70
+ }.to_xml
71
+
72
+ end
73
+
74
+ end
75
+
76
+ end
77
+
@@ -0,0 +1,82 @@
1
+ ############################################################################
2
+ ##
3
+ ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4
+ ## All rights reserved.
5
+ ## Contact: Nokia Corporation (testabilitydriver@nokia.com)
6
+ ##
7
+ ## This file is part of TDriver.
8
+ ##
9
+ ## If you have questions regarding the use of this file, please contact
10
+ ## Nokia at testabilitydriver@nokia.com.
11
+ ##
12
+ ## This library is free software; you can redistribute it and/or
13
+ ## modify it under the terms of the GNU Lesser General Public
14
+ ## License version 2.1 as published by the Free Software Foundation
15
+ ## and appearing in the file LICENSE.LGPL included in the packaging
16
+ ## of this file.
17
+ ##
18
+ ############################################################################
19
+
20
+
21
+ module MobyUtil
22
+
23
+ class Widget
24
+
25
+ # Common method, tap up or down
26
+ def self.tap_updown_object(tap_params, y, button, identity, command_name)
27
+ begin
28
+ behavior_name = command_name == 'MousePress' ? 'tap_down_object' : 'tap_up_object'
29
+ if tap_params.kind_of? Hash
30
+ x = tap_params[:x].nil? ? -1 : tap_params[:x]
31
+ y = tap_params[:y].nil? ? -1 : tap_params[:y]
32
+ button = tap_params[:button].nil? ? (:Left) : tap_params[:button]
33
+ use_tap_screen = tap_params[:use_tap_screen] == true ? 'true' :
34
+ MobyUtil::Parameter[ @sut.id][ :use_tap_screen, 'false']
35
+ else
36
+ x = tap_params
37
+ use_tap_screen = MobyUtil::Parameter[ @sut.id][ :use_tap_screen, 'false']
38
+ end
39
+
40
+
41
+
42
+
43
+ raise ArgumentError.new( "Coordinate x:#{x} x_abs:#{x} outside object." ) unless (x <= attribute('width').to_i and x >= 0)
44
+ raise ArgumentError.new( "Coordinate y:#{y} y_abs:#{y} outside object." ) unless (y <= attribute('height').to_i and y >= 0)
45
+
46
+ command = command_params #in qt_behaviour
47
+ command.command_name(command_name)
48
+
49
+ x_tap = attribute('x_absolute').to_i + x.to_i
50
+ y_tap = attribute('y_absolute').to_i + y.to_i
51
+
52
+ mouse_move = @sut.parameter[:in_tap_move_pointer]
53
+ mouse_move = 'false' unless mouse_move
54
+
55
+ params = { 'x'=>x_tap.to_s, 'y' => y_tap.to_s, 'button' => @@_buttons_map[button], 'mouseMove'=>mouse_move }
56
+ # use coordinates
57
+ params['useCoordinates'] = 'true'
58
+ params['useTapScreen'] = use_tap_screen
59
+ command.command_params(params)
60
+
61
+ @sut.execute_command(command)
62
+
63
+ rescue Exception => e
64
+
65
+ MobyUtil::Logger.instance.log "behaviour" , "FAIL;Failed #{behavior_name} with x \"#{x}\", y \"#{y}\", button \"#{button.to_s}\".;#{identity};#{behavior_name};"
66
+ Kernel::raise e
67
+
68
+ end
69
+
70
+ MobyUtil::Logger.instance.log "behaviour" , "PASS;Operation #{behavior_name} executed successfully with x \"#{x}\", y \"#{y}\", button \"#{button.to_s}\".;#{identity};#{behavior_name};"
71
+
72
+ nil
73
+
74
+
75
+
76
+ end
77
+
78
+
79
+ end
80
+
81
+ end
82
+
@@ -0,0 +1,24 @@
1
+ ############################################################################
2
+ ##
3
+ ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4
+ ## All rights reserved.
5
+ ## Contact: Nokia Corporation (testabilitydriver@nokia.com)
6
+ ##
7
+ ## This file is part of TDriver.
8
+ ##
9
+ ## If you have questions regarding the use of this file, please contact
10
+ ## Nokia at testabilitydriver@nokia.com .
11
+ ##
12
+ ## This library is free software; you can redistribute it and/or
13
+ ## modify it under the terms of the GNU Lesser General Public
14
+ ## License version 2.1 as published by the Free Software Foundation
15
+ ## and appearing in the file LICENSE.LGPL included in the packaging
16
+ ## of this file.
17
+ ##
18
+ ############################################################################
19
+
20
+
21
+
22
+ # this is required due to debianized gems doesn't support gemspec require path
23
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'testability-driver-plugins/testability-driver-qt-sut-plugin.rb' ) )
24
+
@@ -0,0 +1,717 @@
1
+
2
+
3
+ <behaviours plugin="testability-driver-qt-sut-plugin">
4
+
5
+ <behaviour name="QtSut" object_type="sut" sut_type="QT" input_type="*" version="*">
6
+
7
+ <module name="MobyBehaviour::QT::SUT" />
8
+
9
+ <methods>
10
+ <method name="kill_started_processes">
11
+ <description>Kills all of the application processed started through the server.</description>
12
+ <example>kill_started_processes</example>
13
+ </method>
14
+ <method name="list_apps">
15
+ <description>Lists all applications known to server running on SUT.</description>
16
+ <example>list_apps</example>
17
+ </method>
18
+ <method name="list_crashed_apps">
19
+ <description>Returns list of crashed applications running on SUT known to qttasserver.</description>
20
+ <example>list_crashed_apps</example>
21
+ </method>
22
+ <method name="execute_shell_command">
23
+ <description>Executes the given command as a new process.</description>
24
+ <example>execute_shell_command</example>
25
+ </method>
26
+
27
+ <method name="shell_command">
28
+ <description>Get the status of the command left as background process</description>
29
+ <example></example>
30
+ </method>
31
+
32
+ <method name="tap_screen">
33
+ <description>Tap screen on given coordinates.</description>
34
+ <example>tap_screen(200,20)</example>
35
+ </method>
36
+ <method name="close_qttas">
37
+ <description>Requests the qttasserver to shutdown.</description>
38
+ <example>close_qttas</example>
39
+ </method>
40
+ <method name="system_information">
41
+ <description>Returns the system information as a state object.</description>
42
+ <example>system_information</example>
43
+ </method>
44
+ <method name="agent_mem_usage">
45
+ <description>Returns the memory used by qttasserver.</description>
46
+ <example>agent_mem_usage</example>
47
+ </method>
48
+ <method name="system_total_mem">
49
+ <description>Returns the total memory of target device.</description>
50
+ <example>system_total_mem</example>
51
+ </method>
52
+ <method name="system_available_mem">
53
+ <description>Returns the available memory of target device.</description>
54
+ <example>system_available_mem</example>
55
+ </method>
56
+ <method name="log_process_mem_start">
57
+ <description>Start process memory logging.</description>
58
+ <example>log_process_mem_start('testapp', 'c:\\data\\mem.log', 'absolute', 5)</example>
59
+ </method>
60
+ <method name="log_process_mem_stop">
61
+ <description>Stop process memory logging.</description>
62
+ <example>log_process_mem_stop('testapp', 'true')</example>
63
+ </method>
64
+ <method name="cpu_load_start">
65
+ <description>Start generating CPU load.</description>
66
+ <example>cpu_load_start(25)</example>
67
+ </method>
68
+ <method name="cpu_load_stop">
69
+ <description>Stop generating CPU load.</description>
70
+ <example>cpu_load_stop</example>
71
+ </method>
72
+ <method name="group_behaviours">
73
+ <description>Group behaviours into a single message.</description>
74
+ <example>group_behaviours(1, app){app.Node.tap;app.Node1.tap}</example>
75
+ </method>
76
+ <method name="set_event_type">
77
+ <description>Set the event type used to generate events to the device.</description>
78
+ <example>set_event_type(:Mouse)</example>
79
+ </method>
80
+ <method name="find_object">
81
+ <description>.</description>
82
+ <example>find_object(objects)</example>
83
+ </method>
84
+
85
+ </methods>
86
+
87
+ </behaviour>
88
+
89
+ <behaviour name="QtApplication" object_type="application" sut_type="QT" input_type="*" version="*">
90
+
91
+ <module name="MobyBehaviour::QT::Application" />
92
+
93
+ <methods>
94
+ <method name="drag">
95
+ <description>Drag on screen (start X, start Y, end X, end Y).</description>
96
+ <example>drag(200, 100, 400, 200)</example>
97
+ </method>
98
+
99
+ <method name="kill">
100
+ <description>Kills the application process.</description>
101
+ <example>kill</example>
102
+ </method>
103
+
104
+ <method name="track_popup">
105
+ <description>Start tracking a popup based on class name.</description>
106
+ <example>track_popup('PopupClass')</example>
107
+ </method>
108
+
109
+ <method name="verify_popup">
110
+ <description>Verify that a popup was shown.</description>
111
+ <example>verify_popup('PopupClass')</example>
112
+ </method>
113
+
114
+ <method name="bring_to_foreground">
115
+ <description>Bring an application to foreground.</description>
116
+ <example>bring_to_foreground</example>
117
+ </method>
118
+
119
+ <method name="tap_objects">
120
+ <description>Tap many objects at the same time</description>
121
+ <example>tap_objects([object])</example>
122
+ </method>
123
+
124
+ <method name="tap_down_objects">
125
+ <description>Tap down many objects at the same time</description>
126
+ <example>tap_down_objects([object])</example>
127
+ </method>
128
+
129
+ <method name="tap_up_objects">
130
+ <description>Tap up many objects at the same time</description>
131
+ <example>tap_up_objects([object])</example>
132
+ </method>
133
+
134
+
135
+ </methods>
136
+
137
+ </behaviour>
138
+
139
+ <behaviour name="QtEvents" object_type="*;application" sut_type="QT" input_type="*" version="*">
140
+
141
+ <module name="MobyBehaviour::QT::Events" />
142
+
143
+ <methods>
144
+ <method name="enable_events">
145
+ <description>Enable event listening. You can specify which events you want to listen by including the names of those events separated by comma or integers if using user events. Use ALL if you want to listen for all events but be aware that there will be a lot of events.</description>
146
+ <example>enable_events('TimerEvent,MouseButtonPress,45677,67889')</example>
147
+ </method>
148
+ <method name="disable_events">
149
+ <description>Disable event listening.</description>
150
+ <example>disable_events</example>
151
+ </method>
152
+ <method name="get_events">
153
+ <description>Get a list of events as xml that have occurred since events were enabled.</description>
154
+ <example>get_events</example>
155
+ </method>
156
+ </methods>
157
+
158
+ </behaviour>
159
+
160
+
161
+ <behaviour name="QtRecord" object_type="application" sut_type="QT" input_type="*" version="*">
162
+
163
+ <module name="MobyBehaviour::QT::Record" />
164
+
165
+ <methods>
166
+ <method name="start_recording">
167
+ <description>Start recording events.</description>
168
+ <example>start_recording</example>
169
+ </method>
170
+ <method name="stop_recording">
171
+ <description>Stop recording events.</description>
172
+ <example>stop_recording</example>
173
+ </method>
174
+ <method name="print_recordings">
175
+ <description>Get the recorded events.</description>
176
+ <example>print_recordings</example>
177
+ </method>
178
+ </methods>
179
+
180
+ </behaviour>
181
+
182
+
183
+ <behaviour name="QtOs" object_type="sut" sut_type="QT" input_type="*" version="*">
184
+
185
+ <module name="MobyBehaviour::QT::Os" />
186
+
187
+ <methods>
188
+ <!--method name="open_file">
189
+ <description>Open a file using an already active open file dialog.</description>
190
+ <example>open_file("path/to/file", "name_of_dialog", "button_used_for_opening")</example>
191
+ </method-->
192
+ <method name="press_enter">
193
+ <description>Sends an Enter key stroke to the top most application</description>
194
+ <example>press_enter()</example>
195
+ </method>
196
+ </methods>
197
+
198
+ </behaviour>
199
+
200
+ <behaviour name="QtWidget" object_type="*" sut_type="QT" input_type="touch" version="*">
201
+
202
+ <module name="MobyBehaviour::QT::Widget" />
203
+
204
+ <methods>
205
+ <method name="move_mouse">
206
+ <description>Moves the mouse to the object it was called on.</description>
207
+ <example>move_mouse</example>
208
+ </method>
209
+ <method name="tap">
210
+ <description>Tap on the object once using left mouse button and center coordinates.</description>
211
+ <example>tap(1, :Left, nil, nil)</example>
212
+ </method>
213
+ <method name="tap_object">
214
+ <description>Tap inside the object at the specific point, relative to the object.</description>
215
+ <example>tap_object(5, 5, 1, :Left)</example>
216
+ </method>
217
+ <method name="tap_down_object">
218
+ <description>Tap down on the screen on the specified coordinates of the object. Given coordinates are relative to the object.</description>
219
+ <example>tap_down_object(5, 5)</example>
220
+ </method>
221
+ <method name="tap_up_object">
222
+ <description>Tap up on the screen on the specified coordinates of the object. Given coordinates are relative to the object.</description>
223
+ <example>tap_up_object(5, 5)</example>
224
+ </method>
225
+ <method name="long_tap">
226
+ <description>Tap the object, holding the tap down for a specified time.</description>
227
+ <example>long_tap(1, :Left)</example>
228
+ </method>
229
+ <method name="long_tap_object">
230
+ <description>Long tap on the screen on the given relative coordinates of the object for the period of time given is seconds.</description>
231
+ <example>long_tap_object(5, 5, 1, :Left)</example>
232
+ </method>
233
+ <method name="tap_up">
234
+ <description>Release a tap being held down on the object.</description>
235
+ <example>tap_up(:Left)</example>
236
+ </method>
237
+ <method name="tap_down">
238
+ <description>Tap the object, holding the tap down.</description>
239
+ <example>tap_down(:Left)</example>
240
+ </method>
241
+ <method name="press">
242
+ <description>Tap the object.</description>
243
+ <example>press(1, :Left)</example>
244
+ </method>
245
+ <method name="long_press">
246
+ <description>Tap the object, holding the tap down for a specified time.</description>
247
+ <example>long_press(1, :Left)</example>
248
+ </method>
249
+ <method name="hold">
250
+ <description>Tap the object, holding the tap down.</description>
251
+ <example>hold(:Left)</example>
252
+ </method>
253
+ <method name="release">
254
+ <description>Release a tap being held down on the object.</description>
255
+ <example>release(:Left)</example>
256
+ </method>
257
+ </methods>
258
+
259
+ </behaviour>
260
+
261
+ <behaviour name="QtWebkit" object_type="*" sut_type="QT;S60QT" input_type="*" version="*">
262
+
263
+ <module name="MobyBehaviour::QT::Webkit" />
264
+
265
+ <methods>
266
+ <method name="execute_javascript">
267
+ <description>Executes given javascript code on the given object.</description>
268
+ <example>execute_javascript</example>
269
+ </method>
270
+ <method name="execute_javascript_query">
271
+ <description>Executes given javascript code on the given locator query.</description>
272
+ <example>execute_javascript_query</example>
273
+ </method>
274
+ <method name="scroll">
275
+ <description>For QwebView, scrolls given amount of pixels in the QWebFrame with dx, dy, for web elements scrolls the element visible</description>
276
+ <example>scroll(0,10)</example>
277
+ <example>scroll()</example>
278
+ </method>
279
+ </methods>
280
+ </behaviour>
281
+
282
+
283
+ <behaviour name="QtSynchronization" object_type="*" sut_type="QT" input_type="touch" version="*">
284
+
285
+ <module name="MobyBehaviour::QT::Synchronization" />
286
+
287
+ <methods>
288
+ <method name="wait_for_signal">
289
+ <description>Synchronizes execution to a signal. The script will wait until the given signal is emitted.</description>
290
+ <example>wait_for_signal(10, "clicked()")</example>
291
+ </method>
292
+ </methods>
293
+
294
+ </behaviour>
295
+
296
+ <behaviour name="QtFixture" object_type="sut;*" sut_type="QT" input_type="*" version="*">
297
+
298
+ <module name="MobyBehaviour::QT::Fixture" />
299
+
300
+ <methods>
301
+ <method name="fixture">
302
+ <description>For parameters see fixture documentation</description>
303
+ <example>fixture</example>
304
+ </method>
305
+ <method name="async_fixture">
306
+ <description>For parameters see fixture documentation</description>
307
+ <example>async_fixture</example>
308
+ </method>
309
+ </methods>
310
+
311
+ </behaviour>
312
+
313
+ <behaviour name="QtFileTransfer" object_type="sut" sut_type="QT" input_type="*" version="*">
314
+
315
+ <module name="MobyBehaviour::QT::FileTransfer" />
316
+
317
+ <methods>
318
+ <method name="delete_from_sut">
319
+ <description>Delete files from sut</description>
320
+ <example>delete_from_sut(:from => 'c:/data/', :file => '*.*')</example>
321
+ </method>
322
+ <method name="copy_from_sut">
323
+ <description>Copy files from sut to host machine</description>
324
+ <example>copy_from_sut(:from => 'c:/data/', :file => '*.*', :to => 'c:/temp/' )</example>
325
+ </method>
326
+ <method name="copy_to_sut">
327
+ <description>Copy files to sut from host machine</description>
328
+ <example>copy_to_sut(:from => 'c:/images/', :file => '*.*', :to => 'e:/data/images' )</example>
329
+ </method>
330
+ <method name="list_files_from_sut">
331
+ <description>List files from sut path</description>
332
+ <example>list_files_from_sut(:from => 'c:/data/', :file => '*.*')</example>
333
+ </method>
334
+ </methods>
335
+
336
+ </behaviour>
337
+
338
+
339
+ <behaviour name="QtTypeText" object_type="*" sut_type="QT" input_type="*" version="*">
340
+
341
+ <module name="MobyBehaviour::QT::TypeText" />
342
+
343
+ <methods>
344
+ <method name="type_text">
345
+ <description>Enter the given text into the object.</description>
346
+ <example>type_text("What would you like to type?")</example>
347
+ </method>
348
+ </methods>
349
+
350
+ </behaviour>
351
+
352
+ <behaviour name="QtKeyPress" object_type="*" sut_type="QT" input_type="*" version="*">
353
+
354
+ <module name="MobyBehaviour::QT::KeyPress" />
355
+
356
+ <methods>
357
+ <method name="press_key">
358
+ <description>Press key on the object. Used key codes are defined in qt_keymap.xml for the sut.</description>
359
+ <example>press_key(:kDelete)</example>
360
+ </method>
361
+ </methods>
362
+
363
+ </behaviour>
364
+
365
+ <behaviour name="QtAttribute" object_type="*" sut_type="QT" input_type="*" version="*">
366
+
367
+ <module name="MobyBehaviour::QT::Attribute" />
368
+
369
+ <methods>
370
+ <method name="set_attribute">
371
+ <description>Set any writable attribute value. String, number and boolean values supported. Attribute is verified to be writable. Notice that setting the attribute might have no effect in the UI if the UI component is not monitoring the changes to the attribute and therefore will not repaint once the attribute value has changed.</description>
372
+ <example>set_attribute("toolTip", "myToolTip")</example>
373
+ </method>
374
+ </methods>
375
+
376
+ </behaviour>
377
+
378
+ <behaviour name="QtMethod" object_type="*" sut_type="QT" input_type="*" version="*">
379
+
380
+ <module name="MobyBehaviour::QT::Method" />
381
+
382
+ <methods>
383
+ <method name="call_method">
384
+ <description>Calls selected method on object. At the moment only non parametrized methods are allowed. No other check is done than that method is found</description>
385
+ <example>call_method("close()")</example>
386
+ </method>
387
+ </methods>
388
+
389
+ </behaviour>
390
+
391
+ <behaviour name="QtGesture" object_type="*" sut_type="QT" input_type="touch" version="*">
392
+
393
+ <module name="MobyBehaviour::QT::Gesture" />
394
+
395
+ <methods>
396
+ <method name="flick">
397
+ <description>Do a flick gesture starting at the object.</description>
398
+ <example>flick(:Up, :Left)</example>
399
+ </method>
400
+ <method name="flick_to">
401
+ <description>Flick the object to the specified (X, Y) coordinates.</description>
402
+ <example>flick_to(400, 100)</example>
403
+ </method>
404
+ <method name="gesture">
405
+ <description>Perform a gesture on the object using the given direction, speed, distance and button.</description>
406
+ <example>gesture(:Up, 2, 200, :Left)</example>
407
+ </method>
408
+ <method name="gesture_to">
409
+ <description>Flick/drag the screen from the given object (touch the object and cause a flick or drag gesture).</description>
410
+ <example>gesture_to(400, 100)</example>
411
+ </method>
412
+ <method name="gesture_to_object">
413
+ <description>Gesture the object to another test object on the screen.</description>
414
+ <example>gesture_to_object(another_test_object)</example>
415
+ </method>
416
+ <method name="gesture_points">
417
+ <description>Gesture on specific poinst on the screen. Points have to be passed as a array of hashes.</description>
418
+ <example>gesture_points([{"x" => 200,"y" => 100, interval => 100},{"x" => 200,"y" => 110, interval => 80}])</example>
419
+ </method>
420
+ <method name="drag">
421
+ <description>Drag the object on the screen.</description>
422
+ <example>drag(:Up, 200)</example>
423
+ </method>
424
+ <method name="drag_to">
425
+ <description>Drag the object to the specified (X, Y) coordinates.</description>
426
+ <example>drag_to(400, 100)</example>
427
+ </method>
428
+ <method name="drag_to_object">
429
+ <description>Drag the object to another test object on the screen.</description>
430
+ <example>drag_to_object(another_test_object)</example>
431
+ </method>
432
+ <method name="move">
433
+ <description>Moves the pointer the given distance to the given direction.</description>
434
+ <example>move(direction, distance, button = :Left)</example>
435
+ </method>
436
+ <method name="object_center_x">
437
+ <description>Utility function for getting the x coordinate of the center of the object.</description>
438
+ <example>object_center_x</example>
439
+ </method>
440
+ <method name="object_center_y">
441
+ <description>Utility function for getting the x coordinate of the center of the object.</description>
442
+ <example>object_center_y</example>
443
+ </method>
444
+ </methods>
445
+
446
+ </behaviour>
447
+
448
+ <behaviour name="QtScreenCapture" object_type="*" sut_type="QT" input_type="*" version="*">
449
+
450
+ <module name="MobyBehaviour::QT::ScreenCapture" />
451
+
452
+ <methods>
453
+ <method name="capture_screen">
454
+ <description>Capture the device display and store it in a file.</description>
455
+ <example>capture_screen("PNG", "c:/temp/capture.png")</example>
456
+ </method>
457
+ <method name="find_on_screen">
458
+ <description>Checks if and where the given image can be found on the SUT display or inside a widget</description>
459
+ <example>find_on_screen("c:/some_icon.png", 10)</example>
460
+ </method>
461
+ <method name="screen_contains?">
462
+ <description>Checks if the given image can be found on the SUT display or inside a widget</description>
463
+ <example>screen_contains?("c:/some_icon.png", 10)</example>
464
+ </method>
465
+ </methods>
466
+
467
+ </behaviour>
468
+
469
+ <behaviour name="QtAction" object_type="QAction" sut_type="QT" input_type="touch" version="*">
470
+
471
+ <module name="MobyBehaviour::QT::Action" />
472
+
473
+ <methods>
474
+ <method name="hover">
475
+ <description>Hover over the action.</description>
476
+ <example>hover</example>
477
+ </method>
478
+ <method name="trigger">
479
+ <description>Trigger the action.</description>
480
+ <example>trigger</example>
481
+ </method>
482
+ </methods>
483
+
484
+ </behaviour>
485
+
486
+ <behaviour name="QtFind" object_type="*" sut_type="QT" input_type="touch" version="*">
487
+
488
+ <module name="MobyBehaviour::QT::Find" />
489
+
490
+ <methods>
491
+ <method name="find_and_center">
492
+ <description>Defines methods to find test objects and scroll them to the display.</description>
493
+ <example>find_and_center</example>
494
+ </method>
495
+ </methods>
496
+
497
+ </behaviour>
498
+
499
+ <behaviour name="QtViewItem" object_type="ItemData;QTreeWidgetItem;QListWidgetItem;QTableWidgetItem" sut_type="QT" input_type="*" version="*">
500
+
501
+ <module name="MobyBehaviour::QT::ViewItem" />
502
+
503
+ <methods>
504
+ <method name="select">
505
+ <description>Select the item.</description>
506
+ <example>select</example>
507
+ </method>
508
+ </methods>
509
+
510
+ </behaviour>
511
+
512
+
513
+ <behaviour name="QtTreeWidgetItemColumn" object_type="TreeWidgetItemColumn" sut_type="QT" input_type="*" version="*">
514
+
515
+ <module name="MobyBehaviour::QT::TreeWidgetItemColumn" />
516
+
517
+ <methods>
518
+ <method name="check_state">
519
+ <description>Set the check state of the column inside treewidget item.</description>
520
+ <example>check_state(2)</example>
521
+ </method>
522
+ </methods>
523
+
524
+ </behaviour>
525
+
526
+
527
+ <behaviour name="QtConfigureBehaviour" object_type="sut;application" sut_type="QT" input_type="*" version="*">
528
+
529
+ <module name="MobyBehaviour::QT::ConfigureBehaviour" />
530
+
531
+ <methods>
532
+ <method name="clear_log">
533
+ <description>Clear log on the target.</description>
534
+ <example>clear_log</example>
535
+ </method>
536
+ <method name="enable_logger">
537
+ <description>Enable logging on the target.</description>
538
+ <example>enable_logger</example>
539
+ </method>
540
+ <method name="disable_logger">
541
+ <description>Disable logging on the target.</description>
542
+ <example>disable_logger</example>
543
+ </method>
544
+ <method name="set_log_level">
545
+ <description>Set logging level on the target.</description>
546
+ <example>set_log_level(:INFO)</example>
547
+ </method>
548
+ <method name="set_log_folder">
549
+ <description>Set logging folder on the target.</description>
550
+ <example>set_log_folder('/tmp/logs/')</example>
551
+ </method>
552
+ <method name="log_to_qdebug">
553
+ <description>Set logging direct all logging to qDebug or not.</description>
554
+ <example>log_to_qdebug(true)</example>
555
+ </method>
556
+ <method name="log_qdebug">
557
+ <description>Log all qDebug messages to log files or not.</description>
558
+ <example>log_qdebug(true)</example>
559
+ </method>
560
+ <method name="set_log_size">
561
+ <description>Set log file size.</description>
562
+ <example>set_log_size(100000)</example>
563
+ </method>
564
+ <method name="configure_logger">
565
+ <description>Configure the logger..</description>
566
+ <example>configure_logger({:logEnabled => true, :logLevel => :DEBUG, :logSize => 10000})</example>
567
+ </method>
568
+ <method name="log_events">
569
+ <description>Log events.</description>
570
+ <example>log_events('MousePress,MouseRelease')</example>
571
+ </method>
572
+ <method name="stop_event_logging">
573
+ <description>Stop logging events.</description>
574
+ <example>stop_event_logging</example>
575
+ </method>
576
+ </methods>
577
+
578
+ </behaviour>
579
+
580
+
581
+ <behaviour name="QtMultitouch" object_type="*" sut_type="QT" input_type="touch" version="*">
582
+
583
+ <module name="MobyBehaviour::QT::Multitouch" />
584
+
585
+ <methods>
586
+ <method name="pinch_zoom_in">
587
+ <description>Perform a pinch zoom in on a component.</description>
588
+ <example>pinch_zoom(2, 100, :Vertical)</example>
589
+ </method>
590
+ <method name="pinch_zoom_out">
591
+ <description>Perform a pinch zoom in on a component.</description>
592
+ <example>pinch_zoom(2, 100, :Vertical)</example>
593
+ </method>
594
+ <method name="pinch_zoom">
595
+ <description>Perform a pinch zoom on a component.</description>
596
+ <example>pinch_zoom({:type => :out, :speed => speed, :distance_1 => distance, :distance_2 => distance, :direction => direction, :differential => 10})</example>
597
+ </method>
598
+ <method name="one_point_rotate">
599
+ <description>Rotate by holding one point down and moving the other.</description>
600
+ <example>one_point_rotate(100, 0, :Clockwise, 90, 2)</example>
601
+ </method>
602
+ <method name="two_point_rotate">
603
+ <description>Rotate by moving both ends.</description>
604
+ <example>two_point_rotate(100, 0, :Clockwise, 45, 2)</example>
605
+ </method>
606
+ <method name="rotate">
607
+ <description>Send a rotate motion t a component.</description>
608
+ <example>rotate({:type => :one_point, :radius => 100, :rotate_direction => :Clockwise, :distance => 100, :speed => 2, :direction => 0})</example>
609
+ </method>
610
+ </methods>
611
+
612
+ </behaviour>
613
+
614
+ <behaviour name="Switchbox" object_type="sut" sut_type="QT" input_type="*" version="*">
615
+
616
+ <module name="MobyBehaviour::SwitchboxBehaviour" />
617
+
618
+ <methods>
619
+ <method name="reset">
620
+ <description>Reboots the device using switchbox</description>
621
+ <example>reset</example>
622
+ </method>
623
+ <method name="power_down">
624
+ <description>Instructs the switchbox to power up the sut</description>
625
+ <example>power_down</example>
626
+ </method>
627
+ <method name="power_up">
628
+ <description>Instructs the switchbox to power up the sut</description>
629
+ <example>power_up</example>
630
+ </method>
631
+ <method name="power_status">
632
+ <description>Gets the current power status of the switchbox</description>
633
+ <example>power_status</example>
634
+ </method>
635
+ </methods>
636
+
637
+ </behaviour>
638
+
639
+ <!--
640
+ <behaviour name="Flash" object_type="sut" sut_type="QT" input_type="*" version="*">
641
+
642
+ <module name="MobyBehaviour::FlashBehaviour" />
643
+
644
+ <methods>
645
+ <method name="flash">
646
+ <description>Flashes the device using any command line tool</description>
647
+ <example>flash</example>
648
+ </method>
649
+ <method name="flash_files">
650
+ <description>Instructs to flash defined files with a command line tool</description>
651
+ <example>flash_files('\tmp\image.bin \tmp\image2.bin')</example>
652
+ </method>
653
+ </methods>
654
+
655
+ </behaviour>
656
+ -->
657
+
658
+ <behaviour name="QtInfoLoggerBehaviour" object_type="sut;application" sut_type="QT" input_type="*" version="*">
659
+
660
+ <module name="MobyBehaviour::QT::InfoLoggerBehaviour" />
661
+
662
+ <methods>
663
+ <method name="log_cpu">
664
+ <description>Log the cpu usage of the process</description>
665
+ <example>log_cpu</example>
666
+ </method>
667
+ <method name="stop_cpu_log">
668
+ <description>Stop cpu logging and get the results.</description>
669
+ <example>stop_cpu_log</example>
670
+ </method>
671
+ <method name="log_mem">
672
+ <description>Log memory usage.</description>
673
+ <example>log_mem</example>
674
+ </method>
675
+ <method name="stop_mem_log">
676
+ <description>Stop mem logging and get the results.</description>
677
+ <example>stop_mem_log</example>
678
+ </method>
679
+ <method name="log_gpu_mem">
680
+ <description>Log the gpu mem usage</description>
681
+ <example>log_gpu_mem</example>
682
+ </method>
683
+ <method name="stop_gpu_log">
684
+ <description>Stop gpu logging and get the results.</description>
685
+ <example>stop_gpu_log</example>
686
+ </method>
687
+ <method name="load_cpu_log">
688
+ <description>Load cpu logging results.</description>
689
+ <example>load_cpu_log</example>
690
+ </method>
691
+ <method name="load_gpu_log">
692
+ <description>Load Gpu logging results.</description>
693
+ <example>load_gpu_log</example>
694
+ </method>
695
+ <method name="load_mem_log">
696
+ <description>Load mem logging results.</description>
697
+ <example>load_mem_log</example>
698
+ </method>
699
+ </methods>
700
+
701
+ </behaviour>
702
+
703
+
704
+ <behaviour name="QtLocalisationDB" object_type="sut" sut_type="QT" input_type="*" version="*">
705
+
706
+ <module name="MobyBehaviour::QT::LocalisationDB" />
707
+
708
+ <methods>
709
+ <method name="create_locale_db">
710
+ <description>Creates locale_db file.</description>
711
+ <example>create_locale_db("/usr/share", "*.qm", "/path/to/locale_db")</example>
712
+ </method>
713
+ </methods>
714
+ </behaviour>
715
+
716
+
717
+ </behaviours>