celerity 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. data/History.txt +15 -1
  2. data/Manifest.txt +174 -0
  3. data/README.txt +19 -10
  4. data/config/hoe.rb +68 -0
  5. data/config/requirements.rb +15 -0
  6. data/lib/celerity.rb +14 -11
  7. data/lib/celerity/collections.rb +37 -8
  8. data/lib/celerity/container.rb +100 -3
  9. data/lib/celerity/disabled_element.rb +4 -2
  10. data/lib/celerity/element.rb +21 -8
  11. data/lib/celerity/element_collections.rb +4 -7
  12. data/lib/celerity/element_locator.rb +1 -0
  13. data/lib/celerity/elements/button.rb +6 -2
  14. data/lib/celerity/elements/file_field.rb +1 -1
  15. data/lib/celerity/elements/form.rb +1 -2
  16. data/lib/celerity/elements/frame.rb +0 -3
  17. data/lib/celerity/elements/image.rb +1 -4
  18. data/lib/celerity/elements/label.rb +1 -0
  19. data/lib/celerity/elements/link.rb +2 -0
  20. data/lib/celerity/elements/option.rb +1 -0
  21. data/lib/celerity/elements/radio_check.rb +3 -5
  22. data/lib/celerity/elements/select_list.rb +3 -10
  23. data/lib/celerity/elements/table.rb +8 -22
  24. data/lib/celerity/elements/table_body.rb +5 -11
  25. data/lib/celerity/elements/table_cell.rb +1 -0
  26. data/lib/celerity/elements/table_footer.rb +30 -0
  27. data/lib/celerity/elements/table_header.rb +30 -0
  28. data/lib/celerity/elements/table_row.rb +5 -3
  29. data/lib/celerity/elements/text_field.rb +18 -13
  30. data/lib/celerity/exception.rb +8 -8
  31. data/lib/celerity/extra/method_generator.rb +5 -2
  32. data/lib/celerity/htmlunit/htmlunit-2.2-SNAPSHOT.jar +0 -0
  33. data/lib/celerity/ie.rb +195 -141
  34. data/lib/celerity/non_control_elements.rb +30 -4
  35. data/lib/celerity/version.rb +1 -1
  36. data/lib/celerity/watir_compatibility.rb +62 -0
  37. data/setup.rb +0 -2
  38. data/spec/area_spec.rb +4 -1
  39. data/spec/areas_spec.rb +1 -1
  40. data/spec/button_spec.rb +35 -17
  41. data/spec/buttons_spec.rb +1 -1
  42. data/spec/checkbox_spec.rb +6 -4
  43. data/spec/checkboxes_spec.rb +1 -1
  44. data/spec/div_spec.rb +20 -19
  45. data/spec/divs_spec.rb +2 -2
  46. data/spec/element_spec.rb +13 -2
  47. data/spec/filefield_spec.rb +6 -3
  48. data/spec/filefields_spec.rb +1 -1
  49. data/spec/form_spec.rb +4 -1
  50. data/spec/forms_spec.rb +1 -1
  51. data/spec/frame_spec.rb +6 -2
  52. data/spec/hidden_spec.rb +8 -4
  53. data/spec/hiddens_spec.rb +1 -1
  54. data/spec/hn_spec.rb +86 -0
  55. data/spec/hns_spec.rb +41 -0
  56. data/spec/html/bug_duplicate_attributes.html +14 -0
  57. data/spec/html/bug_javascript_001.html +11 -0
  58. data/spec/html/forms_with_input_elements.html +11 -11
  59. data/spec/html/images.html +18 -15
  60. data/spec/html/latin1_text.html +16 -0
  61. data/spec/html/non_control_elements.html +28 -4
  62. data/spec/html/tables.html +3 -3
  63. data/spec/html/utf8_text.html +15 -0
  64. data/spec/htmlunit_spec.rb +27 -0
  65. data/spec/ie_spec.rb +47 -12
  66. data/spec/image_spec.rb +4 -7
  67. data/spec/images_spec.rb +3 -2
  68. data/spec/label_spec.rb +4 -3
  69. data/spec/labels_spec.rb +1 -1
  70. data/spec/li_spec.rb +11 -8
  71. data/spec/link_spec.rb +5 -1
  72. data/spec/links_spec.rb +2 -1
  73. data/spec/lis_spec.rb +3 -2
  74. data/spec/map_spec.rb +4 -1
  75. data/spec/maps_spec.rb +1 -1
  76. data/spec/meta_spec.rb +6 -0
  77. data/spec/ol_spec.rb +73 -0
  78. data/spec/ols_spec.rb +41 -0
  79. data/spec/option_spec.rb +129 -0
  80. data/spec/p_spec.rb +4 -1
  81. data/spec/pre_spec.rb +4 -1
  82. data/spec/pres_spec.rb +1 -1
  83. data/spec/ps_spec.rb +2 -1
  84. data/spec/radio_spec.rb +7 -19
  85. data/spec/radios_spec.rb +1 -1
  86. data/spec/select_list_spec.rb +19 -57
  87. data/spec/select_lists_spec.rb +3 -2
  88. data/spec/span_spec.rb +8 -5
  89. data/spec/spans_spec.rb +2 -1
  90. data/spec/spec_helper.rb +8 -43
  91. data/spec/table_bodies_spec.rb +17 -4
  92. data/spec/table_body_spec.rb +47 -16
  93. data/spec/table_cell_spec.rb +5 -3
  94. data/spec/table_cells_spec.rb +1 -1
  95. data/spec/table_footer_spec.rb +94 -0
  96. data/spec/table_footers_spec.rb +53 -0
  97. data/spec/table_header_spec.rb +94 -0
  98. data/spec/table_headers_spec.rb +53 -0
  99. data/spec/table_row_spec.rb +25 -4
  100. data/spec/table_rows_spec.rb +1 -1
  101. data/spec/table_spec.rb +22 -2
  102. data/spec/tables_spec.rb +2 -1
  103. data/spec/text_field_spec.rb +52 -20
  104. data/spec/text_fields_spec.rb +1 -1
  105. data/spec/ul_spec.rb +73 -0
  106. data/spec/uls_spec.rb +41 -0
  107. data/spec/watir_compatability_spec.rb +253 -0
  108. data/support/celerity_viewer/rubycocoa/CelerityViewer.icns +0 -0
  109. data/support/celerity_viewer/rubycocoa/English.lproj/Main.nib/classes.nib +37 -0
  110. data/support/celerity_viewer/rubycocoa/English.lproj/Main.nib/info.nib +19 -0
  111. data/support/celerity_viewer/rubycocoa/English.lproj/Main.nib/keyedobjects.nib +0 -0
  112. data/support/celerity_viewer/rubycocoa/Info.plist.erb +28 -0
  113. data/support/celerity_viewer/rubycocoa/MainController.rb +23 -0
  114. data/support/celerity_viewer/rubycocoa/README +94 -0
  115. data/support/celerity_viewer/rubycocoa/Rakefile +100 -0
  116. data/support/celerity_viewer/rubycocoa/distributed_viewer.rb +86 -0
  117. data/support/celerity_viewer/rubycocoa/main.m +7 -0
  118. data/support/celerity_viewer/rubycocoa/main.rb +27 -0
  119. data/support/spec_server.rb +64 -0
  120. data/tasks/benchmark.rake +1 -0
  121. data/tasks/rdoc.rake +4 -0
  122. data/tasks/rspec.rake +10 -3
  123. data/tasks/simple_ci.rake +94 -0
  124. data/tasks/specserver.rake +21 -0
  125. metadata +160 -114
  126. data/spec/table_bodies.rb +0 -40
  127. data/tasks/testserver.rake +0 -32
