cutedriver-driver 2.0.0.20210120164037

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.
Files changed (226) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +16 -0
  3. data/bin/start_app_perf +200 -0
  4. data/bin/tdriver-devtools +3 -0
  5. data/config/sut_parameters.rb +52 -0
  6. data/config/sut_setup.rb +32 -0
  7. data/config/sut_teardown.rb +32 -0
  8. data/config/tdriver_custom_error_recovery.rb +83 -0
  9. data/ext/extconf.rb +70 -0
  10. data/ext/native_extensions.c +315 -0
  11. data/lib/matti.rb +25 -0
  12. data/lib/tdriver-devtools/behaviour/old/xml/example/flick-example.rb +120 -0
  13. data/lib/tdriver-devtools/behaviour/old/xml/example/impl.rb_invalid +194 -0
  14. data/lib/tdriver-devtools/behaviour/old/xml/generate_behaviour_xml.rb +95 -0
  15. data/lib/tdriver-devtools/behaviour/old/xml/lib/tdriver_generator.rb +722 -0
  16. data/lib/tdriver-devtools/behaviour/old/xml/qdoc_generator.rb +321 -0
  17. data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.method.template +43 -0
  18. data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.module.template +54 -0
  19. data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.argument.template +7 -0
  20. data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.argument_type.template +7 -0
  21. data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.exception.template +5 -0
  22. data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.howto.line.template +2 -0
  23. data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.howto.template +5 -0
  24. data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.method.template +23 -0
  25. data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.template +14 -0
  26. data/lib/tdriver-devtools/behaviour/old/xml/update +3 -0
  27. data/lib/tdriver-devtools/behaviour/xml/generate.rb +88 -0
  28. data/lib/tdriver-devtools/behaviour/xml/rdoc_behaviour_xml_generator.rb +1945 -0
  29. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.argument.default.template +1 -0
  30. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.argument.template +3 -0
  31. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.argument_type.template +4 -0
  32. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.exception.template +4 -0
  33. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.arguments.template +4 -0
  34. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.deprecated.template +3 -0
  35. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.exceptions.template +3 -0
  36. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.info.template +1 -0
  37. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.returns.template +3 -0
  38. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.tables.template +3 -0
  39. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.template +12 -0
  40. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.returns.template +5 -0
  41. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.table.item.template +1 -0
  42. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.table.row.template +2 -0
  43. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.table.template +8 -0
  44. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.template +14 -0
  45. data/lib/tdriver-devtools/doc/behaviour_xml/QtExampleGestureBehaviour.xml +138 -0
  46. data/lib/tdriver-devtools/doc/behaviour_xml/created.rid +1 -0
  47. data/lib/tdriver-devtools/doc/behaviour_xml/tdriver.hash +1 -0
  48. data/lib/tdriver-devtools/doc/feature_xml/qt_widget_hold.feature.xml +9 -0
  49. data/lib/tdriver-devtools/doc/feature_xml/qt_widget_tap.feature.xml +9 -0
  50. data/lib/tdriver-devtools/doc/generate.rb +917 -0
  51. data/lib/tdriver-devtools/doc/update +1 -0
  52. data/lib/tdriver-devtools/doc/xslt/html.rb +7 -0
  53. data/lib/tdriver-devtools/doc/xslt/template.xsl +2170 -0
  54. data/lib/tdriver-devtools/doc/xslt/update +3 -0
  55. data/lib/tdriver-devtools/plugin/placeholder.txt +1 -0
  56. data/lib/tdriver-devtools/tdriver-devtools.rb +404 -0
  57. data/lib/tdriver-devtools/tests/feature_tests/example/behaviour_example.rb +100 -0
  58. data/lib/tdriver-devtools/tests/feature_tests/generate.rb +82 -0
  59. data/lib/tdriver-devtools/tests/feature_tests/lib/custom_rdoc_generator.rb +468 -0
  60. data/lib/tdriver-devtools/tests/feature_tests/templates/feature_attribute.template +5 -0
  61. data/lib/tdriver-devtools/tests/feature_tests/templates/feature_method.template +5 -0
  62. data/lib/tdriver-devtools/tests/feature_tests/templates/scenario_attribute.template +5 -0
  63. data/lib/tdriver-devtools/tests/feature_tests/templates/scenario_method.template +5 -0
  64. data/lib/tdriver-devtools/tests/feature_tests/update +3 -0
  65. data/lib/tdriver.rb +23 -0
  66. data/lib/tdriver/base/behaviour/abstract.rb +29 -0
  67. data/lib/tdriver/base/behaviour/behaviours/object_abstract.rb +107 -0
  68. data/lib/tdriver/base/behaviour/behaviours/object_behaviour_composition.rb +99 -0
  69. data/lib/tdriver/base/behaviour/behaviours/object_behaviour_description.rb +278 -0
  70. data/lib/tdriver/base/behaviour/behaviours/object_composition.rb +119 -0
  71. data/lib/tdriver/base/behaviour/factory.rb +495 -0
  72. data/lib/tdriver/base/behaviour/loader.rb +46 -0
  73. data/lib/tdriver/base/command_data/command_data.rb +51 -0
  74. data/lib/tdriver/base/command_data/loader.rb +29 -0
  75. data/lib/tdriver/base/controller/abstraction.rb +56 -0
  76. data/lib/tdriver/base/controller/loader.rb +21 -0
  77. data/lib/tdriver/base/errors.rb +134 -0
  78. data/lib/tdriver/base/loader.rb +47 -0
  79. data/lib/tdriver/base/state_object.rb +373 -0
  80. data/lib/tdriver/base/sut/adapter.rb +54 -0
  81. data/lib/tdriver/base/sut/controller.rb +151 -0
  82. data/lib/tdriver/base/sut/factory.rb +339 -0
  83. data/lib/tdriver/base/sut/generic/behaviours/agent.rb +77 -0
  84. data/lib/tdriver/base/sut/generic/behaviours/application.rb +427 -0
  85. data/lib/tdriver/base/sut/generic/behaviours/controller.rb +67 -0
  86. data/lib/tdriver/base/sut/generic/behaviours/find.rb +107 -0
  87. data/lib/tdriver/base/sut/generic/behaviours/flash_behaviour.rb +337 -0
  88. data/lib/tdriver/base/sut/generic/behaviours/sut.rb +1888 -0
  89. data/lib/tdriver/base/sut/generic/behaviours/switchbox_behaviour.rb +210 -0
  90. data/lib/tdriver/base/sut/generic/behaviours/verification.rb +222 -0
  91. data/lib/tdriver/base/sut/generic/commands/agent.rb +43 -0
  92. data/lib/tdriver/base/sut/generic/commands/application.rb +274 -0
  93. data/lib/tdriver/base/sut/generic/commands/fixture.rb +47 -0
  94. data/lib/tdriver/base/sut/generic/commands/key_sequence.rb +94 -0
  95. data/lib/tdriver/base/sut/generic/commands/screen_capture.rb +64 -0
  96. data/lib/tdriver/base/sut/generic/plugin.rb +97 -0
  97. data/lib/tdriver/base/sut/loader.rb +35 -0
  98. data/lib/tdriver/base/sut/sut.rb +98 -0
  99. data/lib/tdriver/base/test_object/abstract.rb +208 -0
  100. data/lib/tdriver/base/test_object/adapter.rb +740 -0
  101. data/lib/tdriver/base/test_object/behaviours/syncronization.rb +144 -0
  102. data/lib/tdriver/base/test_object/behaviours/test_object.rb +1047 -0
  103. data/lib/tdriver/base/test_object/cache.rb +134 -0
  104. data/lib/tdriver/base/test_object/factory.rb +684 -0
  105. data/lib/tdriver/base/test_object/loader.rb +51 -0
  106. data/lib/tdriver/base/test_object/verification.rb +178 -0
  107. data/lib/tdriver/base/test_object/xml/abstraction.rb +63 -0
  108. data/lib/tdriver/base/test_object/xml/adapter.rb +773 -0
  109. data/lib/tdriver/env.rb +21 -0
  110. data/lib/tdriver/loader.rb +57 -0
  111. data/lib/tdriver/matti.rb +35 -0
  112. data/lib/tdriver/report/error_recovery/tdriver_custom_error_recovery.rb +83 -0
  113. data/lib/tdriver/report/error_recovery/tdriver_error_recovery.rb +168 -0
  114. data/lib/tdriver/report/error_recovery/tdriver_error_recovery_settings.rb +106 -0
  115. data/lib/tdriver/report/report.rb +61 -0
  116. data/lib/tdriver/report/report_api.rb +348 -0
  117. data/lib/tdriver/report/report_combine.rb +86 -0
  118. data/lib/tdriver/report/report_crash_file_capture.rb +178 -0
  119. data/lib/tdriver/report/report_creator.rb +665 -0
  120. data/lib/tdriver/report/report_cucumber.rb +158 -0
  121. data/lib/tdriver/report/report_cucumber_listener.rb +184 -0
  122. data/lib/tdriver/report/report_cucumber_reporter.rb +181 -0
  123. data/lib/tdriver/report/report_data_presentation.rb +156 -0
  124. data/lib/tdriver/report/report_data_table.rb +64 -0
  125. data/lib/tdriver/report/report_execution_statistics.rb +400 -0
  126. data/lib/tdriver/report/report_file_capture.rb +159 -0
  127. data/lib/tdriver/report/report_graph_generator.rb +59 -0
  128. data/lib/tdriver/report/report_grouping.rb +541 -0
  129. data/lib/tdriver/report/report_javascript.rb +199 -0
  130. data/lib/tdriver/report/report_junit_xml.rb +147 -0
  131. data/lib/tdriver/report/report_rspec.rb +108 -0
  132. data/lib/tdriver/report/report_test_case_run.rb +725 -0
  133. data/lib/tdriver/report/report_test_run.rb +1476 -0
  134. data/lib/tdriver/report/report_test_unit.rb +223 -0
  135. data/lib/tdriver/report/report_writer.rb +1621 -0
  136. data/lib/tdriver/tdriver.rb +209 -0
  137. data/lib/tdriver/util/agent/loader.rb +22 -0
  138. data/lib/tdriver/util/agent/service.rb +107 -0
  139. data/lib/tdriver/util/common/array.rb +39 -0
  140. data/lib/tdriver/util/common/boolean.rb +48 -0
  141. data/lib/tdriver/util/common/crc16.rb +149 -0
  142. data/lib/tdriver/util/common/environment.rb +154 -0
  143. data/lib/tdriver/util/common/error.rb +40 -0
  144. data/lib/tdriver/util/common/exception.rb +53 -0
  145. data/lib/tdriver/util/common/exceptions.rb +12 -0
  146. data/lib/tdriver/util/common/file.rb +328 -0
  147. data/lib/tdriver/util/common/gem.rb +109 -0
  148. data/lib/tdriver/util/common/hash.rb +288 -0
  149. data/lib/tdriver/util/common/kernel.rb +253 -0
  150. data/lib/tdriver/util/common/loader.rb +47 -0
  151. data/lib/tdriver/util/common/numeric.rb +159 -0
  152. data/lib/tdriver/util/common/object.rb +159 -0
  153. data/lib/tdriver/util/common/retryable.rb +179 -0
  154. data/lib/tdriver/util/common/stackable.rb +185 -0
  155. data/lib/tdriver/util/common/string.rb +174 -0
  156. data/lib/tdriver/util/database/access.rb +240 -0
  157. data/lib/tdriver/util/database/connection.rb +44 -0
  158. data/lib/tdriver/util/database/error.rb +34 -0
  159. data/lib/tdriver/util/database/loader.rb +28 -0
  160. data/lib/tdriver/util/filters/attribute_filter.rb +121 -0
  161. data/lib/tdriver/util/filters/loader.rb +29 -0
  162. data/lib/tdriver/util/fixture/loader.rb +22 -0
  163. data/lib/tdriver/util/fixture/service.rb +211 -0
  164. data/lib/tdriver/util/hooking/hooking.rb +477 -0
  165. data/lib/tdriver/util/keymap/keymap.rb +81 -0
  166. data/lib/tdriver/util/loader.rb +80 -0
  167. data/lib/tdriver/util/localisation/error.rb +31 -0
  168. data/lib/tdriver/util/localisation/loader.rb +25 -0
  169. data/lib/tdriver/util/localisation/localisation.rb +762 -0
  170. data/lib/tdriver/util/logger/loader.rb +22 -0
  171. data/lib/tdriver/util/logger/logger.rb +591 -0
  172. data/lib/tdriver/util/operator_data/error.rb +29 -0
  173. data/lib/tdriver/util/operator_data/loader.rb +27 -0
  174. data/lib/tdriver/util/operator_data/operator_data.rb +93 -0
  175. data/lib/tdriver/util/other/config.rb +221 -0
  176. data/lib/tdriver/util/parameter/error.rb +48 -0
  177. data/lib/tdriver/util/parameter/loader.rb +25 -0
  178. data/lib/tdriver/util/parameter/parameter.rb +1161 -0
  179. data/lib/tdriver/util/plugin/abstract.rb +61 -0
  180. data/lib/tdriver/util/plugin/error.rb +0 -0
  181. data/lib/tdriver/util/plugin/loader.rb +28 -0
  182. data/lib/tdriver/util/plugin/service.rb +319 -0
  183. data/lib/tdriver/util/recorder/loader.rb +25 -0
  184. data/lib/tdriver/util/recorder/recorder.rb +72 -0
  185. data/lib/tdriver/util/recorder/scripter.rb +294 -0
  186. data/lib/tdriver/util/statistics/statistics.rb +89 -0
  187. data/lib/tdriver/util/user_data/error.rb +28 -0
  188. data/lib/tdriver/util/user_data/loader.rb +25 -0
  189. data/lib/tdriver/util/user_data/user_data.rb +104 -0
  190. data/lib/tdriver/util/video/camera.rb +67 -0
  191. data/lib/tdriver/util/video/camera_linux.rb +153 -0
  192. data/lib/tdriver/util/video/camera_windows.rb +174 -0
  193. data/lib/tdriver/util/video/loader.rb +31 -0
  194. data/lib/tdriver/util/video/video_utils.rb +139 -0
  195. data/lib/tdriver/util/xml/abstraction.rb +117 -0
  196. data/lib/tdriver/util/xml/attribute.rb +32 -0
  197. data/lib/tdriver/util/xml/builder.rb +53 -0
  198. data/lib/tdriver/util/xml/comment.rb +32 -0
  199. data/lib/tdriver/util/xml/document.rb +32 -0
  200. data/lib/tdriver/util/xml/element.rb +32 -0
  201. data/lib/tdriver/util/xml/error.rb +46 -0
  202. data/lib/tdriver/util/xml/loader.rb +62 -0
  203. data/lib/tdriver/util/xml/nil_node.rb +95 -0
  204. data/lib/tdriver/util/xml/nodeset.rb +32 -0
  205. data/lib/tdriver/util/xml/parsers/libxml/libxml.rb +140 -0
  206. data/lib/tdriver/util/xml/parsers/loader.rb +21 -0
  207. data/lib/tdriver/util/xml/parsers/nokogiri/abstraction.rb +167 -0
  208. data/lib/tdriver/util/xml/parsers/nokogiri/attribute.rb +66 -0
  209. data/lib/tdriver/util/xml/parsers/nokogiri/builder.rb +64 -0
  210. data/lib/tdriver/util/xml/parsers/nokogiri/comment.rb +39 -0
  211. data/lib/tdriver/util/xml/parsers/nokogiri/document.rb +66 -0
  212. data/lib/tdriver/util/xml/parsers/nokogiri/element.rb +39 -0
  213. data/lib/tdriver/util/xml/parsers/nokogiri/loader.rb +58 -0
  214. data/lib/tdriver/util/xml/parsers/nokogiri/node.rb +212 -0
  215. data/lib/tdriver/util/xml/parsers/nokogiri/nodeset.rb +237 -0
  216. data/lib/tdriver/util/xml/parsers/nokogiri/text.rb +39 -0
  217. data/lib/tdriver/util/xml/text.rb +32 -0
  218. data/lib/tdriver/util/xml/xml.rb +332 -0
  219. data/lib/tdriver/verify/verify.rb +2398 -0
  220. data/lib/tdriver/version.rb +21 -0
  221. data/xml/behaviours/generic.xml +530 -0
  222. data/xml/defaults/generic.xml +11 -0
  223. data/xml/defaults/sut_generic.xml +8 -0
  224. data/xml/parameters/tdriver_parameters.xml +23 -0
  225. data/xml/templates/generic.xml +292 -0
  226. metadata +324 -0
