win_gui 0.1.6 → 0.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.
Files changed (169) hide show
  1. data/.gitignore +21 -21
  2. data/HISTORY +7 -0
  3. data/LICENSE +20 -20
  4. data/README.rdoc +77 -114
  5. data/Rakefile +24 -58
  6. data/VERSION +1 -1
  7. data/features/support/env.rb +7 -4
  8. data/features/win_gui.feature +9 -9
  9. data/lib/version.rb +8 -0
  10. data/lib/win_gui/window.rb +78 -69
  11. data/lib/win_gui.rb +25 -3
  12. data/spec/spec.opts +1 -1
  13. data/spec/spec_helper.rb +90 -118
  14. data/spec/win_gui/window_spec.rb +120 -123
  15. data/tasks/common.rake +14 -0
  16. data/tasks/doc.rake +14 -0
  17. data/tasks/gem.rake +39 -0
  18. data/tasks/git.rake +34 -0
  19. data/tasks/spec.rake +19 -0
  20. data/tasks/version.rake +71 -0
  21. metadata +68 -188
  22. data/.document +0 -5
  23. data/book_code/early_success/bundle.rb +0 -34
  24. data/book_code/early_success/english.txt +0 -1
  25. data/book_code/early_success/jruby_basics.rb +0 -47
  26. data/book_code/early_success/windows_basics.rb +0 -97
  27. data/book_code/guessing/locknote.rb +0 -379
  28. data/book_code/guessing/monkeyshines.rb +0 -14
  29. data/book_code/guessing/note.rb +0 -120
  30. data/book_code/guessing/note_spec.rb +0 -175
  31. data/book_code/guessing/replay.rb +0 -21
  32. data/book_code/guessing/seed.rb +0 -9
  33. data/book_code/guessing/spec_helper.rb +0 -69
  34. data/book_code/guessing/windows_gui.rb +0 -247
  35. data/book_code/home_stretch/junquenote.rb +0 -151
  36. data/book_code/home_stretch/locknote.rb +0 -180
  37. data/book_code/home_stretch/note.rb +0 -144
  38. data/book_code/home_stretch/note_spec.rb +0 -191
  39. data/book_code/home_stretch/spec_helper.rb +0 -55
  40. data/book_code/home_stretch/swing_gui.rb +0 -50
  41. data/book_code/home_stretch/windows_gui.rb +0 -232
  42. data/book_code/junquenote/exports.sh +0 -10
  43. data/book_code/junquenote/jruby_mac.sh +0 -10
  44. data/book_code/junquenote/junquenote_app.rb +0 -262
  45. data/book_code/novite/Rakefile +0 -10
  46. data/book_code/novite/app/controllers/application.rb +0 -18
  47. data/book_code/novite/app/controllers/guests_controller.rb +0 -28
  48. data/book_code/novite/app/controllers/parties_controller.rb +0 -77
  49. data/book_code/novite/app/helpers/application_helper.rb +0 -11
  50. data/book_code/novite/app/helpers/guests_helper.rb +0 -10
  51. data/book_code/novite/app/helpers/parties_helper.rb +0 -10
  52. data/book_code/novite/app/models/guest.rb +0 -11
  53. data/book_code/novite/app/models/party.rb +0 -32
  54. data/book_code/novite/app/models/party_mailer.rb +0 -19
  55. data/book_code/novite/app/views/layouts/application.rhtml +0 -44
  56. data/book_code/novite/app/views/parties/new.html.erb +0 -42
  57. data/book_code/novite/app/views/parties/show.html.erb +0 -43
  58. data/book_code/novite/app/views/party_mailer/invite.erb +0 -17
  59. data/book_code/novite/config/boot.rb +0 -117
  60. data/book_code/novite/config/database.yml +0 -19
  61. data/book_code/novite/config/environment.rb +0 -67
  62. data/book_code/novite/config/environments/development.rb +0 -29
  63. data/book_code/novite/config/environments/production.rb +0 -27
  64. data/book_code/novite/config/environments/test.rb +0 -30
  65. data/book_code/novite/config/initializers/inflections.rb +0 -18
  66. data/book_code/novite/config/initializers/mime_types.rb +0 -13
  67. data/book_code/novite/config/routes.rb +0 -47
  68. data/book_code/novite/db/migrate/001_create_parties.rb +0 -26
  69. data/book_code/novite/db/migrate/002_create_guests.rb +0 -23
  70. data/book_code/novite/db/schema.rb +0 -41
  71. data/book_code/novite/log/empty.txt +0 -0
  72. data/book_code/novite/public/.htaccess +0 -40
  73. data/book_code/novite/public/404.html +0 -38
  74. data/book_code/novite/public/422.html +0 -38
  75. data/book_code/novite/public/500.html +0 -38
  76. data/book_code/novite/public/dispatch.cgi +0 -10
  77. data/book_code/novite/public/dispatch.fcgi +0 -24
  78. data/book_code/novite/public/dispatch.rb +0 -18
  79. data/book_code/novite/public/favicon.ico +0 -0
  80. data/book_code/novite/public/images/rails.png +0 -0
  81. data/book_code/novite/public/index.html +0 -285
  82. data/book_code/novite/public/javascripts/application.js +0 -10
  83. data/book_code/novite/public/javascripts/controls.js +0 -971
  84. data/book_code/novite/public/javascripts/dragdrop.js +0 -980
  85. data/book_code/novite/public/javascripts/effects.js +0 -1128
  86. data/book_code/novite/public/javascripts/prototype.js +0 -4233
  87. data/book_code/novite/public/robots.txt +0 -5
  88. data/book_code/novite/script/about +0 -3
  89. data/book_code/novite/script/console +0 -3
  90. data/book_code/novite/script/destroy +0 -3
  91. data/book_code/novite/script/generate +0 -3
  92. data/book_code/novite/script/performance/benchmarker +0 -3
  93. data/book_code/novite/script/performance/profiler +0 -3
  94. data/book_code/novite/script/performance/request +0 -3
  95. data/book_code/novite/script/plugin +0 -3
  96. data/book_code/novite/script/process/inspector +0 -3
  97. data/book_code/novite/script/process/reaper +0 -3
  98. data/book_code/novite/script/process/spawner +0 -3
  99. data/book_code/novite/script/runner +0 -3
  100. data/book_code/novite/script/server +0 -3
  101. data/book_code/novite/test/test_helper.rb +0 -46
  102. data/book_code/one_more_thing/applescript.rb +0 -68
  103. data/book_code/one_more_thing/note_spec.rb +0 -50
  104. data/book_code/one_more_thing/spec_helper.rb +0 -17
  105. data/book_code/one_more_thing/textedit-pure.rb +0 -28
  106. data/book_code/one_more_thing/textedit.applescript +0 -26
  107. data/book_code/one_more_thing/textedit.rb +0 -32
  108. data/book_code/one_more_thing/textnote.rb +0 -87
  109. data/book_code/simplify/junquenote.rb +0 -48
  110. data/book_code/simplify/locknote.rb +0 -46
  111. data/book_code/simplify/note.rb +0 -35
  112. data/book_code/simplify/note_spec.rb +0 -28
  113. data/book_code/simplify/swing_gui.rb +0 -45
  114. data/book_code/simplify/windows_gui.rb +0 -232
  115. data/book_code/simplify/windows_gui_spec.rb +0 -35
  116. data/book_code/story/invite.story +0 -19
  117. data/book_code/story/journal.txt +0 -29
  118. data/book_code/story/novite_stories.rb +0 -156
  119. data/book_code/story/party.rb +0 -149
  120. data/book_code/story/password.rb +0 -61
  121. data/book_code/story/password.story +0 -26
  122. data/book_code/story/rsvp.story +0 -29
  123. data/book_code/tables/TestTime.html +0 -93
  124. data/book_code/tables/TestTimeSample.html +0 -63
  125. data/book_code/tables/calculate_time.rb +0 -39
  126. data/book_code/tables/calculator.rb +0 -108
  127. data/book_code/tables/calculator_actions.rb +0 -27
  128. data/book_code/tables/calculator_spec.rb +0 -47
  129. data/book_code/tables/fit.rb +0 -32
  130. data/book_code/tables/matrix.rb +0 -109
  131. data/book_code/tables/pseudocode.rb +0 -17
  132. data/book_code/tubes/book_selenium.rb +0 -67
  133. data/book_code/tubes/book_watir.rb +0 -60
  134. data/book_code/tubes/dragdrop.html +0 -81
  135. data/book_code/tubes/html_capture.rb +0 -33
  136. data/book_code/tubes/joke_list.rb +0 -67
  137. data/book_code/tubes/list_spec.rb +0 -41
  138. data/book_code/tubes/search_spec.rb +0 -32
  139. data/book_code/tubes/selenium_example.rb +0 -66
  140. data/book_code/tubes/selenium_link.rb +0 -23
  141. data/book_code/tubes/web_server.rb +0 -14
  142. data/book_code/windows/wgui.rb +0 -29
  143. data/book_code/windows/wobj.rb +0 -25
  144. data/book_code/windows/wsh.rb +0 -25
  145. data/book_code/with_rspec/empty_spec.rb +0 -13
  146. data/book_code/with_rspec/junquenote.rb +0 -60
  147. data/book_code/with_rspec/locknote.rb +0 -129
  148. data/book_code/with_rspec/note_spec.rb +0 -32
  149. data/book_code/with_rspec/should_examples.rb +0 -18
  150. data/lib/note/java/jemmy.jar +0 -0
  151. data/lib/note/java/jnote.rb +0 -48
  152. data/lib/note/java/jruby_basics.rb +0 -37
  153. data/lib/note/java/junquenote_app.rb +0 -262
  154. data/lib/note/java/note_spec.rb +0 -20
  155. data/lib/note/win/locknote.rb +0 -19
  156. data/lib/note.rb +0 -15
  157. data/lib/win_gui/constants.rb +0 -82
  158. data/lib/win_gui/def_api.rb +0 -160
  159. data/lib/win_gui/string_extensions.rb +0 -36
  160. data/lib/win_gui/win_gui.rb +0 -437
  161. data/old/windows_basics.rb +0 -80
  162. data/old/wnote.rb +0 -80
  163. data/old/wnote_spec.rb +0 -20
  164. data/spec/note/win/locknote_spec.rb +0 -7
  165. data/spec/test_apps/locknote/LockNote.exe +0 -0
  166. data/spec/win_gui/def_api_spec.rb +0 -339
  167. data/spec/win_gui/string_extensions_spec.rb +0 -61
  168. data/spec/win_gui/win_gui_spec.rb +0 -537
  169. data/win_gui.gemspec +0 -215
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: win_gui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 2
8
+ - 0
9
+ version: 0.2.0
5
10
  platform: ruby
