cutedriver-qt-sut-plugin 2.0.0.20210120165900

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +7 -0
  2. data/env.rb +24 -0
  3. data/installer/extconf.rb +62 -0
  4. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin.rb +23 -0
  5. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/action.rb +157 -0
  6. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/application.rb +312 -0
  7. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/attribute.rb +300 -0
  8. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/behaviour.rb +214 -0
  9. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/configure_behaviour.rb +317 -0
  10. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/cute_cpu.rb +145 -0
  11. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/cute_gpu.rb +147 -0
  12. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/cute_mem.rb +142 -0
  13. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/cute_pwr.rb +146 -0
  14. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/events.rb +192 -0
  15. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/file_transfer.rb +375 -0
  16. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/find.rb +82 -0
  17. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/fixture.rb +214 -0
  18. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/fps.rb +189 -0
  19. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/gesture.rb +1039 -0
  20. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/infologger.rb +767 -0
  21. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/key_press.rb +166 -0
  22. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/locale_db.rb +157 -0
  23. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/method.rb +112 -0
  24. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/multitouch.rb +474 -0
  25. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/os.rb +100 -0
  26. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/qt_api_method.rb +148 -0
  27. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/record.rb +134 -0
  28. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/screen_capture.rb +279 -0
  29. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/settings.rb +302 -0
  30. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/sut.rb +840 -0
  31. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/synchronization.rb +257 -0
  32. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/treewidgetitemcolumn.rb +117 -0
  33. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/type_text.rb +97 -0
  34. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/view_item.rb +97 -0
  35. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/webkit.rb +272 -0
  36. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/widget.rb +877 -0
  37. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/action.rb +30 -0
  38. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/configure_command.rb +38 -0
  39. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/drag.rb +44 -0
  40. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/find_object.rb +67 -0
  41. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/group.rb +44 -0
  42. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/infologger_command.rb +38 -0
  43. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/qt.rb +171 -0
  44. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/tap.rb +54 -0
  45. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/version.rb +34 -0
  46. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/widget.rb +199 -0
  47. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/agent.rb +54 -0
  48. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/application.rb +192 -0
  49. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/configure_command.rb +53 -0
  50. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/find_object.rb +48 -0
  51. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/fixture.rb +65 -0
  52. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/group.rb +57 -0
  53. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/infologger_command.rb +53 -0
  54. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/key_sequence.rb +93 -0
  55. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/screen_capture.rb +53 -0
  56. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/tap.rb +62 -0
  57. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/version.rb +46 -0
  58. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/widget.rb +98 -0
  59. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/plugin.rb +200 -0
  60. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/sut/adapter.rb +466 -0
  61. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/sut/communication.rb +185 -0
  62. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/sut/controller.rb +69 -0
  63. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/util/find_object_generator.rb +287 -0
  64. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/util/fixture_parameter.rb +77 -0
  65. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/util/message_composer.rb +370 -0
  66. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/util/widget.rb +79 -0
  67. data/lib/testability-driver-qt-sut-plugin.rb +24 -0
  68. data/xml/behaviour/qt.xml +845 -0
  69. data/xml/defaults/sut_qt.xml +9 -0
  70. data/xml/keymap/qt.xml +321 -0
  71. data/xml/keymap/win.xml +174 -0
  72. data/xml/template/qt.xml +141 -0
  73. metadata +127 -0