@@ -0,0 +1,274 @@
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 Testability Driver.
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 Application < MobyCommand::CommandData
23
+
24
+ attr_reader :command_arguments
25
+
26
+ # TODO: document me
27
+ def initialize( command, arguments = {} )
28
+
29
+ arguments.check_type Hash, "wrong argument type $1 for #{ self.class } arguments (expected $2)"
30
+
31
+ # default values
32
+ arguments.default = nil
33
+
34
+ @command_arguments = arguments
35
+
36
+ @_command = command
37
+
38
+ @_application_name = nil
39
+ @_application_uid = nil
40
+ @_sut = nil
41
+ @_arguments = nil
42
+ @_events_to_listen = nil
43
+ @_signals_to_listen = nil
44
+ @_environment = nil
45
+ @_working_directory = nil
46
+ @_flags = nil
47
+ @_start_command = nil
48
+ @_refresh_args = nil
49
+ @_attribute_csv_string = nil
50
+ @_checksum = nil
51
+
52
+ # store values from arguments - call setter method only when required
53
+ arguments.each_pair{ | key, value |
54
+
55
+ # skip if value is nil (default)
56
+ next if value.nil?
57
+
58
+ case key
59
+
60
+ when :application_name
61
+ name( value )
62
+
63
+ when :application_uid
64
+ uid( value )
65
+
66
+ when :sut
67
+ sut( value )
68
+
69
+ when :arguments
70
+ arguments( value )
71
+
72
+ when :events_to_listen
73
+ events_to_listen( value )
74
+
75
+ when :signals_to_listen
76
+ signals_to_listen( value )
77
+
78
+ when :environment
79
+ environment( value )
80
+
81
+ when :working_directory
82
+ working_directory( value )
83
+
84
+ when :flags
85
+ flags( value )
86
+
87
+ when :start_command
88
+ start_command( value )
89
+
90
+ when :refresh_arguments
91
+ refresh_args( value )
92
+
93
+ when :attribute_filter
94
+ attribute_filter( value )
95
+
96
+ when :checksum
97
+ @_checksum = value
98
+
99
+ else
100
+
101
+ # show warning/exception?
102
+
103
+ end
104
+
105
+ }
106
+
107
+ self
108
+
109
+ end
110
+
111
+ # Store the args for possible future use
112
+ def refresh_args(refresh_args={})
113
+ @_refresh_args = refresh_args
114
+ end
115
+
116
+ def get_refresh_args
117
+ @_refresh_args
118
+ end
119
+
120
+
121
+ # Defines the type of command this Application CommandData object represents
122
+ # == params
123
+ # command_type:: Symbol, defines the command to perform on the application
124
+ # == returns
125
+ # Application:: This CommandData object
126
+ # == raises
127
+ # ArgumentError:: When the supplied command_type is invalid.
128
+ def command( command_type )
129
+
130
+ @_command = command_type
131
+
132
+ self
133
+
134
+ end
135
+
136
+ # Defines the used SUT to be able to access parameters when creating messages
137
+ # == params
138
+ # sut:: SUT, creator of the command.
139
+ # == returns
140
+ # Application:: This CommandData object
141
+ # == raises
142
+ # ArgumentError:: When sut is not nil or a SUT
143
+ def sut( sut )
144
+
145
+ sut.check_type [ MobyBase::SUT, NilClass ], 'wrong argument type $1 for SUT (expected $2)'
146
+ @_sut = sut
147
+ self
148
+
149
+ end
150
+
151
+ # Defines the name of the application this Application CommandData object is associated with
152
+ # == params
153
+ # app_name:: String, name of application to perform this command on
154
+ # == returns
155
+ # Application:: This CommandData object
156
+ # == raises
157
+ # ArgumentError:: When app_name is not nil or a String
158
+ def name( name )
159
+
160
+ name.check_type [ String, NilClass ], 'wrong argument type $1 for application name (expected $2)'
161
+ @_application_name = name
162
+ self
163
+
164
+ end
165
+
166
+ def arguments( arguments )
167
+
168
+ arguments.check_type [ String, NilClass ], 'wrong argument type $1 for application arguments (expected $2)'
169
+ @_arguments = arguments
170
+
171
+ end
172
+
173
+ def flags( flags )
174
+
175
+ flags.check_type [ Hash, NilClass ], 'wrong argument type $1 for application flags (expected $2)'
176
+ @_flags = flags
177
+
178
+ end
179
+
180
+ def environment( env )
181
+
182
+ env.check_type [ String, NilClass ], 'wrong argument type $1 for application environment (expected $2)'
183
+ @_environment = env
184
+
185
+ end
186
+
187
+ def working_directory( dir )
188
+
189
+ dir.check_type [ String, NilClass ], 'wrong argument type $1 for application working directory (expected $2)'
190
+ @_working_directory = dir
191
+
192
+ end
193
+
194
+ def events_to_listen( events )
195
+
196
+ events.check_type [ String, NilClass ], 'wrong argument type $1 for events to be listened (expected $2)'
197
+ @_events_to_listen = events
198
+
199
+ end
200
+
201
+ def signals_to_listen( signals )
202
+
203
+ signals.check_type [ String, NilClass ], 'wrong argument type $1 for signals to be listened (expected $2)'
204
+ @_signals_to_listen = signals
205
+
206
+ end
207
+
208
+ def start_command( start_command )
209
+
210
+ start_command.check_type [ String, NilClass ], 'wrong argument type $1 for application start command (expected $2)'
211
+ @_start_command = start_command
212
+
213
+ end
214
+
215
+ # Defines the uid of the application this Application CommandData object is associated with
216
+ # == params
217
+ # app_uid:: FixNum, uid of application to perform this command on
218
+ # == returns
219
+ # Application:: This CommandData object
220
+ # == raises
221
+ # ArgumentError:: When app_name is not nil or a String
222
+ def uid( app_uid )
223
+
224
+ app_uid.check_type [ Fixnum, String, NilClass ], 'wrong argument type $1 for application UID (expected $2)'
225
+
226
+ @_application_uid = app_uid
227
+ @_application_uid = @_application_uid.to_i unless @_application_uid == nil
228
+ self
229
+
230
+ end
231
+
232
+ def get_command
233
+
234
+ @_command
235
+
236
+ end
237
+
238
+ def get_application
239
+
240
+ @_application_name
241
+
242
+ end
243
+
244
+ def get_uid
245
+
246
+ @_application_uid
247
+
248
+ end
249
+
250
+ def get_flags
251
+
252
+ @_flags
253
+
254
+ end
255
+
256
+ def attribute_filter(attribute_string)
257
+
258
+ @_attribute_csv_string = attribute_string
259
+
260
+ end
261
+
262
+ def get_attribute_filter
263
+
264
+ @_attribute_csv_string
265
+
266
+ end
267
+
268
+ # enable hooking for performance measurement & debug logging
269
+ TDriver::Hooking.hook_methods( self ) if defined?( TDriver::Hooking )
270
+
271
+ end
272
+
273
+ end # MobyCommand
274
+
@@ -0,0 +1,47 @@
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 MobyCommand
23
+
24
+ class Fixture < MobyCommand::CommandData
25
+
26
+ attr_accessor :params
27
+
28
+
29
+ # == description
30
+ # Fixture command holds the required parameters to execute a fixture operation in the target.
31
+ #
32
+ # == arguments
33
+ # params
34
+ # Hash
35
+ # description:
36
+ # Hash for holding the parameters need by the fixture operation.
37
+ # Example: {:application_id => "", :object_id => "", :object_type => "", :name => nil, :command_name => nil, :parameters => {}, :async => false)}
38
+ #
39
+ def initialize(params)
40
+
41
+ @params = params
42
+
43
+ end
44
+
45
+ end # Fixture
46
+
47
+ end # MobyCommand
@@ -0,0 +1,94 @@
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 Testability Driver.
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 KeySequence < MobyCommand::CommandData
23
+
24
+ attr_accessor :id
25
+
26
+ # Constructor to KeySequence
27
+ # == params
28
+ # key_symbol:: (optional) Symbol of key to be added to sequence if given.
29
+ # type_symbol:: (optional) Symbol of keypress type of key if given, otherwise use default.
30
+ # == returns
31
+ # Instance of KeySequence
32
+ def initialize( key_symbol = nil, type_symbol = :ShortPress )
33
+ #TODO: Review comment (OR): @sequence -> @_sequence?
34
+ @sequence = [] # Array.new( 0 )
35
+ #@_sut = sut
36
+ append!( key_symbol, type_symbol ) unless key_symbol.nil?
37
+ end
38
+
39
+ # Function to append a keypress with type to KeySequence.sequence array
40
+ # == params
41
+ # key_symbol:: Symbol of key to be appended to sequence.
42
+ # type_symbol:: (optional) Symbol of keypress type of key if given, otherwise use default.
43
+ # == returns
44
+ # self
45
+ def append!( key_symbol, type_symbol = :ShortPress )
46
+ @sequence.push({:value => key_symbol, :type => type_symbol})
47
+ self
48
+ end
49
+
50
+ # Function to repeat last added keypress in sequence unless count is less than one or keypress sequence is empty
51
+ # == params
52
+ # count:: times of key repeated, default is one
53
+ # == returns
54
+ # self
55
+ # == raises
56
+ # TypeError:: Wrong argument type <class> for times count (expected Fixnum)
57
+ # ArgumentError:: Positive value expected for times count (got <value>)
58
+ # IndexError:: Unable to multiply last given key due to key sequence is empty
59
+ def times!( count = 1 )
60
+
61
+ # verify count argument type
62
+ #raise ArgumentError.new("Fixnum expected as argument") if count.class != Fixnum
63
+ count.check_type( Fixnum, "Wrong argument type $1 for times count (expected $2)" )
64
+
65
+ # verify that count is positive number
66
+ raise ArgumentError.new( "Positive value expected for times count (got #{ count })" ) if count.negative?
67
+
68
+ # verify that @sequence is not empty
69
+ #raise IndexError.new( "Not allowed when empty key sequence" ) if @sequence.size == 0
70
+ raise IndexError.new( "Unable to multiply last given key due to key sequence is empty" ) if @sequence.empty?
71
+
72
+ count.times do | iteration |
73
+
74
+ @sequence.push @sequence.fetch( -1 ) unless iteration == 0
75
+
76
+ end
77
+
78
+ self
79
+
80
+ end
81
+
82
+ # Returns the stored sequence as an Array with Hash elements having :value and :type keys for each press.
83
+ # == returns
84
+ # Array:: Stored key sequence
85
+ def get_sequence
86
+ @sequence
87
+ end
88
+
89
+ # enable hooking for performance measurement & debug logging
90
+ TDriver::Hooking.hook_methods( self ) if defined?( TDriver::Hooking )
91
+
92
+ end # KeySequence
93
+
94
+ end # MobyCommand
@@ -0,0 +1,64 @@
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 Testability Driver.
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 MobyCommand
22
+
23
+ class ScreenCapture < MobyCommand::CommandData
24
+
25
+ attr_accessor(
26
+ :command,
27
+ :image_mime_type,
28
+ :color_depth,
29
+ :redraw
30
+ )
31
+
32
+ # Constructor to ScreenCapture
33
+ # == params
34
+ # attributes:: (optional) Hash of image related attributes
35
+ # == returns
36
+ # Instance of ScreenCapture
37
+ def initialize( attributes = {} )
38
+
39
+ # verify that attributes argument is type of Hash
40
+ attributes.check_type( Hash, "Wrong argument type $1 for screen capture command attributes (expected $2)" )
41
+
42
+ # set default values unless already defined in attributes hash
43
+ attributes.default_values( :type => :Screen, :mime_type => :PNG, :color_depth => :Color4K, :redraw => false )
44
+
45
+ # verify that value of :type is type of Symbol
46
+ ( @command = attributes[ :type ] ).check_type( Symbol, "Wrong argument type $1 for screen capture command type (expected $2)" )
47
+
48
+ # verify that value of :mime_type is type of Symbol
49
+ ( @image_mime_type = attributes[ :mime_type ] ).check_type( Symbol, "Wrong argument type $1 for screen capture command mime type (expected $2)" )
50
+
51
+ # verify that value of :color_depth is type of Symbol
52
+ ( @color_depth = attributes[ :color_depth ] ).check_type( Symbol, "Wrong argument type $1 for screen capture command image color depth type (expected $2)" )
53
+
54
+ # verify that value of :redraw is type of Symbol
55
+ ( @redraw = attributes[ :redraw ] ).check_type( [ TrueClass, FalseClass ], "Wrong argument type $1 for screen capture command redraw flag (expected $2)" )
56
+
57
+ end
58
+
59
+ # enable hooking for performance measurement & debug logging
60
+ TDriver::Hooking.hook_methods( self ) if defined?( TDriver::Hooking )
61
+
62
+ end # ScreenCapture
63
+
64
+ end # MobyCommand