6
11
  authors:
7
12
  - arvicco
@@ -9,40 +14,50 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-02-14 00:00:00 +03:00
17
+ date: 2010-05-15 00:00:00 +04:00
13
18
  default_executable:
14
19
  dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: win32-api
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: 1.4.5
24
- version:
25
20
  - !ruby/object:Gem::Dependency
26
21
  name: rspec
27
- type: :development
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
30
24
  requirements:
31
25
  - - ">="
32
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 1
29
+ - 2
30
+ - 9
33
31
  version: 1.2.9
34
- version:
32
+ type: :development
33
+ version_requirements: *id001
35
34
  - !ruby/object:Gem::Dependency
36
35
  name: cucumber
37
- type: :development
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
40
38
  requirements:
41
39
  - - ">="
42
40
  - !ruby/object:Gem::Version
41
+ segments:
42
+ - 0
43
43
  version: "0"
44
- version:
45
- description: Rubyesque interfaces and wrappers for Win32 API GUI functions
44
+ type: :development
45
+ version_requirements: *id002
46
+ - !ruby/object:Gem::Dependency
47
+ name: win
48
+ prerelease: false
49
+ requirement: &id003 !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ segments:
54
+ - 0
55
+ - 3
56
+ - 1
57
+ version: 0.3.1
58
+ type: :runtime
59
+ version_requirements: *id003
60
+ description: Abstractions/wrappers around GUI-related Win32 API functions
46
61
  email: arvitallian@gmail.com