@@ -1,3 +1,18 @@
1
+ == 0.0.3 2008-05-26
2
+ * 3 major enhancements:
3
+ * Added support for <ul>, <ol>, <thead>, <tfoot>, <h1>, <h2>, <h3>, <h4>, <h5> and <h6> elements
4
+ * Better support for <tbody>, <tr> and <option> elements. They are now accessible from the top level in the same way as every other element, meaning you can do ie.option(:id, 'some_id'), or ie.row(:index, 1).
5
+ * Better HTTPS support
6
+ * 8 minor enhancements:
7
+ * Improved CelerityViewer
8
+ * Watir-like show methods (IE#show_divs, IE#show_tables, etc.)
9
+ * All HTML elements now has a default how parameter, see http://celerity.rubyforge.org/wiki/wiki.pl?ListOfSupportedHtmlElementsAndTheirDefaultHowParameter
10
+ * Raketask cleanup
11
+ * Separated out Watir compatibility specific stuff
12
+ * Form#submit implemented
13
+ * Updated ATTRIBUTES constants for all element classes
14
+ * TextField#type bug fixed
15
+
1
16
  == 0.0.2 2008-05-15
2
17
  * 3 major enhancements:
3
18
  * Support for multiple how => what conditions
@@ -9,6 +24,5 @@
9
24
  * Fixed multi-byte characters issue for text fields
10
25
 
11
26
  == 0.0.1 2008-05-07
12
-
13
27
  * 1 major enhancement:
14
28
  * Initial release
@@ -0,0 +1,174 @@
1
+ History.txt
2
+ spec/table_bodies_spec.rb
3
+ spec/table_spec.rb
4
+ spec/checkbox_spec.rb
5
+ spec/buttons_spec.rb
6
+ spec/table_headers_spec.rb
7
+ spec/areas_spec.rb
8
+ spec/tables_spec.rb
9
+ spec/forms_spec.rb
10
+ spec/uls_spec.rb
11
+ spec/map_spec.rb
12
+ spec/p_spec.rb
13
+ spec/html/bug_javascript_001.html
14
+ spec/html/images/originaltriangle.jpg
15
+ spec/html/images/circle.jpg
16
+ spec/html/images/1.gif
17
+ spec/html/images/square.jpg
18
+ spec/html/images/minus.gif
19
+ spec/html/images/button.jpg
20
+ spec/html/images/map2.gif
21
+ spec/html/images/3.gif
22
+ spec/html/images/map.gif
23
+ spec/html/images/plus.gif
24
+ spec/html/images/triangle.jpg
25
+ spec/html/images/2.gif
26
+ spec/html/frame_2.html
27
+ spec/html/iframes.html
28
+ spec/html/tables.html
29
+ spec/html/frames.html
30
+ spec/html/2000_spans.html
31
+ spec/html/images.html
32
+ spec/html/latin1_text.html
33
+ spec/html/non_control_elements.html
34
+ spec/html/bug_duplicate_attributes.html
35
+ spec/html/frame_1.html
36
+ spec/html/utf8_text.html
37
+ spec/html/forms_with_input_elements.html
38
+ spec/images_spec.rb
39
+ spec/spec_helper.rb
40
+ spec/ps_spec.rb
41
+ spec/hn_spec.rb
42
+ spec/filefield_spec.rb
43
+ spec/area_spec.rb
44
+ spec/htmlunit_spec.rb
45
+ spec/labels_spec.rb
46
+ spec/table_cell_spec.rb
47
+ spec/div_spec.rb
48
+ spec/spans_spec.rb
49
+ spec/form_spec.rb
50
+ spec/label_spec.rb
51
+ spec/hns_spec.rb
52
+ spec/table_body_spec.rb
53
+ spec/table_rows_spec.rb
54
+ spec/text_field_spec.rb
55
+ spec/button_spec.rb
56
+ spec/spec.opts
57
+ spec/radio_spec.rb
58
+ spec/links_spec.rb
59
+ spec/meta_spec.rb
60
+ spec/span_spec.rb
61
+ spec/ie_spec.rb
62
+ spec/checkboxes_spec.rb
63
+ spec/ul_spec.rb
64
+ spec/table_row_spec.rb
65
+ spec/pre_spec.rb
66
+ spec/watir_compatability_spec.rb
67
+ spec/table_header_spec.rb
68
+ spec/maps_spec.rb
69
+ spec/option_spec.rb
70
+ spec/select_lists_spec.rb
71
+ spec/element_spec.rb
72
+ spec/radios_spec.rb
73
+ spec/frame_spec.rb
74
+ spec/pres_spec.rb
75
+ spec/table_footer_spec.rb
76
+ spec/filefields_spec.rb
77
+ spec/text_fields_spec.rb
78
+ spec/hidden_spec.rb
79
+ spec/table_footers_spec.rb
80
+ spec/ol_spec.rb
81
+ spec/select_list_spec.rb
82
+ spec/divs_spec.rb
83
+ spec/lis_spec.rb
84
+ spec/ols_spec.rb
85
+ spec/hiddens_spec.rb
86
+ spec/table_cells_spec.rb
87
+ spec/li_spec.rb
88
+ spec/link_spec.rb
89
+ spec/image_spec.rb
90
+ config/hoe.rb
91
+ config/requirements.rb
92
+ README.txt
93
+ lib/celerity/input_element.rb
94
+ lib/celerity/watir_compatibility.rb
95
+ lib/celerity/collections.rb
96
+ lib/celerity/container.rb
97
+ lib/celerity/element_locator.rb
98
+ lib/celerity/identifier.rb
99
+ lib/celerity/version.rb
100
+ lib/celerity/extra/method_generator.rb
101
+ lib/celerity/non_control_elements.rb
102
+ lib/celerity/exception.rb
103
+ lib/celerity/clickable_element.rb
104
+ lib/celerity/disabled_element.rb
105
+ lib/celerity/ie.rb
106
+ lib/celerity/element_collections.rb
107
+ lib/celerity/elements/option.rb
108
+ lib/celerity/elements/frame.rb
109
+ lib/celerity/elements/select_list.rb
110
+ lib/celerity/elements/link.rb
111
+ lib/celerity/elements/table_header.rb
112
+ lib/celerity/elements/image.rb
113
+ lib/celerity/elements/label.rb
114
+ lib/celerity/elements/table_cell.rb
115
+ lib/celerity/elements/table_footer.rb
116
+ lib/celerity/elements/table.rb
117
+ lib/celerity/elements/button.rb
118
+ lib/celerity/elements/table_row.rb
119
+ lib/celerity/elements/form.rb
120
+ lib/celerity/elements/table_body.rb
121
+ lib/celerity/elements/radio_check.rb
122
+ lib/celerity/elements/file_field.rb
123
+ lib/celerity/elements/text_field.rb
124
+ lib/celerity/htmlunit/xml-apis-1.0.b2.jar
125
+ lib/celerity/htmlunit/sac-1.3.jar
126
+ lib/celerity/htmlunit/cssparser-0.9.5.jar
127
+ lib/celerity/htmlunit/nekohtml-1.9.7.jar
128
+ lib/celerity/htmlunit/commons-logging-1.1.1.jar
129
+ lib/celerity/htmlunit/commons-codec-1.3.jar
130
+ lib/celerity/htmlunit/js-1.7R1.jar
131
+ lib/celerity/htmlunit/commons-collections-3.2.jar
132
+ lib/celerity/htmlunit/xercesImpl-2.8.1.jar
133
+ lib/celerity/htmlunit/xalan-2.7.0.jar
134
+ lib/celerity/htmlunit/commons-httpclient-3.1.jar
135
+ lib/celerity/htmlunit/htmlunit-2.2-SNAPSHOT.jar
136
+ lib/celerity/htmlunit/commons-io-1.4.jar
137
+ lib/celerity/htmlunit/commons-lang-2.4.jar
138
+ lib/celerity/element.rb
139
+ lib/celerity.rb
140
+ support/spec_server.rb
141
+ support/celerity_viewer/rubycocoa/CelerityViewer.icns
142
+ support/celerity_viewer/rubycocoa/distributed_viewer.rb
143
+ support/celerity_viewer/rubycocoa/README
144
+ support/celerity_viewer/rubycocoa/English.lproj
145
+ support/celerity_viewer/rubycocoa/English.lproj/Main.nib
146
+ support/celerity_viewer/rubycocoa/English.lproj/Main.nib/info.nib
147
+ support/celerity_viewer/rubycocoa/English.lproj/Main.nib/classes.nib
148
+ support/celerity_viewer/rubycocoa/English.lproj/Main.nib/keyedobjects.nib
149
+ support/celerity_viewer/rubycocoa/MainController.rb
150
+ support/celerity_viewer/rubycocoa/main.m
151
+ support/celerity_viewer/rubycocoa/Rakefile
152
+ support/celerity_viewer/rubycocoa/Info.plist.erb
153
+ support/celerity_viewer/rubycocoa/CelerityViewer.app
154
+ support/celerity_viewer/rubycocoa/CelerityViewer.app/Contents
155
+ support/celerity_viewer/rubycocoa/CelerityViewer.app/Contents/MacOS
156
+ support/celerity_viewer/rubycocoa/CelerityViewer.app/Contents/Resources
157
+ support/celerity_viewer/rubycocoa/CelerityViewer.app/Contents/Resources/English.lproj
158
+ support/celerity_viewer/rubycocoa/CelerityViewer.app/Contents/Resources/English.lproj/Main.nib
159
+ support/celerity_viewer/rubycocoa/main.rb
160
+ Manifest.txt
161
+ setup.rb
162
+ License.txt
163
+ tasks/simple_ci.rake
164
+ tasks/rdoc.rake
165
+ tasks/specserver.rake
166
+ tasks/benchmark.rake
167
+ tasks/environment.rake
168
+ tasks/rspec.rake
169
+ benchmark/bm_input_locator.rb
170
+ benchmark/loader.rb
171
+ benchmark/bm_2000_spans.rb
172
+ benchmark/bm_digg.rb
173
+ benchmark/bm_google_images.rb
174
+ Rakefile
data/README.txt CHANGED
@@ -4,9 +4,8 @@
4
4
 
5
5
  == DESCRIPTION:
6
6
 
7
- Celerity is a JRuby/RJB wrapper around the HtmlUnit Java library (http://htmlunit.sourceforge.net/).
8
- The goal of the project is to implement the Watir API (http://wtf.rubyforge.org/) on top of HtmlUnit.
9
-
7
+ Celerity is a JRuby library for easy and fast functional test automation for web applications.
8
+ It is a wrapper around the HtmlUnit Java library and is currently aimed at providing the same API and functionality as Watir.
10
9
 
11
10
  == FEATURES:
12
11
 
@@ -18,13 +17,13 @@
18
17
 
19
18
  == SYNOPSIS:
20
19
 
21
- require 'rubygems'
22
- require 'celerity'
23
-
24
- browser = Celerity::IE.new
25
- browser.goto("google.com")
26
- browser.text_field(:name, 'q').set("celerity")
27
- browser.button(:name, 'btnG').submit
20
+ require 'rubygems'
21
+ require 'celerity'
22
+
23
+ browser = Celerity::IE.new
24
+ browser.goto("google.com")
25
+ browser.text_field(:name, 'q').set("celerity")
26
+ browser.button(:name, 'btnG').submit
28
27
 
29
28
  == REQUIREMENTS:
30
29
 
@@ -36,6 +35,16 @@
36
35
 
37
36
  * jruby -S gem install celerity
38
37
 
38
+ == EXAMPLE:
39
+ require "celerity"
40
+
41
+ browser = Celerity::Browser.new
42
+ browser.goto('http://www.google.com')
43
+ browser.text_field(:name, 'q').value = 'Celerity'
44
+ browser.button(:name, 'btnG').click
45
+
46
+ puts "yay" if browser.text.include? 'celerity.rubyforge.org'
47
+
39
48
  == LICENSE:
40
49
 
41
50
  Celerity - JRuby wrapper for HtmlUnit
@@ -0,0 +1,68 @@
1
+ require 'celerity/version'
2
+
3
+ AUTHORS = ["T. Alexander Lystad", "Knut Johannes Dahle", "Jari Bakken"]
4
+ EMAIL = "alexander.lystad@finntech.no"
5
+ DESCRIPTION = <<DESC
6
+ Celerity is a JRuby library for easy and fast functional test automation for web applications. It is a wrapper around the HtmlUnit Java library and is currently aimed at providing the same API and functionality as Watir.
7
+ DESC
8
+
9
+ GEM_NAME = 'celerity'
10
+ RUBYFORGE_PROJECT = 'celerity'
11
+ HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
12
+ DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
13
+
14
+ @config_file = "~/.rubyforge/user-config.yml"
15
+ @config = nil
16
+ RUBYFORGE_USERNAME = "unknown"
17
+ def rubyforge_username
18
+ unless @config
19
+ begin
20
+ @config = YAML.load(File.read(File.expand_path(@config_file)))
21
+ rescue
22
+ puts <<-EOS
23
+ ERROR: No rubyforge config file found: #{@config_file}
24
+ Run 'rubyforge setup' to prepare your env for access to Rubyforge
25
+ - See http://newgem.rubyforge.org/rubyforge.html for more details
26
+ EOS
27
+ exit
28
+ end
29
+ end
30
+ RUBYFORGE_USERNAME.replace @config["username"]
31
+ end
32
+
33
+
34
+ REV = nil
35
+ # UNCOMMENT IF REQUIRED:
36
+ # REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil
37
+ VERS = Celerity::VERSION::STRING + (REV ? ".#{REV}" : "")
38
+
39
+ class Hoe
40
+ def extra_deps
41
+ @extra_deps.reject! { |x| Array(x).first == 'hoe' }
42
+ @extra_deps
43
+ end
44
+ end
45
+
46
+ # Generate all the Rake tasks
47
+ # Run 'rake -T' to see list of generated tasks (from gem root directory)
48
+ $hoe = Hoe.new(GEM_NAME, VERS) do |p|
49
+ p.author = AUTHORS
50
+ p.email = EMAIL
51
+ p.description = DESCRIPTION
52
+ p.summary = DESCRIPTION
53
+ p.url = HOMEPATH
54
+ p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
55
+ p.test_globs = ["test/**/test_*.rb"]
56
+ p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
57
+
58
+ # == Optional
59
+ p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
60
+ #p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
61
+ #p.spec_extras = {} # A hash of extra values to set in the gemspec.
62
+
63
+ end
64
+
65
+ CHANGES = $hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
66
+ PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
67
+ $hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
68
+ $hoe.rsync_args = '-av --delete --ignore-errors'
@@ -0,0 +1,15 @@
1
+ require 'fileutils'
2
+ include FileUtils
3
+
4
+ require 'rubygems'
5
+ %w[rake hoe newgem rubigen].each do |req_gem|
6
+ begin
7
+ require req_gem
8
+ rescue LoadError
9
+ puts "This Rakefile requires the '#{req_gem}' RubyGem."
10
+ puts "Installation: gem install #{req_gem} -y"
11
+ exit
12
+ end
13
+ end
14
+
15
+ $:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
@@ -1,26 +1,27 @@
1
1
  $:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
2
2
 
3
- HTMLUNIT_JARS = Dir[File.dirname(__FILE__) + '/celerity/htmlunit/*.jar']
3
+ module Celerity
4
+ Jars = Dir[File.dirname(__FILE__) + '/celerity/htmlunit/*.jar']
5
+ end
4
6
 
5
7
  if RUBY_PLATFORM =~ /java/
6
8
  require 'java'
7
- HTMLUNIT_JARS.each { |jar| require(jar) }
9
+ Celerity::Jars.each { |jar| require(jar) }
8
10
 
9
11
  module HtmlUnit
10
12
  include_package 'com.gargoylesoftware.htmlunit'
11
13
  end
12
- ArrayList = java.util.ArrayList
14
+ JavaString = java.lang.String
13
15
  else
14
- require "rjb"
15
- require "watir"
16
- Rjb::load(HTMLUNIT_JARS.join(";"))
17
- module HtmlUnit
18
- WebClient = Rjb::import('com.gargoylesoftware.htmlunit.WebClient')
19
- BrowserVersion = Rjb::import('com.gargoylesoftware.htmlunit.BrowserVersion')
20
- end
16
+ raise "Celerity only works on JRuby at the moment."
21
17
  end
18
+ # require "rjb"
19
+ # Rjb::load(Celerity::Jars.join(";"))
20
+ # module HtmlUnit
21
+ # WebClient = Rjb::import('com.gargoylesoftware.htmlunit.WebClient')
22
+ # BrowserVersion = Rjb::import('com.gargoylesoftware.htmlunit.BrowserVersion')
23
+ # end
22
24
 
23
- module Celerity; end
24
25
  require "celerity/version"
25
26
  require "celerity/exception"
26
27
  require "celerity/clickable_element"
@@ -36,6 +37,8 @@ require "celerity/non_control_elements"
36
37
  Dir[File.dirname(__FILE__) + "/celerity/elements/*.rb"].each { |f| require(f) }
37
38
  require "celerity/ie"
38
39
 
40
+ require "celerity/watir_compatibility"
41
+
39
42
  require "logger"
40
43
  require "uri"
41
44
  require "pp"
@@ -10,18 +10,10 @@ module Celerity
10
10
 
11
11
  class CheckBoxes < ElementCollections
12
12
  def element_class; CheckBox; end
13
- private
14
- def iterator_object(i)
15
- element_class.new(@container, :index, i+1, nil)
16
- end
17
13
  end
18
14
 
19
15
  class Radios < ElementCollections
20
16
  def element_class; Radio; end
21
- private
22
- def iterator_object(i)
23
- element_class.new(@container, :index, i+1, nil)
24
- end
25
17
  end
26
18
 
27
19
  class SelectLists < ElementCollections
@@ -32,6 +24,14 @@ module Celerity
32
24
  def element_class; Link; end
33
25
  end
34
26
 
27
+ class Uls < ElementCollections
28
+ def element_class; Ul; end
29
+ end
30
+
31
+ class Ols < ElementCollections
32
+ def element_class; Ol; end
33
+ end
34
+
35
35
  class Lis < ElementCollections
36
36
  def element_class; Li; end
37
37
  end
@@ -60,9 +60,15 @@ module Celerity
60
60
  def element_class; Table; end
61
61
  end
62
62
 
63
+ class TableHeaders < ElementCollections
64
+ def element_class; TableHeader; end
65
+ end
63
66
  class TableBodies < ElementCollections
64
67
  def element_class; TableBody; end
65
68
  end
69
+ class TableFooters < ElementCollections
70
+ def element_class; TableFooter; end
71
+ end
66
72
 
67
73
  class TableRows < ElementCollections
68
74
  def element_class; TableRow; end
@@ -95,5 +101,28 @@ module Celerity
95
101
  class Forms < ElementCollections
96
102
  def element_class; Form; end
97
103
  end
104
+
105
+ class Options < ElementCollections
106
+ def element_class; Option; end
107
+ end
108
+
109
+ class H1s < ElementCollections
110
+ def element_class; H1; end
111
+ end
112
+ class H2s < ElementCollections
113
+ def element_class; H2; end
114
+ end
115
+ class H3s < ElementCollections
116
+ def element_class; H3; end
117
+ end
118
+ class H4s < ElementCollections
119
+ def element_class; H4; end
120
+ end
121
+ class H5s < ElementCollections
122
+ def element_class; H5; end
123
+ end
124
+ class H6s < ElementCollections
125
+ def element_class; H6; end
126
+ end
98
127
 
99
128
  end