fletcherm-culerity 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. data/.gitignore +6 -0
  2. data/CHANGES.md +7 -0
  3. data/MIT-LICENSE +20 -0
  4. data/README.md +102 -0
  5. data/Rakefile +47 -0
  6. data/VERSION.yml +5 -0
  7. data/culerity.gemspec +165 -0
  8. data/features/fixtures/jquery +4376 -0
  9. data/features/fixtures/sample_feature +14 -0
  10. data/features/installing_culerity.feature +36 -0
  11. data/features/running_cucumber_without_explicitly_running_external_services.feature +23 -0
  12. data/features/step_definitions/common_steps.rb +175 -0
  13. data/features/step_definitions/culerity_setup_steps.rb +7 -0
  14. data/features/step_definitions/jruby_steps.rb +11 -0
  15. data/features/step_definitions/rails_setup_steps.rb +36 -0
  16. data/features/support/common.rb +32 -0
  17. data/features/support/env.rb +24 -0
  18. data/features/support/matchers.rb +11 -0
  19. data/init.rb +1 -0
  20. data/lib/culerity.rb +44 -0
  21. data/lib/culerity/celerity_server.rb +81 -0
  22. data/lib/culerity/jruby_runner.rb +13 -0
  23. data/lib/culerity/remote_browser_proxy.rb +58 -0
  24. data/lib/culerity/remote_object_proxy.rb +76 -0
  25. data/rails/init.rb +1 -0
  26. data/rails_generators/culerity/culerity_generator.rb +28 -0
  27. data/rails_generators/culerity/templates/config/environments/culerity_continuousintegration.rb +28 -0
  28. data/rails_generators/culerity/templates/config/environments/culerity_development.rb +17 -0
  29. data/rails_generators/culerity/templates/features/step_definitions/culerity_steps.rb +109 -0
  30. data/rails_generators/culerity/templates/features/support/env.rb +9 -0
  31. data/rails_generators/culerity/templates/lib/tasks/culerity.rake +38 -0
  32. data/rails_generators/culerity/templates/public/javascripts/culerity.js +27 -0
  33. data/script/console +10 -0
  34. data/script/destroy +14 -0
  35. data/script/generate +14 -0
  36. data/spec/celerity_server_spec.rb +106 -0
  37. data/spec/culerity_spec.rb +33 -0
  38. data/spec/jruby_runner_spec.rb +12 -0
  39. data/spec/remote_browser_proxy_spec.rb +62 -0
  40. data/spec/remote_object_proxy_spec.rb +63 -0
  41. data/spec/spec_helper.rb +3 -0
  42. data/vendor/gems/celerity-0.7.6/HISTORY +111 -0
  43. data/vendor/gems/celerity-0.7.6/LICENSE +621 -0
  44. data/vendor/gems/celerity-0.7.6/README.rdoc +80 -0
  45. data/vendor/gems/celerity-0.7.6/Rakefile +11 -0
  46. data/vendor/gems/celerity-0.7.6/VERSION.yml +5 -0
  47. data/vendor/gems/celerity-0.7.6/celerity.gemspec +120 -0
  48. data/vendor/gems/celerity-0.7.6/lib/celerity.rb +77 -0
  49. data/vendor/gems/celerity-0.7.6/lib/celerity/browser.rb +893 -0
  50. data/vendor/gems/celerity-0.7.6/lib/celerity/clickable_element.rb +73 -0
  51. data/vendor/gems/celerity-0.7.6/lib/celerity/collections.rb +156 -0
  52. data/vendor/gems/celerity-0.7.6/lib/celerity/container.rb +767 -0
  53. data/vendor/gems/celerity-0.7.6/lib/celerity/default_viewer.rb +14 -0
  54. data/vendor/gems/celerity-0.7.6/lib/celerity/disabled_element.rb +40 -0
  55. data/vendor/gems/celerity-0.7.6/lib/celerity/element.rb +298 -0
  56. data/vendor/gems/celerity-0.7.6/lib/celerity/element_collection.rb +107 -0
  57. data/vendor/gems/celerity-0.7.6/lib/celerity/element_locator.rb +159 -0
  58. data/vendor/gems/celerity-0.7.6/lib/celerity/elements/button.rb +54 -0
  59. data/vendor/gems/celerity-0.7.6/lib/celerity/elements/file_field.rb +29 -0
  60. data/vendor/gems/celerity-0.7.6/lib/celerity/elements/form.rb +33 -0
  61. data/vendor/gems/celerity-0.7.6/lib/celerity/elements/frame.rb +86 -0
  62. data/vendor/gems/celerity-0.7.6/lib/celerity/elements/image.rb +89 -0
  63. data/vendor/gems/celerity-0.7.6/lib/celerity/elements/label.rb +16 -0
  64. data/vendor/gems/celerity-0.7.6/lib/celerity/elements/link.rb +43 -0
  65. data/vendor/gems/celerity-0.7.6/lib/celerity/elements/meta.rb +14 -0
  66. data/vendor/gems/celerity-0.7.6/lib/celerity/elements/non_control_elements.rb +116 -0
  67. data/vendor/gems/celerity-0.7.6/lib/celerity/elements/option.rb +38 -0
  68. data/vendor/gems/celerity-0.7.6/lib/celerity/elements/radio_check.rb +114 -0
  69. data/vendor/gems/celerity-0.7.6/lib/celerity/elements/select_list.rb +147 -0
  70. data/vendor/gems/celerity-0.7.6/lib/celerity/elements/table.rb +153 -0
  71. data/vendor/gems/celerity-0.7.6/lib/celerity/elements/table_cell.rb +36 -0
  72. data/vendor/gems/celerity-0.7.6/lib/celerity/elements/table_elements.rb +42 -0
  73. data/vendor/gems/celerity-0.7.6/lib/celerity/elements/table_row.rb +49 -0
  74. data/vendor/gems/celerity-0.7.6/lib/celerity/elements/text_field.rb +168 -0
  75. data/vendor/gems/celerity-0.7.6/lib/celerity/exception.rb +83 -0
  76. data/vendor/gems/celerity-0.7.6/lib/celerity/htmlunit.rb +64 -0
  77. data/vendor/gems/celerity-0.7.6/lib/celerity/htmlunit/commons-codec-1.4.jar +0 -0
  78. data/vendor/gems/celerity-0.7.6/lib/celerity/htmlunit/commons-collections-3.2.1.jar +0 -0
  79. data/vendor/gems/celerity-0.7.6/lib/celerity/htmlunit/commons-httpclient-3.1.jar +0 -0
  80. data/vendor/gems/celerity-0.7.6/lib/celerity/htmlunit/commons-io-1.4.jar +0 -0
  81. data/vendor/gems/celerity-0.7.6/lib/celerity/htmlunit/commons-lang-2.4.jar +0 -0
  82. data/vendor/gems/celerity-0.7.6/lib/celerity/htmlunit/commons-logging-1.1.1.jar +0 -0
  83. data/vendor/gems/celerity-0.7.6/lib/celerity/htmlunit/cssparser-0.9.5.jar +0 -0
  84. data/vendor/gems/celerity-0.7.6/lib/celerity/htmlunit/htmlunit-2.7-SNAPSHOT.jar +0 -0
  85. data/vendor/gems/celerity-0.7.6/lib/celerity/htmlunit/htmlunit-core-js-2.7-SNAPSHOT.jar +0 -0
  86. data/vendor/gems/celerity-0.7.6/lib/celerity/htmlunit/nekohtml-1.9.14-20091130.152932-3.jar +0 -0
  87. data/vendor/gems/celerity-0.7.6/lib/celerity/htmlunit/sac-1.3.jar +0 -0
  88. data/vendor/gems/celerity-0.7.6/lib/celerity/htmlunit/serializer-2.7.1.jar +0 -0
  89. data/vendor/gems/celerity-0.7.6/lib/celerity/htmlunit/xalan-2.7.1.jar +0 -0
  90. data/vendor/gems/celerity-0.7.6/lib/celerity/htmlunit/xercesImpl-2.9.1.jar +0 -0
  91. data/vendor/gems/celerity-0.7.6/lib/celerity/htmlunit/xml-apis-1.3.04.jar +0 -0
  92. data/vendor/gems/celerity-0.7.6/lib/celerity/identifier.rb +28 -0
  93. data/vendor/gems/celerity-0.7.6/lib/celerity/ignoring_web_connection.rb +15 -0
  94. data/vendor/gems/celerity-0.7.6/lib/celerity/input_element.rb +25 -0
  95. data/vendor/gems/celerity-0.7.6/lib/celerity/javascript_debugger.rb +32 -0
  96. data/vendor/gems/celerity-0.7.6/lib/celerity/listener.rb +143 -0
  97. data/vendor/gems/celerity-0.7.6/lib/celerity/resources/no_viewer.png +0 -0
  98. data/vendor/gems/celerity-0.7.6/lib/celerity/short_inspect.rb +20 -0
  99. data/vendor/gems/celerity-0.7.6/lib/celerity/util.rb +126 -0
  100. data/vendor/gems/celerity-0.7.6/lib/celerity/version.rb +3 -0
  101. data/vendor/gems/celerity-0.7.6/lib/celerity/viewer_connection.rb +89 -0
  102. data/vendor/gems/celerity-0.7.6/lib/celerity/watir_compatibility.rb +70 -0
  103. data/vendor/gems/celerity-0.7.6/lib/celerity/xpath_support.rb +48 -0
  104. data/vendor/gems/celerity-0.7.6/tasks/benchmark.rake +4 -0
  105. data/vendor/gems/celerity-0.7.6/tasks/check.rake +24 -0
  106. data/vendor/gems/celerity-0.7.6/tasks/clean.rake +3 -0
  107. data/vendor/gems/celerity-0.7.6/tasks/fix.rake +25 -0
  108. data/vendor/gems/celerity-0.7.6/tasks/jar.rake +55 -0
  109. data/vendor/gems/celerity-0.7.6/tasks/jeweler.rake +26 -0
  110. data/vendor/gems/celerity-0.7.6/tasks/rdoc.rake +4 -0
  111. data/vendor/gems/celerity-0.7.6/tasks/snapshot.rake +22 -0
  112. data/vendor/gems/celerity-0.7.6/tasks/spec.rake +26 -0
  113. data/vendor/gems/celerity-0.7.6/tasks/website.rake +10 -0
  114. data/vendor/gems/celerity-0.7.6/tasks/yard.rake +16 -0
  115. data/vendor/jruby/jruby-complete-1.4.0.jar +0 -0
  116. metadata +194 -0