47
62
  executables: []
48
63
 
@@ -50,201 +65,66 @@ extensions: []
50
65
 
51
66
  extra_rdoc_files:
52
67
  - LICENSE
68
+ - HISTORY
53
69
  - README.rdoc
54
70
  files:
55
- - .document
56
- - .gitignore
57
- - LICENSE
58
- - README.rdoc
59
- - Rakefile
60
- - VERSION
61
- - book_code/early_success/bundle.rb
62
- - book_code/early_success/english.txt
63
- - book_code/early_success/jruby_basics.rb
64
- - book_code/early_success/windows_basics.rb
65
- - book_code/guessing/locknote.rb
66
- - book_code/guessing/monkeyshines.rb
67
- - book_code/guessing/note.rb
68
- - book_code/guessing/note_spec.rb
69
- - book_code/guessing/replay.rb
70
- - book_code/guessing/seed.rb
71
- - book_code/guessing/spec_helper.rb
72
- - book_code/guessing/windows_gui.rb
73
- - book_code/home_stretch/junquenote.rb
74
- - book_code/home_stretch/locknote.rb
75
- - book_code/home_stretch/note.rb
76
- - book_code/home_stretch/note_spec.rb
77
- - book_code/home_stretch/spec_helper.rb
78
- - book_code/home_stretch/swing_gui.rb
79
- - book_code/home_stretch/windows_gui.rb
80
- - book_code/junquenote/exports.sh
81
- - book_code/junquenote/jruby_mac.sh
82
- - book_code/junquenote/junquenote_app.rb
83
- - book_code/novite/Rakefile
84
- - book_code/novite/app/controllers/application.rb
85
- - book_code/novite/app/controllers/guests_controller.rb
86
- - book_code/novite/app/controllers/parties_controller.rb
87
- - book_code/novite/app/helpers/application_helper.rb
88
- - book_code/novite/app/helpers/guests_helper.rb
89
- - book_code/novite/app/helpers/parties_helper.rb
90
- - book_code/novite/app/models/guest.rb
91
- - book_code/novite/app/models/party.rb
92
- - book_code/novite/app/models/party_mailer.rb
93
- - book_code/novite/app/views/layouts/application.rhtml
94
- - book_code/novite/app/views/parties/new.html.erb
95
- - book_code/novite/app/views/parties/show.html.erb
96
- - book_code/novite/app/views/party_mailer/invite.erb
97
- - book_code/novite/config/boot.rb
98
- - book_code/novite/config/database.yml
99
- - book_code/novite/config/environment.rb
100
- - book_code/novite/config/environments/development.rb
101
- - book_code/novite/config/environments/production.rb
102
- - book_code/novite/config/environments/test.rb
103
- - book_code/novite/config/initializers/inflections.rb
104
- - book_code/novite/config/initializers/mime_types.rb
105
- - book_code/novite/config/routes.rb
106
- - book_code/novite/db/migrate/001_create_parties.rb
107
- - book_code/novite/db/migrate/002_create_guests.rb
108
- - book_code/novite/db/schema.rb
109
- - book_code/novite/log/empty.txt
110
- - book_code/novite/public/.htaccess
111
- - book_code/novite/public/404.html
112
- - book_code/novite/public/422.html
113
- - book_code/novite/public/500.html
114
- - book_code/novite/public/dispatch.cgi
115
- - book_code/novite/public/dispatch.fcgi
116
- - book_code/novite/public/dispatch.rb
117
- - book_code/novite/public/favicon.ico
118
- - book_code/novite/public/images/rails.png
119
- - book_code/novite/public/index.html
120
- - book_code/novite/public/javascripts/application.js
121
- - book_code/novite/public/javascripts/controls.js
122
- - book_code/novite/public/javascripts/dragdrop.js
123
- - book_code/novite/public/javascripts/effects.js
124
- - book_code/novite/public/javascripts/prototype.js
125
- - book_code/novite/public/robots.txt
126
- - book_code/novite/script/about
127
- - book_code/novite/script/console
128
- - book_code/novite/script/destroy
129
- - book_code/novite/script/generate
130
- - book_code/novite/script/performance/benchmarker
131
- - book_code/novite/script/performance/profiler
132
- - book_code/novite/script/performance/request
133
- - book_code/novite/script/plugin
134
- - book_code/novite/script/process/inspector
135
- - book_code/novite/script/process/reaper
136
- - book_code/novite/script/process/spawner
137
- - book_code/novite/script/runner
138
- - book_code/novite/script/server
139
- - book_code/novite/test/test_helper.rb
140
- - book_code/one_more_thing/applescript.rb
141
- - book_code/one_more_thing/note_spec.rb
142
- - book_code/one_more_thing/spec_helper.rb
143
- - book_code/one_more_thing/textedit-pure.rb
144
- - book_code/one_more_thing/textedit.applescript
145
- - book_code/one_more_thing/textedit.rb
146
- - book_code/one_more_thing/textnote.rb
147
- - book_code/simplify/junquenote.rb
148
- - book_code/simplify/locknote.rb
149
- - book_code/simplify/note.rb
150
- - book_code/simplify/note_spec.rb
151
- - book_code/simplify/swing_gui.rb
152
- - book_code/simplify/windows_gui.rb
153
- - book_code/simplify/windows_gui_spec.rb
154
- - book_code/story/invite.story
155
- - book_code/story/journal.txt
156
- - book_code/story/novite_stories.rb
157
- - book_code/story/party.rb
158
- - book_code/story/password.rb
159
- - book_code/story/password.story
160
- - book_code/story/rsvp.story
161
- - book_code/tables/TestTime.html
162
- - book_code/tables/TestTimeSample.html
163
- - book_code/tables/calculate_time.rb
164
- - book_code/tables/calculator.rb
165
- - book_code/tables/calculator_actions.rb
166
- - book_code/tables/calculator_spec.rb
167
- - book_code/tables/fit.rb
168
- - book_code/tables/matrix.rb
169
- - book_code/tables/pseudocode.rb
170
- - book_code/tubes/book_selenium.rb
171
- - book_code/tubes/book_watir.rb
172
- - book_code/tubes/dragdrop.html
173
- - book_code/tubes/html_capture.rb
174
- - book_code/tubes/joke_list.rb
175
- - book_code/tubes/list_spec.rb
176
- - book_code/tubes/search_spec.rb
177
- - book_code/tubes/selenium_example.rb
178
- - book_code/tubes/selenium_link.rb
179
- - book_code/tubes/web_server.rb
180
- - book_code/windows/wgui.rb
181
- - book_code/windows/wobj.rb
182
- - book_code/windows/wsh.rb
183
- - book_code/with_rspec/empty_spec.rb
184
- - book_code/with_rspec/junquenote.rb
185
- - book_code/with_rspec/locknote.rb
186
- - book_code/with_rspec/note_spec.rb
187
- - book_code/with_rspec/should_examples.rb
188
- - features/step_definitions/win_gui_steps.rb
189
- - features/support/env.rb
190
- - features/win_gui.feature
191
- - lib/note.rb
192
- - lib/note/java/jemmy.jar
193
- - lib/note/java/jnote.rb
194
- - lib/note/java/jruby_basics.rb
195
- - lib/note/java/junquenote_app.rb
196
- - lib/note/java/note_spec.rb
197
- - lib/note/win/locknote.rb
198
- - lib/win_gui.rb
199
- - lib/win_gui/constants.rb
200
- - lib/win_gui/def_api.rb
201
- - lib/win_gui/string_extensions.rb
202
- - lib/win_gui/win_gui.rb
71
+ - lib/version.rb
203
72
  - lib/win_gui/window.rb