@@ -0,0 +1,34 @@
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 MobyCommand
21
+
22
+ class VersionCommand < MobyCommand::CommandData
23
+
24
+ # Constructor
25
+ # == params
26
+ # == returns
27
+ # MobyCommand::VersionCommand:: New CommandData object
28
+ # == raises
29
+ def initialize
30
+ end
31
+
32
+ end # VersionCommand
33
+
34
+ end # MobyCommand
@@ -0,0 +1,199 @@
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 MobyCommand
21
+
22
+ class WidgetCommand < MobyCommand::CommandData
23
+
24
+ # class variable
25
+ VALID_OBJECT_TYPES = [ nil, :Standard, :Graphics, :Application, :Action, :Web, :SceneGraph ] unless defined?( VALID_OBJECT_TYPES )
26
+
27
+ # Constructs a new CommandParams object. CommandParams stores the details for the commands send
28
+ # to suts that operate using the tasCommand xml format. The controller creates an xml formatted
29
+ # operation request that will be forwarded to the sut being tested.
30
+ # Example:
31
+ # Given params: command_name = MouseClick, params = [button => '1']
32
+ # xml command: <Command name="MouseClick" button="1">
33
+ #
34
+ # == params
35
+ # command_name:: Name of the command to be executed on the device (e.g. MouseClick)
36
+ # params:: A Hash containing the parameters sent to the device as name/value pairs (e.g. button => 1)
37
+ # == returns
38
+ # CommandParams:: New CommandParams object
39
+ # == raises
40
+ # ArgumentError:: When the supplied params are invalid type (initially can be nil)
41
+ def initialize( application_id = nil, object_id = nil, object_type = nil, command_name = nil, params = nil, value=nil, service = nil )
42
+
43
+ application_id(application_id )
44
+
45
+ set_object_id( object_id )
46
+
47
+ object_type( object_type )
48
+
49
+ command_name( command_name )
50
+
51
+ command_params( params )
52
+
53
+ command_value( value )
54
+
55
+ service( service )
56
+
57
+ transitions_on
58
+
59
+ self
60
+
61
+ end
62
+
63
+ def service( service )
64
+
65
+ @_service = service
66
+
67
+ end
68
+
69
+ # Set transition flag on
70
+ # Will cause the events to be
71
+ # done on a delayed mode.
72
+ def transitions_on
73
+
74
+ @_transitions = true
75
+
76
+ end
77
+
78
+ # Set transition flag off
79
+ # Will cause the events to be
80
+ # done on immediately
81
+ def transitions_off
82
+
83
+ @_transitions = false
84
+
85
+ end
86
+
87
+ # Set true if response is expected from device side after command
88
+ # Has been completed.
89
+ # ==params
90
+ # bool: True if response needed
91
+ def set_require_response( response_required )
92
+
93
+ @_response_required = response_required
94
+
95
+ end
96
+
97
+ # Returns true if response required after command.
98
+ def require_response?
99
+
100
+ @_response_required
101
+
102
+ end
103
+
104
+ # Application id of the currently tested application
105
+ # == params
106
+ # id:: Id of the application
107
+ # == returns
108
+ # == raises
109
+ # ArgumentError:: When the supplied id is not of type String
110
+ def application_id( id )
111
+
112
+ id.check_type [ NilClass, String ], 'wrong argument type $1 for application id (expected $2)'
113
+
114
+ @_application_id = id
115
+
116
+ end
117
+
118
+ # Object id of the target object
119
+ # == params
120
+ # id:: Id of the Object
121
+ # == returns
122
+ # == raises
123
+ # ArgumentError:: When the supplied id is not of type String
124
+ def set_object_id( id )
125
+
126
+ id.check_type [ NilClass, String ], 'wrong argument type $1 for object id (expected $2)'
127
+
128
+ @_object_id = id
129
+
130
+ end
131
+
132
+ # Object type of the target object
133
+ # == params
134
+ # type:: type of the Object
135
+ # == returns
136
+ # == raises
137
+ # ArgumentError:: When the supplied type is not :Graphics or :Standard
138
+ def object_type( type )
139
+
140
+ raise TypeError.new("Given object type #{ type.inspect } is not valid.") unless VALID_OBJECT_TYPES.include?( type )
141
+
142
+ @_object_type = type
143
+
144
+ end
145
+
146
+ # Name of the command
147
+ # == params
148
+ # name:: Name of the command to be executed on the device (e.g. MouseClick)
149
+ # == returns
150
+ # == raises
151
+ # ArgumentError:: When the supplied command_name is not of type String
152
+ def command_name( name )
153
+
154
+ name.check_type [ NilClass, String ], 'wrong argument type $1 for command name (expected $2)'
155
+
156
+ @_command_name = name
157
+
158
+ end
159
+
160
+ # Command parameters
161
+ # == params
162
+ # params:: A Hash containing the parameters sent to the device as name/value pairs (e.g. button => 1)
163
+ # == returns
164
+ # == raises
165
+ # ArgumentError:: When the supplied params is of type Hash
166
+ def command_params( params )
167
+
168
+ params.check_type [ NilClass, Hash ], 'wrong argument type $1 for command parameters (expected $2)'
169
+
170
+ @_command_params = params
171
+
172
+ end
173
+
174
+ # Command value which is passed on to the device as the value of the command.
175
+ # Example: <Command name=TypeText>Text to be written</Command> where the
176
+ # "Text to be written" would be the value String passed as parameter to this method.
177
+ # == params
178
+ # value:: A String that will be passed to the device in the value field in the command xml, or an Array containing data for multiple step commands
179
+ # == returns
180
+ # == raises
181
+ # ArgumentError:: When the supplied params not of type String or Array or nil
182
+ def command_value( value )
183
+
184
+ value.check_type [ NilClass, String, Array ], 'wrong argument type $1 for command value (expected $2)'
185
+
186
+ @_command_value = value
187
+
188
+ end
189
+
190
+ def set_event_type( event_type )
191
+
192
+ #event_type.check_type [ NilClass, String ], 'wrong argument type $1 for event type (expected $2)'
193
+
194
+ @_event_type = event_type
195
+
196
+ end
197
+
198
+ end
199
+ end
@@ -0,0 +1,54 @@
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 AgentCommand
25
+
26
+ include MobyController::Abstraction
27
+
28
+ # TODO: document me
29
+ # overloads default MobyController::Abstraction#make_message
30
+ def make_message
31
+
32
+ command = @parameters[ :command ]
33
+
34
+ case command
35
+
36
+ when :version
37
+
38
+ # query agent version from versionService
39
+ Comms::MessageGenerator.generate( '<TasCommands service="versionService" />' )
40
+
41
+ else
42
+
43
+ # raise exception if command not implemented
44
+ raise NotImplementedError, "command #{ command.inspect } not implemented in #{ self.class.name }"
45
+
46
+ end
47
+
48
+ end
49
+
50
+ end # AgentCommand
51
+
52
+ end # QT
53
+
54
+ end # MobyController
@@ -0,0 +1,192 @@
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 Application
25
+
26
+ include MobyController::Abstraction
27
+
28
+ include MobyUtil::MessageComposer
29
+
30
+ # create message to be sent sut SUT adapter - returns [ "message_body", boolean ]
31
+ def make_message
32
+
33
+ return_response_crc = false
34
+
35
+ case @_command
36
+
37
+ # application ui state
38
+ when :State
39
+
40
+ command_xml = state_message
41
+
42
+ return_response_crc = true
43
+
44
+ # launch application
45
+ when :Run
46
+
47
+ command_xml = run_message
48
+
49
+ # close
50
+ when :Close
51
+
52
+ command_xml = close_message
53
+
54
+ # close qttas
55
+ when :CloseQttas
56
+
57
+ command_xml = make_xml_message( { :service => 'closeApplication' }, 'Close', { 'uid' => '0' } )
58
+
59
+ # kill application
60
+ when :Kill
61
+
62
+ command_xml = make_xml_message( { :service => 'closeApplication' }, 'Kill', { 'uid' => @_application_uid } )
63
+
64
+ # list applications
65
+ when :ListApps
66
+
67
+ service_details = {
68
+ :service => 'listApps',
69
+ :name => @_application_name,
70
+ :id => @_application_uid
71
+ }
72
+
73
+ command_xml = make_xml_message( service_details, 'listApps', nil )
74
+
75
+ # list applications
76
+ when :ListRunningProcesses
77
+
78
+ service_details = {
79
+ :service => 'listRunningProcesses',
80
+ :name => @_application_name,
81
+ :id => @_application_uid
82
+ }
83
+
84
+ command_xml = make_xml_message( service_details, 'listRunningProcesses', nil )
85
+
86
+ # list started applications
87
+ when :ListStartedApps
88
+
89
+ service_details = {
90
+ :service => 'startedApps',
91
+ :name => @_application_name,
92
+ :id => @_application_uid
93
+ }
94
+
95
+ command_xml = make_xml_message( service_details, 'startedApps', nil )
96
+
97
+ # shell command
98
+ when :Shell
99
+
100
+ command_xml = make_xml_message( { :service => 'shellCommand' }, 'shellCommand', @_flags, @_application_name )
101
+
102
+ # kill all application started by agent_qt
103
+ when :KillAll
104
+
105
+ command_xml = make_xml_message( { :service => 'kill' }, 'Kill', nil )
106
+
107
+ # tap screen
108
+ when :TapScreen
109
+
110
+ command_xml = make_xml_message( { :service =>'tapScreen' }, 'TapScreen', params)
111
+
112
+ # bring application to foreground
113
+ when :BringToForeground
114
+
115
+ command_xml = make_xml_message( { :service => 'bringToForeground' }, 'BringToForeground', { 'pid' => @_application_uid } )
116
+
117
+ # system info
118
+ when :SystemInfo
119
+
120
+ command_xml = make_xml_message( { :service => 'systemInfo' }, 'systemInfo', nil)
121
+
122
+ # start process memory logging
123
+ when :ProcessMemLoggingStart
124
+
125
+ parameters = {
126
+ 'thread_name' => @_application_name,
127
+ 'file_name' => @_flags[ :file_name ],
128
+ 'timestamp' => @_flags[ :timestamp ],
129
+ 'interval_s' => @_flags[ :interval_s ]
130
+ }
131
+
132
+ command_xml = make_xml_message( { :service => 'resourceLogging' }, 'ProcessMemLoggingStart', parameters )
133
+
134
+ # stop process memory logging
135
+ when :ProcessMemLoggingStop
136
+
137
+ parameters = {
138
+ 'thread_name' => @_application_name,
139
+ 'return_data' => @_flags[ :return_data ]
140
+ }
141
+
142
+ command_xml = make_xml_message( { :service =>'resourceLogging' }, 'ProcessMemLoggingStop', parameters )
143
+
144
+ # start CPU load generating
145
+ when :CpuLoadStart
146
+
147
+ parameters = {
148
+ 'cpu_load' => @_flags[ :cpu_load ]
149
+ }
150
+
151
+ command_xml = make_xml_message( { :service => 'resourceLogging' }, 'CpuLoadStart', parameters )
152
+
153
+ # stop CPU load generating
154
+ when :CpuLoadStop
155
+
156
+ command_xml = make_xml_message( { :service => 'resourceLogging' }, 'CpuLoadStop', nil )
157
+
158
+ # list application -- raises exception??
159
+ #when :List
160
+
161
+ #raise ArgumentError, "Unknown command! #{ @_command.to_s }"
162
+
163
+ else
164
+
165
+ # unknown command
166
+ raise ArgumentError, "Unknown command! #{ @_command.to_s }"
167
+
168
+ end
169
+
170
+ [ Comms::MessageGenerator.generate( command_xml ), return_response_crc ]
171
+
172
+ end
173
+
174
+ # Execute the command
175
+ # Sends the message to the device using the @sut_adapter (see base class)
176
+ # == params
177
+ # == returns
178
+ # == raises
179
+ # ArgumentError: raised if unsupported command type
180
+ def execute
181
+
182
+ message, return_response_crc = make_message
183
+
184
+ @sut_adapter.send_service_request( message, return_response_crc ) if message
185
+
186
+ end
187
+
188
+ end # Application
189
+
190
+ end # QT
191
+
192
+ end # MobyController