@@ -0,0 +1,73 @@
1
+ module Celerity
2
+ module ClickableElement
3
+
4
+ #
5
+ # click the element
6
+ #
7
+
8
+ def click
9
+ assert_exists_and_enabled
10
+ rescue_status_code_exception { @object.click }
11
+ end
12
+
13
+ #
14
+ # double click the element (Celerity only)
15
+ #
16
+
17
+ def double_click
18
+ assert_exists_and_enabled
19
+ rescue_status_code_exception { @object.dblClick }
20
+ end
21
+
22
+ #
23
+ # right click the element (Celerity only)
24
+ #
25
+
26
+ def right_click
27
+ assert_exists_and_enabled
28
+ rescue_status_code_exception { @object.rightClick }
29
+ end
30
+
31
+ #
32
+ # Click the element and return a new Browser instance with the resulting page.
33
+ # This is useful for elements that trigger popups when clicked.
34
+ #
35
+ # @return [Celerity::Browser]
36
+ #
37
+
38
+ def click_and_attach
39
+ assert_exists_and_enabled
40
+ browser = Browser.new(@browser.options.dup)
41
+ browser.webclient.set_cookie_manager(
42
+ @browser.webclient.get_cookie_manager
43
+ ) # hirobumi: we do want cookies as well.
44
+
45
+ @browser.disable_event_listener do
46
+ rescue_status_code_exception { browser.page = @object.click }
47
+ end
48
+
49
+ browser
50
+ end
51
+
52
+ #
53
+ # Click the element and just return the content as IO. Current page stays unchanged.
54
+ # This can be used to download content that normally isn't rendered in a browser.
55
+ #
56
+ # @return [IO]
57
+ #
58
+
59
+ def download
60
+ assert_exists_and_enabled
61
+ @browser.disable_event_listener do
62
+ @object.click.getWebResponse.getContentAsStream.to_io
63
+ end
64
+ end
65
+
66
+ private
67
+
68
+ def assert_exists_and_enabled
69
+ assert_exists
70
+ assert_enabled if respond_to?(:assert_enabled)
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,156 @@
1
+ module Celerity
2
+
3
+ class Frames < ElementCollection
4
+ def element_class; Frame; end
5
+ end
6
+
7
+ class Buttons < ElementCollection
8
+ def element_class; Button; end
9
+ end
10
+
11
+ class FileFields < ElementCollection
12
+ def element_class; FileField; end
13
+ end
14
+
15
+ class CheckBoxes < ElementCollection
16
+ def element_class; CheckBox; end
17
+ end
18
+
19
+ class Radios < ElementCollection
20
+ def element_class; Radio; end
21
+ end
22
+
23
+ class SelectLists < ElementCollection
24
+ def element_class; SelectList; end
25
+ end
26
+
27
+ class Links < ElementCollection
28
+ def element_class; Link; end
29
+ end
30
+
31
+ class Uls < ElementCollection
32
+ def element_class; Ul; end
33
+ end
34
+
35
+ class Ols < ElementCollection
36
+ def element_class; Ol; end
37
+ end
38
+
39
+ class Lis < ElementCollection
40
+ def element_class; Li; end
41
+ end
42
+
43
+ class Dds < ElementCollection
44
+ def element_class; Dd; end
45
+ end
46
+
47
+ class Dls < ElementCollection
48
+ def element_class; Dl; end
49
+ end
50
+
51
+ class Dts < ElementCollection
52
+ def element_class; Dt; end
53
+ end
54
+
55
+ class Ems < ElementCollection
56
+ def element_class; Em; end
57
+ end
58
+
59
+ class Maps < ElementCollection
60
+ def element_class; Map; end
61
+ end
62
+
63
+ class Areas < ElementCollection
64
+ def element_class; Area; end
65
+ end
66
+
67
+ class Images < ElementCollection
68
+ def element_class; Image; end
69
+ end
70
+
71
+ class TextFields < ElementCollection
72
+ def element_class; TextField; end
73
+ end
74
+
75
+ class Hiddens < ElementCollection
76
+ def element_class; Hidden; end
77
+ end
78
+
79
+ class Tables < ElementCollection
80
+ def element_class; Table; end
81
+ end
82
+
83
+ class TableHeaders < ElementCollection
84
+ def element_class; TableHeader; end
85
+ end
86
+ class TableBodies < ElementCollection
87
+ def element_class; TableBody; end
88
+ end
89
+ class TableFooters < ElementCollection
90
+ def element_class; TableFooter; end
91
+ end
92
+
93
+ class TableRows < ElementCollection
94
+ def element_class; TableRow; end
95
+ end
96
+
97
+ class TableCells < ElementCollection
98
+ def element_class; TableCell; end
99
+ end
100
+
101
+ class Labels < ElementCollection
102
+ def element_class; Label; end
103
+ end
104
+
105
+ class Pres < ElementCollection
106
+ def element_class; Pre; end
107
+ end
108
+
109
+ class Ps < ElementCollection
110
+ def element_class; P; end
111
+ end
112
+
113
+ class Spans < ElementCollection
114
+ def element_class; Span; end
115
+ end
116
+
117
+ class Strongs < ElementCollection
118
+ def element_class; Strong; end
119
+ end
120
+
121
+ class Divs < ElementCollection
122
+ def element_class; Div; end
123
+ end
124
+
125
+ class Forms < ElementCollection
126
+ def element_class; Form; end
127
+ end
128
+
129
+ class Options < ElementCollection
130
+ def element_class; Option; end
131
+ end
132
+
133
+ class Metas < ElementCollection
134
+ def element_class; Meta; end
135
+ end
136
+
137
+ class H1s < ElementCollection
138
+ def element_class; H1; end
139
+ end
140
+ class H2s < ElementCollection
141
+ def element_class; H2; end
142
+ end
143
+ class H3s < ElementCollection
144
+ def element_class; H3; end
145
+ end
146
+ class H4s < ElementCollection
147
+ def element_class; H4; end
148
+ end
149
+ class H5s < ElementCollection
150
+ def element_class; H5; end
151
+ end
152
+ class H6s < ElementCollection
153
+ def element_class; H6; end
154
+ end
155
+
156
+ end
@@ -0,0 +1,767 @@
1
+ module Celerity
2
+
3
+ #
4
+ # This class contains methods for accessing elements inside a container,
5
+ # usually the Browser object, meaning the current page.
6
+ # The most common syntax is
7
+ # browser.elem(:attribute, 'value')
8
+ #
9
+ # Note that the element is located lazily, so no exceptions will be raised
10
+ # if the element doesn't exist until you call a method on the resulting object.
11
+ # To do this you would normally use Element#exists? or an action method,
12
+ # like ClickableElement#click.
13
+ # You can also pass in a hash:
14
+ #
15
+ # browser.link(:index => 1).click
16
+ #
17
+ # All elements support multiple attributes identification using the
18
+ # hash syntax (though this might not always be compatible with Watir):
19
+ #
20
+ # browser.span(:class_name => 'product', :index => 5).text
21
+ #
22
+ # Checkboxes and radio buttons support a special three-argument syntax:
23
+ #
24
+ # browser.check_box(:name, 'a_name', '1234').set
25
+ #
26
+ # You can also get all the elements of a certain type by using the plural form (@see Celerity::ElementCollection):
27
+ #
28
+ # browser.links # => #<Celerity::Links:0x7a1c2da2 ...>
29
+ #
30
+
31
+ module Container
32
+ include Celerity::Exception
33
+ include Celerity::ShortInspect
34
+
35
+ # Points back to the Browser instance that contains this element
36
+ attr_reader :browser
37
+
38
+ #
39
+ # Check if the element contains the given text.
40
+ #
41
+ # @param [String, Regexp] expected_text The text to look for.
42
+ # @return [Fixnum, nil] The index of the matched text, or nil if it doesn't match.
43
+ #
44
+
45
+ def contains_text(expected_text)
46
+ assert_exists
47
+ return nil unless respond_to? :text
48
+
49
+ case expected_text
50
+ when Regexp
51
+ text() =~ expected_text
52
+ when String
53
+ text().index(expected_text)
54
+ else
55
+ raise TypeError, "expected String or Regexp, got #{expected_text.inspect}:#{expected_text.class}"
56
+ end
57
+ end
58
+
59
+ #
60
+ # Override inspect for readability
61
+ #
62
+
63
+ def inspect
64
+ short_inspect :include => %w[@conditions @object]
65
+ end
66
+
67
+ #
68
+ # Used internally to update the container object.
69
+ # @api private
70
+ #
71
+
72
+ def container=(container)
73
+ @container = container
74
+ @browser = container.browser
75
+ container
76
+ end
77
+
78
+ #--
79
+ # below methods sorted alphabetically
80
+ #++
81
+
82
+ #
83
+ # @return [Celerity::Area]
84
+ #
85
+
86
+ def area(*args)
87
+ Area.new(self, *args)
88
+ end
89
+
90
+ #
91
+ # @return [Celerity::Areas]
92
+ #
93
+
94
+ def areas
95
+ Areas.new(self)
96
+ end
97
+
98
+ #
99
+ # @return [Celerity::Button]
100
+ #
101
+
102
+ def button(*args)
103
+ Button.new(self, *args)
104
+ end
105
+
106
+ #
107
+ # @return [Celerity::Buttons]
108
+ #
109
+
110
+ def buttons
111
+ Buttons.new(self)
112
+ end
113
+
114
+ #
115
+ # @return [Celerity::TableCell]
116
+ #
117
+
118
+ def cell(*args)
119
+ TableCell.new(self, *args)
120
+ end
121
+ alias_method :td, :cell
122
+
123
+ #
124
+ # @return [Celerity::TableCells]
125
+ #
126
+
127
+ def cells
128
+ TableCells.new(self)
129
+ end
130
+ alias_method :tds, :cells
131
+
132
+ #
133
+ # Since finding checkboxes by value is very common, you can use this shorthand:
134
+ #
135
+ # browser.check_box(:name, 'a_name', '1234').set
136
+ #
137
+ # or
138
+ #
139
+ # browser.check_box(:name => 'a_name', :value => '1234').set
140
+ #
141
+ # @return [Celerity::CheckBox]
142
+ #
143
+
144
+ def check_box(*args)
145
+ CheckBox.new(self, *args)
146
+ end
147
+
148
+ #
149
+ # @return [Celerity::CheckBoxes]
150
+ #
151
+
152
+ def checkboxes
153
+ CheckBoxes.new(self)
154
+ end
155
+
156
+ #
157
+ # @return [Celerity::Dd]
158
+ #
159
+
160
+ def dd(*args)
161
+ Dd.new(self, *args)
162
+ end
163
+
164
+ #
165
+ # @return [Celerity::Dds]
166
+ #
167
+
168
+ def dds
169
+ Dds.new(self)
170
+ end
171
+
172
+ #
173
+ # @return [Celerity::Div]
174
+ #
175
+
176
+ def div(*args)
177
+ Div.new(self, *args)
178
+ end
179
+
180
+ #
181
+ # @return [Celerity::Divs]
182
+ #
183
+
184
+ def divs
185
+ Divs.new(self)
186
+ end
187
+
188
+ #
189
+ # @return [Celerity::Dl]
190
+ #
191
+
192
+ def dl(*args)
193
+ Dl.new(self, *args)
194
+ end
195
+
196
+ #
197
+ # @return [Celerity::Dls]
198
+ #
199
+
200
+ def dls
201
+ Dls.new(self)
202
+ end
203
+
204
+ #
205
+ # @return [Celerity::Dt]
206
+ #
207
+
208
+ def dt(*args)
209
+ Dt.new(self, *args)
210
+ end
211
+
212
+ #
213
+ # @return [Celerity::Dts]
214
+ #
215
+
216
+ def dts
217
+ Dts.new(self)
218
+ end
219
+
220
+ #
221
+ # @return [Celerity::Em]
222
+ #
223
+
224
+ def em(*args)
225
+ Em.new(self, *args)
226
+ end
227
+
228
+ #
229
+ # @return [Celerity::Ems]
230
+ #
231
+
232
+ def ems
233
+ Ems.new(self)
234
+ end
235
+
236
+ #
237
+ # @return [Celerity::FileField]
238
+ #
239
+
240
+ def file_field(*args)
241
+ FileField.new(self, *args)
242
+ end
243
+
244
+ #
245
+ # @return [Celerity::FileFields]
246
+ #
247
+
248
+ def file_fields
249
+ FileFields.new(self)
250
+ end
251
+
252
+ #
253
+ # @return [Celerity::Form]
254
+ #
255
+
256
+ def form(*args)
257
+ Form.new(self, *args)
258
+ end
259
+
260
+ #
261
+ # @return [Celerity::Forms]
262
+ #
263
+
264
+ def forms
265
+ Forms.new(self)
266
+ end
267
+
268
+ #
269
+ # @return [Celerity::Frame]
270
+ #
271
+
272
+ def frame(*args)
273
+ Frame.new(self, *args)
274
+ end
275
+
276
+ #
277
+ # @return [Celerity::Frames]
278
+ #
279
+
280
+ def frames
281
+ Frames.new(self)
282
+ end
283
+
284
+ #
285
+ # @return [Celerity::H1]
286
+ #
287
+
288
+ def h1(*args)
289
+ H1.new(self, *args)
290
+ end
291
+
292
+ #
293
+ # @return [Celerity::H1s]
294
+ #
295
+
296
+ def h1s
297
+ H1s.new(self)
298
+ end
299
+
300
+ #
301
+ # @return [Celerity::H2]
302
+ #
303
+
304
+ def h2(*args)
305
+ H2.new(self, *args)
306
+ end
307
+
308
+ #
309
+ # @return [Celerity::H2s]
310
+ #
311
+
312
+ def h2s
313
+ H2s.new(self)
314
+ end
315
+
316
+ #
317
+ # @return [Celerity::H3]
318
+ #
319
+
320
+ def h3(*args)
321
+ H3.new(self, *args)
322
+ end
323
+
324
+ #
325
+ # @return [Celerity::H3s]
326
+ #
327
+
328
+ def h3s
329
+ H3s.new(self)
330
+ end
331
+
332
+ #
333
+ # @return [Celerity::H4]
334
+ #
335
+
336
+ def h4(*args)
337
+ H4.new(self, *args)
338
+ end
339
+
340
+ #
341
+ # @return [Celerity::H4s]
342
+ #
343
+
344
+ def h4s
345
+ H4s.new(self)
346
+ end
347
+
348
+ #
349
+ # @return [Celerity::H5]
350
+ #
351
+
352
+ def h5(*args)
353
+ H5.new(self, *args)
354
+ end
355
+
356
+ #
357
+ # @return [Celerity::H5s]
358
+ #
359
+
360
+ def h5s
361
+ H5s.new(self)
362
+ end
363
+
364
+ #
365
+ # @return [Celerity::H6]
366
+ #
367
+
368
+ def h6(*args)
369
+ H6.new(self, *args)
370
+ end
371
+
372
+ #
373
+ # @return [Celerity::H6s]
374
+ #
375
+
376
+ def h6s
377
+ H6s.new(self)
378
+ end
379
+
380
+ #
381
+ # @return [Celerity::Hidden]
382
+ #
383
+
384
+ def hidden(*args)
385
+ Hidden.new(self, *args)
386
+ end
387
+
388
+ #
389
+ # @return [Celerity::Hiddens]
390
+ #
391
+
392
+ def hiddens
393
+ Hiddens.new(self)
394
+ end
395
+
396
+ #
397
+ # @return [Celerity::Image]
398
+ #
399
+
400
+ def image(*args)
401
+ Image.new(self, *args)
402
+ end
403
+
404
+ #
405
+ # @return [Celerity::Images]
406
+ #
407
+
408
+ def images
409
+ Images.new(self)
410
+ end
411
+
412
+ #
413
+ # @return [Celerity::Label]
414
+ #
415
+
416
+ def label(*args)
417
+ Label.new(self, *args)
418
+ end
419
+
420
+ #
421
+ # @return [Celerity::Labels]
422
+ #
423
+
424
+ def labels
425
+ Labels.new(self)
426
+ end
427
+
428
+ #
429
+ # @return [Celerity::Li]
430
+ #
431
+
432
+ def li(*args)
433
+ Li.new(self, *args)
434
+ end
435
+
436
+ #
437
+ # @return [Celerity::Lis]
438
+ #
439
+
440
+ def lis
441
+ Lis.new(self)
442
+ end
443
+
444
+ #
445
+ # @return [Celerity::Link]
446
+ #
447
+
448
+ def link(*args)
449
+ Link.new(self, *args)
450
+ end
451
+
452
+ #
453
+ # @return [Celerity::Links]
454
+ #
455
+
456
+ def links
457
+ Links.new(self)
458
+ end
459
+
460
+ #
461
+ # @return [Celerity::Map]
462
+ #
463
+
464
+ def map(*args)
465
+ Map.new(self, *args)
466
+ end
467
+
468
+ #
469
+ # @return [Celerity::Maps]
470
+ #
471
+
472
+ def maps
473
+ Maps.new(self)
474
+ end
475
+
476
+ #
477
+ # @return [Celerity::Meta]
478
+ #
479
+
480
+ def meta(*args)
481
+ Meta.new(self, *args)
482
+ end
483
+
484
+ #
485
+ # @return [Celerity::Metas]
486
+ #
487
+
488
+ def metas(*args)
489
+ Metas.new(self, *args)
490
+ end
491
+
492
+ #
493
+ # @return [Celerity::Ol]
494
+ #
495
+
496
+ def ol(*args)
497
+ Ol.new(self, *args)
498
+ end
499
+
500
+ #
501
+ # @return [Celerity::Ols]
502
+ #
503
+
504
+ def ols
505
+ Ols.new(self)
506
+ end
507
+
508
+ #
509
+ # @return [Celerity::Option]
510
+ #
511
+
512
+ def option(*args)
513
+ Option.new(self, *args)
514
+ end
515
+
516
+ #
517
+ # @return [Celerity::P]
518
+ #
519
+
520
+ def p(*args)
521
+ P.new(self, *args)
522
+ end
523
+
524
+ #
525
+ # @return [Celerity::Ps]
526
+ #
527
+
528
+ def ps
529
+ Ps.new(self)
530
+ end
531
+
532
+ #
533
+ # @return [Celerity::Pre]
534
+ #
535
+
536
+ def pre(*args)
537
+ Pre.new(self, *args)
538
+ end
539
+
540
+ #
541
+ # @return [Celerity::Pres]
542
+ #
543
+
544
+ def pres
545
+ Pres.new(self)
546
+ end
547
+
548
+ #
549
+ # Since finding radios by value is very common, you can use this shorthand:
550
+ #
551
+ # browser.radio(:name, 'a_name', '1234').set
552
+ #
553
+ # or
554
+ #
555
+ # browser.radio(:name => 'a_name', :value => '1234').set
556
+ #
557
+ # @return [Celerity::Radio]
558
+ #
559
+
560
+ def radio(*args)
561
+ Radio.new(self, *args)
562
+ end
563
+
564
+ #
565
+ # @return [Celerity::Radios]
566
+ #
567
+
568
+ def radios
569
+ Radios.new(self)
570
+ end
571
+
572
+ #
573
+ # @return [Celerity::TableRow]
574
+ #
575
+
576
+ def row(*args)
577
+ TableRow.new(self, *args)
578
+ end
579
+
580
+ #
581
+ # @return [Celerity::TableRows]
582
+ #
583
+
584
+ def rows
585
+ TableRows.new(self)
586
+ end
587
+
588
+ #
589
+ # @return [Celerity::SelectList]
590
+ #
591
+
592
+ def select_list(*args)
593
+ SelectList.new(self, *args)
594
+ end
595
+
596
+ #
597
+ # @return [Celerity::SelectLists]
598
+ #
599
+
600
+ def select_lists
601
+ SelectLists.new(self)
602
+ end
603
+
604
+ #
605
+ # @return [Celerity::Span]
606
+ #
607
+
608
+ def span(*args)
609
+ Span.new(self, *args)
610
+ end
611
+
612
+ #
613
+ # @return [Celerity::Spans]
614
+ #
615
+
616
+ def spans
617
+ Spans.new(self)
618
+ end
619
+
620
+ #
621
+ # @return [Celerity::Spans]
622
+ #
623
+
624
+ def strong(*args)
625
+ Strong.new(self, *args)
626
+ end
627
+
628
+ #
629
+ # @return [Celerity::Strongs]
630
+ #
631
+
632
+ def strongs
633
+ Strongs.new(self)
634
+ end
635
+
636
+ #
637
+ # @return [Celerity::Table]
638
+ #
639
+
640
+ def table(*args)
641
+ Table.new(self, *args)
642
+ end
643
+
644
+ #
645
+ # @return [Celerity::Tables]
646
+ #
647
+
648
+ def tables
649
+ Tables.new(self)
650
+ end
651
+
652
+ #
653
+ # @return [Celerity::TableBody]
654
+ #
655
+
656
+ def tbody(*args)
657
+ TableBody.new(self, *args)
658
+ end
659
+
660
+ #
661
+ # @return [Celerity::TableBodies]
662
+ #
663
+
664
+ def tbodies
665
+ TableBodies.new(self)
666
+ end
667
+
668
+ #
669
+ # @return [Celerity::TextField]
670
+ #
671
+
672
+ def text_field(*args)
673
+ TextField.new(self, *args)
674
+ end
675
+
676
+ #
677
+ # @return [Celerity::TextFields]
678
+ #
679
+
680
+ def text_fields
681
+ TextFields.new(self)
682
+ end
683
+
684
+ #
685
+ # @return [Celerity::TableFooter]
686
+ #
687
+
688
+ def tfoot(*args)
689
+ TableFooter.new(self, *args)
690
+ end
691
+
692
+ #
693
+ # @return [Celerity::TableFooters]
694
+ #
695
+
696
+ def tfoots
697
+ TableFooters.new(self)
698
+ end
699
+ alias_method :tfeet, :tfoots # :-)
700
+
701
+ #
702
+ # Watir's cells() won't find <th> elements.
703
+ # This is a workaround.
704
+ #
705
+ # @return [Celerity::Th]
706
+ #
707
+
708
+ def th(*args)
709
+ Th.new(self, *args)
710
+ end
711
+
712
+ #
713
+ # FIXME: implement or change api,
714
+ # @see th
715
+ #
716
+
717
+ def ths
718
+ raise NotImplementedError
719
+ end
720
+
721
+ #
722
+ # @return [Celerity::TableHeader]
723
+ #
724
+
725
+ def thead(*args)
726
+ TableHeader.new(self, *args)
727
+ end
728
+
729
+ #
730
+ # @return [Celerity::TableHeaders]
731
+ #
732
+
733
+ def theads
734
+ TableHeaders.new(self)
735
+ end
736
+
737
+ #
738
+ # @return [Celerity::Ul]
739
+ #
740
+
741
+ def ul(*args)
742
+ Ul.new(self, *args)
743
+ end
744
+
745
+ #
746
+ # @return [Celerity::Uls]
747
+ #
748
+
749
+ def uls
750
+ Uls.new(self)
751
+ end
752
+
753
+ private
754
+
755
+ #
756
+ # Rescues HtmlUnit::FailingHttpStatusCodeException and re-raises as
757
+ # Celerity::NavigationException to avoid the huge JRuby backtrace
758
+ #
759
+
760
+ def rescue_status_code_exception(&blk)
761
+ yield
762
+ rescue HtmlUnit::FailingHttpStatusCodeException => e
763
+ raise NavigationException, e.message, caller
764
+ end
765
+
766
+ end # Container
767
+ end # Celerity