204
- - old/windows_basics.rb
205
- - old/wnote.rb
206
- - old/wnote_spec.rb
207
- - spec/note/win/locknote_spec.rb
73
+ - lib/win_gui.rb
208
74
  - spec/spec.opts
209
75
  - spec/spec_helper.rb
210
- - spec/test_apps/locknote/LockNote.exe
211
- - spec/win_gui/def_api_spec.rb
212
- - spec/win_gui/string_extensions_spec.rb
213
- - spec/win_gui/win_gui_spec.rb
214
76
  - spec/win_gui/window_spec.rb
215
- - win_gui.gemspec
77
+ - features/step_definitions/win_gui_steps.rb
78
+ - features/support/env.rb
79
+ - features/win_gui.feature
80
+ - tasks/common.rake
81
+ - tasks/doc.rake
82
+ - tasks/gem.rake
83
+ - tasks/git.rake
84
+ - tasks/spec.rake
85
+ - tasks/version.rake
86
+ - Rakefile
87
+ - README.rdoc
88
+ - LICENSE
89
+ - VERSION
90
+ - HISTORY
91
+ - .gitignore
216
92
  has_rdoc: true
217
93
  homepage: http://github.com/arvicco/win_gui
218
94
  licenses: []
219
95
 
220
96
  post_install_message:
