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/commands/find_object.rb
CHANGED
@@ -19,32 +19,49 @@
|
|
19
19
|
|
20
20
|
module MobyCommand
|
21
21
|
|
22
|
-
|
23
22
|
class FindObjectCommand < MobyCommand::CommandData
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
end
|
23
|
+
|
24
|
+
# Constructor
|
25
|
+
# == params
|
26
|
+
# btn_id:: (optional) String, id for the button perform this command on
|
27
|
+
# command_type:: (optional) Symbol, defines the command to perform on the button
|
28
|
+
# == returns
|
29
|
+
# MobyCommand::FindObjectCommand:: New CommandData object
|
30
|
+
# == raises
|
31
|
+
# ArgumentError:: When the supplied command_type is invalid.
|
32
|
+
def initialize( sut, app_details = nil, params = nil, checksum = nil )
|
33
|
+
|
34
|
+
@_params = params
|
35
|
+
|
36
|
+
@_app_details = app_details
|
37
|
+
|
38
|
+
@_sut = sut
|
39
|
+
|
40
|
+
@_checksum = checksum
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
# TODO: document me
|
45
|
+
def application_details
|
46
|
+
|
47
|
+
@_app_details
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
# TODO: document me
|
52
|
+
def search_parameters
|
53
|
+
|
54
|
+
@_params
|
55
|
+
|
56
|
+
end
|
57
|
+
|
58
|
+
# TODO: document me
|
59
|
+
def checksum
|
60
|
+
|
61
|
+
@_checksum
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
end # FindObjectCommand
|
66
|
+
|
67
|
+
end # MobyCommand
|
@@ -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
|
@@ -42,7 +42,7 @@ module MobyCommand
|
|
42
42
|
@@_valid_types = [ nil, :Standard, :Graphics, :Application, :Action, :Web ]
|
43
43
|
|
44
44
|
self.application_id(application_id )
|
45
|
-
self.
|
45
|
+
self.set_object_id( object_id )
|
46
46
|
self.object_type( object_type )
|
47
47
|
self.command_name( command_name )
|
48
48
|
self.command_params( params )
|
@@ -123,7 +123,7 @@ module MobyCommand
|
|
123
123
|
# == returns
|
124
124
|
# == raises
|
125
125
|
# ArgumentError:: When the supplied id is not of type String
|
126
|
-
def
|
126
|
+
def set_object_id(id)
|
127
127
|
raise ArgumentError.new( "Object id must be a string." ) unless id == nil or id.kind_of?( String )
|
128
128
|
@_object_id = id
|
129
129
|
end
|
data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/application.rb
CHANGED
@@ -20,128 +20,181 @@
|
|
20
20
|
module MobyController
|
21
21
|
|
22
22
|
module QT
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
|
24
|
+
module Application
|
25
|
+
|
26
26
|
include MobyUtil::MessageComposer
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
28
|
+
def set_adapter( adapter )
|
29
|
+
|
30
|
+
@sut_adapter = adapter
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
# Execute the command
|
35
|
+
# Sends the message to the device using the @sut_adapter (see base class)
|
36
|
+
# == params
|
37
|
+
# == returns
|
38
|
+
# == raises
|
39
|
+
# ArgumentError: raised if unsupported command type
|
40
|
+
def execute
|
41
|
+
|
42
|
+
return_response_crc = false
|
43
|
+
|
44
|
+
case @_command
|
45
|
+
|
46
|
+
# application ui state
|
47
|
+
when :State
|
48
|
+
|
49
|
+
command_xml = state_message
|
50
|
+
|
51
|
+
return_response_crc = true
|
52
|
+
|
53
|
+
# launch application
|
54
|
+
when :Run
|
55
|
+
|
56
|
+
command_xml = run_message
|
57
|
+
|
58
|
+
# close
|
59
|
+
when :Close
|
60
|
+
|
61
|
+
command_xml = close_message
|
62
|
+
|
63
|
+
# close qttas
|
64
|
+
when :CloseQttas
|
65
|
+
|
66
|
+
command_xml = make_xml_message( { :service => 'closeApplication' }, 'Close', { 'uid' => '0' } )
|
67
|
+
|
68
|
+
# kill application
|
69
|
+
when :Kill
|
70
|
+
|
71
|
+
command_xml = make_xml_message( { :service => 'closeApplication' }, 'Kill', { 'uid' => @_application_uid } )
|
72
|
+
|
73
|
+
# list applications
|
74
|
+
when :ListApps
|
75
|
+
|
76
|
+
service_details = {
|
77
|
+
:service => 'listApps',
|
78
|
+
:name => @_application_name,
|
79
|
+
:id => @_application_uid
|
80
|
+
}
|
81
|
+
|
82
|
+
command_xml = make_xml_message( service_details, 'listApps', nil )
|
83
|
+
|
84
|
+
# list applications
|
85
|
+
when :ListRunningProcesses
|
86
|
+
|
87
|
+
service_details = {
|
88
|
+
:service => 'listRunningProcesses',
|
89
|
+
:name => @_application_name,
|
90
|
+
:id => @_application_uid
|
91
|
+
}
|
92
|
+
|
93
|
+
command_xml = make_xml_message( service_details, 'listRunningProcesses', nil )
|
94
|
+
|
95
|
+
# list started applications
|
96
|
+
when :ListStartedApps
|
97
|
+
|
98
|
+
service_details = {
|
99
|
+
:service => 'startedApps',
|
100
|
+
:name => @_application_name,
|
101
|
+
:id => @_application_uid
|
102
|
+
}
|
103
|
+
|
104
|
+
command_xml = make_xml_message( service_details, 'startedApps', nil )
|
105
|
+
|
106
|
+
# list crashed applications
|
107
|
+
when :ListCrashedApps
|
108
|
+
|
109
|
+
service_details = {
|
110
|
+
:service => 'listCrashedApps',
|
111
|
+
:name => @_application_name,
|
112
|
+
:id => @_application_uid
|
113
|
+
}
|
114
|
+
|
115
|
+
command_xml = make_xml_message( service_details, 'listCrashedApps', nil )
|
116
|
+
|
117
|
+
# shell command
|
118
|
+
when :Shell
|
119
|
+
|
120
|
+
command_xml = make_xml_message( { :service => 'shellCommand' }, 'shellCommand', @_flags, @_application_name )
|
121
|
+
|
122
|
+
# kill all application started by agent_qt
|
123
|
+
when :KillAll
|
124
|
+
|
125
|
+
command_xml = make_xml_message( { :service => 'kill' }, 'Kill', nil )
|
126
|
+
|
127
|
+
# tap screen
|
128
|
+
when :TapScreen
|
129
|
+
|
130
|
+
command_xml = make_xml_message( { :service =>'tapScreen' }, 'TapScreen', params)
|
131
|
+
|
132
|
+
# bring application to foreground
|
133
|
+
when :BringToForeground
|
134
|
+
|
135
|
+
command_xml = make_xml_message( { :service => 'bringToForeground' }, 'BringToForeground', { 'pid' => @_application_uid } )
|
136
|
+
|
137
|
+
# system info
|
138
|
+
when :SystemInfo
|
139
|
+
|
140
|
+
command_xml = make_xml_message( { :service => 'systemInfo' }, 'systemInfo', nil)
|
141
|
+
|
142
|
+
# start process memory logging
|
143
|
+
when :ProcessMemLoggingStart
|
144
|
+
|
145
|
+
parameters = {
|
146
|
+
'thread_name' => @_application_name,
|
147
|
+
'file_name' => @_flags[ :file_name ],
|
148
|
+
'timestamp' => @_flags[ :timestamp ],
|
149
|
+
'interval_s' => @_flags[ :interval_s ]
|
150
|
+
}
|
151
|
+
|
152
|
+
command_xml = make_xml_message( { :service => 'resourceLogging' }, 'ProcessMemLoggingStart', parameters )
|
153
|
+
|
154
|
+
# stop process memory logging
|
155
|
+
when :ProcessMemLoggingStop
|
156
|
+
|
157
|
+
parameters = {
|
158
|
+
'thread_name' => @_application_name,
|
159
|
+
'return_data' => @_flags[ :return_data ]
|
160
|
+
}
|
161
|
+
|
162
|
+
command_xml = make_xml_message( { :service =>'resourceLogging' }, 'ProcessMemLoggingStop', parameters )
|
163
|
+
|
164
|
+
# start CPU load generating
|
165
|
+
when :CpuLoadStart
|
166
|
+
|
167
|
+
parameters = {
|
168
|
+
'cpu_load' => @_flags[ :cpu_load ]
|
169
|
+
}
|
170
|
+
|
171
|
+
command_xml = make_xml_message( { :service => 'resourceLogging' }, 'CpuLoadStart', parameters )
|
172
|
+
|
173
|
+
# stop CPU load generating
|
174
|
+
when :CpuLoadStop
|
175
|
+
|
176
|
+
command_xml = make_xml_message( { :service => 'resourceLogging' }, 'CpuLoadStop', nil )
|
177
|
+
|
178
|
+
# list application -- raises exception??
|
179
|
+
#when :List
|
180
|
+
|
181
|
+
#raise ArgumentError, "Unknown command! #{ @_command.to_s }"
|
182
|
+
|
183
|
+
else
|
184
|
+
|
185
|
+
# unknown command
|
186
|
+
raise ArgumentError, "Unknown command! #{ @_command.to_s }"
|
187
|
+
|
188
|
+
end
|
189
|
+
|
190
|
+
message = Comms::MessageGenerator.generate( command_xml )
|
191
|
+
|
192
|
+
@sut_adapter.send_service_request( message, return_response_crc ) if message
|
193
|
+
|
194
|
+
end
|
195
|
+
|
196
|
+
end # application
|
197
|
+
|
198
|
+
end # QT
|
146
199
|
|
147
200
|
end # MobyController
|
data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/find_object.rb
CHANGED
@@ -21,30 +21,39 @@ module MobyController
|
|
21
21
|
|
22
22
|
module QT
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
end
|
24
|
+
module FindObjectCommand
|
25
|
+
|
26
|
+
include MobyUtil::FindObjectGenerator
|
27
|
+
|
28
|
+
# Execute the command
|
29
|
+
# Sends the message to the device using the @sut_adapter (see base class)
|
30
|
+
# == params
|
31
|
+
# == returns
|
32
|
+
# == raises
|
33
|
+
# NotImplementedError: raised if unsupported command type
|
34
|
+
def execute
|
35
|
+
|
36
|
+
@sut_adapter.send_service_request(
|
37
|
+
|
38
|
+
# *[ message, return_crc ]
|
39
|
+
MobyController::QT::Comms::MessageGenerator.generate( generate_message ), true
|
40
|
+
|
41
|
+
)
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
def set_adapter( adapter )
|
46
|
+
|
47
|
+
@sut_adapter = adapter
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
# enable hooking for performance measurement & debug logging
|
52
|
+
TDriver::Hooking.hook_methods( self ) if defined?( TDriver::Hooking )
|
53
|
+
|
54
|
+
end # FindObjectCommand
|
55
|
+
|
56
|
+
end # QT
|
57
|
+
|
58
|
+
end # MobyController
|
50
59
|
|