221
97
  rdoc_options:
222
- - --charset=UTF-8
98
+ - --charset
99
+ - UTF-8
100
+ - --main
101
+ - README.rdoc
102
+ - --title
103
+ - win_gui
223
104
  require_paths:
224
105
  - lib
225
106
  required_ruby_version: !ruby/object:Gem::Requirement
226
107
  requirements:
227
108
  - - ">="
228
109
  - !ruby/object:Gem::Version
110
+ segments:
111
+ - 0
229
112
  version: "0"
230
- version:
231
113
  required_rubygems_version: !ruby/object:Gem::Requirement
232
114
  requirements:
233
115
  - - ">="
234
116
  - !ruby/object:Gem::Version
117
+ segments:
118
+ - 0
235
119
  version: "0"
236
- version:
237
120
  requirements: []
238
121
 
239
- rubyforge_project:
240
- rubygems_version: 1.3.5
122
+ rubyforge_project: ""
123
+ rubygems_version: 1.3.6
241
124
  signing_key:
242
125
  specification_version: 3
243
- summary: Rubyesque interfaces and wrappers for Win32 API GUI functions
126
+ summary: Abstractions/wrappers around GUI-related Win32 API functions
244
127
  test_files:
245
- - spec/note/win/locknote_spec.rb
128
+ - spec/spec.opts
246
129
  - spec/spec_helper.rb
247
- - spec/win_gui/def_api_spec.rb
248
- - spec/win_gui/string_extensions_spec.rb
249
130
  - spec/win_gui/window_spec.rb
250
- - spec/win_gui/win_gui_spec.rb
data/.document DELETED
@@ -1,5 +0,0 @@
1
- README.rdoc
2
- lib/**/*.rb
3
- bin/*
4
- features/**/*.feature
5
- LICENSE
@@ -1,34 +0,0 @@
1
- #---
2
- # Excerpted from "Scripted GUI Testing With Ruby",
3
- # published by The Pragmatic Bookshelf.
4
- # Copyrights apply to this code. It may not be used to create training material,
5
- # courses, books, articles, and the like. Contact us if you are in doubt.
6
- # We make no guarantees that this code is fit for any purpose.
7
- # Visit http://www.pragmaticprogrammer.com/titles/idgtr for more book information.
8
- #---
9
- require 'java'
10
- require 'jemmy.jar'
11
- require 'junquenote_app'
12
-
13
- include_class 'org.netbeans.jemmy.JemmyProperties'
14
- include_class 'org.netbeans.jemmy.TestOut'
15
-
16
- %w(Frame TextArea MenuBar Dialog Button).each do |o|
17
- include_class "org.netbeans.jemmy.operators.J#{o}Operator"
18
- end
19
-
20
- JemmyProperties.set_current_timeout 'DialogWaiter.WaitDialogTimeout', 3000
21
- JemmyProperties.set_current_output TestOut.get_null_output
22
-
23
- JunqueNoteApp.new
24
- main_window = JFrameOperator.new 'JunqueNote'
25
- menu = JMenuBarOperator.new main_window
26
-
27
-
28
- include_class 'org.netbeans.jemmy.Bundle'
29
-
30
- bundle = Bundle.new
31
- bundle.load_from_file 'english.txt'
32
- exit_menu = bundle.get_resource 'junquenote.exit_menu'
33
-
34
- menu.push_menu_no_block exit_menu
@@ -1 +0,0 @@
1
- junquenote.exit_menu=File|Exit
@@ -1,47 +0,0 @@
1
- #---
2
- # Excerpted from "Scripted GUI Testing With Ruby",
3
- # published by The Pragmatic Bookshelf.
4
- # Copyrights apply to this code. It may not be used to create training material,
5
- # courses, books, articles, and the like. Contact us if you are in doubt.
6
- # We make no guarantees that this code is fit for any purpose.
7
- # Visit http://www.pragmaticprogrammer.com/titles/idgtr for more book information.
8
- #---
9
-
10
- require 'java'
11
- require 'jemmy.jar'
12
- require 'junquenote_app'
13
-
14
- include_class 'org.netbeans.jemmy.JemmyProperties'
15
- include_class 'org.netbeans.jemmy.TestOut'
16
-
17
- %w(Frame TextArea MenuBar Dialog Button).each do |o| #(1)
18
- include_class "org.netbeans.jemmy.operators.J#{o}Operator"
19
- end
20
-
21
- JemmyProperties.set_current_timeout 'DialogWaiter.WaitDialogTimeout', 3000 #(2)
22
- JemmyProperties.set_current_output TestOut.get_null_output #(3)
23
-
24
- JunqueNoteApp.new
25
- main_window = JFrameOperator.new 'JunqueNote'
26
-
27
- puts "The main window's object ID is #{main_window.object_id}."
28
-
29
-
30
-
31
-
32
- edit = JTextAreaOperator.new main_window #(4)
33
- edit.type_text "this is some text" #(5)
34
-
35
-
36
-
37
-
38
- menu = JMenuBarOperator.new main_window
39
- menu.push_menu_no_block 'File|Exit', '|'
40
-
41
-
42
-
43
-
44
- dialog = JDialogOperator.new "Quittin' time"
45
- button = JButtonOperator.new dialog, "No"
46
- button.push
47
-
@@ -1,97 +0,0 @@
1
- #---
2
- # Excerpted from "Scripted GUI Testing With Ruby",
3
- # published by The Pragmatic Bookshelf.
4
- # Copyrights apply to this code. It may not be used to create training material,
5
- # courses, books, articles, and the like. Contact us if you are in doubt.
6
- # We make no guarantees that this code is fit for any purpose.
7
- # Visit http://www.pragmaticprogrammer.com/titles/idgtr for more book information.
8
- #---
9
-
10
- require 'Win32API'
11
-
12
- def user32(name, param_types, return_value) #(1)
13
- Win32API.new 'user32', name, param_types, return_value
14
- end
15
-
16
- find_window = user32 'FindWindow', ['P', 'P'], 'L'
17
-
18
- system 'start "" "C:/LockNote/LockNote.exe"'
19
-
20
- sleep 0.2 while (main_window = find_window.call \
21
- nil, 'LockNote - Steganos LockNote') <= 0 #(2)
22
-
23
- puts "The main window's handle is #{main_window}."
24
-
25
-
26
-
27
-
28
- keybd_event = user32 'keybd_event', ['I', 'I', 'L', 'L'], 'V'
29
-
30
- KEYEVENTF_KEYDOWN = 0
31
- KEYEVENTF_KEYUP = 2
32
-
33
-
34
-
35
-
36
- "this is some text".upcase.each_byte do |b| #(3)
37
- keybd_event.call b, 0, KEYEVENTF_KEYDOWN, 0
38
- sleep 0.05
39
- keybd_event.call b, 0, KEYEVENTF_KEYUP, 0
40
- sleep 0.05
41
- end
42
-
43
-
44
-
45
-
46
- post_message = user32 'PostMessage', ['L', 'L', 'L', 'L'], 'L'
47
-
48
- WM_SYSCOMMAND = 0x0112
49
- SC_CLOSE = 0xF060
50
-
51
- post_message.call main_window, WM_SYSCOMMAND, SC_CLOSE, 0
52
-
53
-
54
-
55
- # You might need a slight delay here.
56
- sleep 0.5
57
-
58
-
59
-
60
- get_dlg_item = user32 'GetDlgItem', ['L', 'L'], 'L'
61
-
62
- dialog = timeout(3) do #(4)
63
- sleep 0.2 while (h = find_window.call \
64
- nil, 'Steganos LockNote') <= 0; h #(5)
65
- end
66
-
67
- IDNO = 7
68
- button = get_dlg_item.call dialog, IDNO
69
-
70
-
71
-
72
-
73
- get_window_rect = user32 'GetWindowRect', ['L', 'P'], 'I'
74
-
75
- rectangle = [0, 0, 0, 0].pack 'L*'
76
- get_window_rect.call button, rectangle
77
- left, top, right, bottom = rectangle.unpack 'L*'
78
-
79
- puts "The No button is #{right - left} pixels wide." #(6)
80
-
81
-
82
-
83
-
84
- set_cursor_pos = user32 'SetCursorPos', ['L', 'L'], 'I'
85
-
86
- mouse_event = user32 'mouse_event', ['L', 'L', 'L', 'L', 'L'], 'V'
87
-
88
- MOUSEEVENTF_LEFTDOWN = 0x0002
89
- MOUSEEVENTF_LEFTUP = 0x0004
90
-
91
- center = [(left + right) / 2, (top + bottom) / 2]
92
-
93
- set_cursor_pos.call *center #(7)
94
-
95
- mouse_event.call MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
96
- mouse_event.call MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
97
-