watir-webdriver 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. data/README.rdoc +9 -1
  2. data/Rakefile +2 -1
  3. data/VERSION +1 -1
  4. data/lib/watir-webdriver.rb +6 -7
  5. data/lib/watir-webdriver/attribute_helper.rb +17 -10
  6. data/lib/watir-webdriver/browser.rb +1 -1
  7. data/lib/watir-webdriver/cell_container.rb +19 -0
  8. data/lib/watir-webdriver/container.rb +8 -0
  9. data/lib/watir-webdriver/element_collection.rb +2 -2
  10. data/lib/watir-webdriver/elements/button.rb +3 -2
  11. data/lib/watir-webdriver/elements/element.rb +41 -1
  12. data/lib/watir-webdriver/elements/generated.rb +3 -3
  13. data/lib/watir-webdriver/elements/input.rb +0 -52
  14. data/lib/watir-webdriver/elements/select.rb +0 -1
  15. data/lib/watir-webdriver/elements/table.rb +26 -4
  16. data/lib/watir-webdriver/elements/table_cell.rb +36 -0
  17. data/lib/watir-webdriver/elements/table_row.rb +23 -14
  18. data/lib/watir-webdriver/elements/table_section.rb +9 -0
  19. data/lib/watir-webdriver/extensions/alerts.rb +69 -0
  20. data/lib/watir-webdriver/extensions/performance.rb +54 -0
  21. data/lib/watir-webdriver/locators/button_locator.rb +3 -5
  22. data/lib/watir-webdriver/locators/{table_row_locator.rb → child_cell_locator.rb} +11 -6
  23. data/lib/watir-webdriver/locators/child_row_locator.rb +37 -0
  24. data/lib/watir-webdriver/locators/element_locator.rb +24 -14
  25. data/lib/watir-webdriver/row_container.rb +19 -0
  26. data/lib/watir-webdriver/window_switching.rb +37 -10
  27. data/spec/alert_spec.rb +49 -0
  28. data/spec/element_locator_spec.rb +15 -16
  29. data/spec/element_spec.rb +0 -32
  30. data/spec/html/alerts.html +11 -0
  31. data/spec/input_spec.rb +8 -46
  32. data/spec/locator_spec_helper.rb +19 -5
  33. data/spec/spec_helper.rb +3 -0
  34. data/spec/watirspec/areas_spec.rb +8 -0
  35. data/spec/watirspec/browser_spec.rb +4 -4
  36. data/spec/watirspec/button_spec.rb +3 -4
  37. data/spec/watirspec/buttons_spec.rb +8 -0
  38. data/spec/watirspec/checkboxes_spec.rb +8 -0
  39. data/spec/watirspec/dds_spec.rb +8 -0
  40. data/spec/watirspec/dels_spec.rb +8 -0
  41. data/spec/watirspec/divs_spec.rb +8 -0
  42. data/spec/watirspec/dls_spec.rb +8 -0
  43. data/spec/watirspec/dts_spec.rb +8 -0
  44. data/spec/watirspec/element_spec.rb +71 -2
  45. data/spec/watirspec/ems_spec.rb +8 -0
  46. data/spec/watirspec/filefield_spec.rb +16 -11
  47. data/spec/watirspec/filefields_spec.rb +8 -0
  48. data/spec/watirspec/font_spec.rb +21 -19
  49. data/spec/watirspec/form_spec.rb +5 -3
  50. data/spec/watirspec/forms_spec.rb +11 -5
  51. data/spec/watirspec/frames_spec.rb +8 -0
  52. data/spec/watirspec/hiddens_spec.rb +8 -0
  53. data/spec/watirspec/hns_spec.rb +8 -0
  54. data/spec/watirspec/images_spec.rb +8 -0
  55. data/spec/watirspec/inses_spec.rb +8 -0
  56. data/spec/watirspec/label_spec.rb +2 -0
  57. data/spec/watirspec/labels_spec.rb +8 -0
  58. data/spec/watirspec/lib/server.rb +19 -1
  59. data/spec/watirspec/lib/spec_helper.rb +1 -1
  60. data/spec/watirspec/links_spec.rb +8 -0
  61. data/spec/watirspec/lis_spec.rb +8 -0
  62. data/spec/watirspec/maps_spec.rb +8 -0
  63. data/spec/watirspec/metas_spec.rb +8 -0
  64. data/spec/watirspec/ols_spec.rb +8 -0
  65. data/spec/watirspec/pres_spec.rb +8 -0
  66. data/spec/watirspec/ps_spec.rb +8 -0
  67. data/spec/watirspec/radios_spec.rb +8 -0
  68. data/spec/watirspec/select_list_spec.rb +6 -6
  69. data/spec/watirspec/select_lists_spec.rb +8 -0
  70. data/spec/watirspec/spans_spec.rb +8 -0
  71. data/spec/watirspec/strongs_spec.rb +8 -0
  72. data/spec/watirspec/table_nesting_spec.rb +50 -0
  73. data/spec/watirspec/table_spec.rb +62 -102
  74. data/spec/watirspec/tables_spec.rb +8 -0
  75. data/spec/watirspec/{table_body_spec.rb → tbody_spec.rb} +21 -31
  76. data/spec/watirspec/{table_bodies_spec.rb → tbodys_spec.rb} +8 -0
  77. data/spec/watirspec/td_spec.rb +72 -0
  78. data/spec/watirspec/{table_cells_spec.rb → tds_spec.rb} +18 -25
  79. data/spec/watirspec/text_fields_spec.rb +8 -0
  80. data/spec/watirspec/{table_footer_spec.rb → tfoot_spec.rb} +21 -28
  81. data/spec/watirspec/{table_footers_spec.rb → tfoots_spec.rb} +8 -0
  82. data/spec/watirspec/{table_header_spec.rb → thead_spec.rb} +21 -29
  83. data/spec/watirspec/{table_headers_spec.rb → theads_spec.rb} +8 -0
  84. data/spec/watirspec/tr_spec.rb +88 -0
  85. data/spec/watirspec/trs_spec.rb +68 -0
  86. data/spec/watirspec/uls_spec.rb +8 -0
  87. data/spec/watirspec/window_switching_spec.rb +165 -0
  88. data/support/html5.html +884 -422
  89. data/watir-webdriver.gemspec +91 -85
  90. metadata +159 -161
  91. data/Gemfile.lock +0 -48
  92. data/spec/html/closeable.html +0 -13
  93. data/spec/html/data_attributes.html +0 -9
  94. data/spec/html/window_switching.html +0 -12
  95. data/spec/watirspec/table_cell_spec.rb +0 -74
  96. data/spec/watirspec/table_row_spec.rb +0 -99
  97. data/spec/watirspec/table_rows_spec.rb +0 -60
  98. data/spec/window_switching_spec.rb +0 -116
@@ -7,6 +7,14 @@ describe "Lis" do
7
7
  browser.goto(WatirSpec.files + "/non_control_elements.html")
8
8
  end
9
9
 
10
+ bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
11
+ describe "with selectors" do
12
+ it "returns the matching elements" do
13
+ browser.lis(:class => "nonlink").to_a.should == [browser.li(:class => "nonlink")]
14
+ end
15
+ end
16
+ end
17
+
10
18
  describe "#length" do
11
19
  it "returns the number of lis" do
12
20
  browser.lis.length.should == 18
@@ -7,6 +7,14 @@ describe "Maps" do
7
7
  browser.goto(WatirSpec.files + "/images.html")
8
8
  end
9
9
 
10
+ bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
11
+ describe "with selectors" do
12
+ it "returns the matching elements" do
13
+ browser.maps(:name => "triangle_map").to_a.should == [browser.map(:name => "triangle_map")]
14
+ end
15
+ end
16
+ end
17
+
10
18
  describe "#length" do
11
19
  it "returns the number of maps" do
12
20
  browser.maps.length.should == 2
@@ -7,6 +7,14 @@ describe "Metas" do
7
7
  browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
8
8
  end
9
9
 
10
+ bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
11
+ describe "with selectors" do
12
+ it "returns the matching elements" do
13
+ browser.metas(:name => "description").to_a.should == [browser.meta(:name => "description")]
14
+ end
15
+ end
16
+ end
17
+
10
18
  describe "#length" do
11
19
  it "returns the number of meta elements" do
12
20
  browser.metas.length.should == 2
@@ -7,6 +7,14 @@ describe "Ols" do
7
7
  browser.goto(WatirSpec.files + "/non_control_elements.html")
8
8
  end
9
9
 
10
+ bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
11
+ describe "with selectors" do
12
+ it "returns the matching elements" do
13
+ browser.ols(:class => "chemistry").to_a.should == [browser.ol(:class => "chemistry")]
14
+ end
15
+ end
16
+ end
17
+
10
18
  describe "#length" do
11
19
  it "returns the number of ols" do
12
20
  browser.ols.length.should == 2
@@ -7,6 +7,14 @@ describe "Pres" do
7
7
  browser.goto(WatirSpec.files + "/non_control_elements.html")
8
8
  end
9
9
 
10
+ bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
11
+ describe "with selectors" do
12
+ it "returns the matching elements" do
13
+ browser.pres(:class => "c++").to_a.should == [browser.pre(:class => "c++")]
14
+ end
15
+ end
16
+ end
17
+
10
18
  describe "#length" do
11
19
  it "returns the number of pres" do
12
20
  browser.pres.length.should == 7
@@ -7,6 +7,14 @@ describe "Ps" do
7
7
  browser.goto(WatirSpec.files + "/non_control_elements.html")
8
8
  end
9
9
 
10
+ bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
11
+ describe "with selectors" do
12
+ it "returns the matching elements" do
13
+ browser.ps(:class => "lead").to_a.should == [browser.p(:class => "lead")]
14
+ end
15
+ end
16
+ end
17
+
10
18
  describe "#length" do
11
19
  it "returns the number of ps" do
12
20
  browser.ps.length.should == 5
@@ -7,6 +7,14 @@ describe "Radios" do
7
7
  browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
8
8
  end
9
9
 
10
+ bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
11
+ describe "with selectors" do
12
+ it "returns the matching elements" do
13
+ browser.radios(:value => "yes").to_a.should == [browser.radio(:value => "yes")]
14
+ end
15
+ end
16
+ end
17
+
10
18
  describe "#length" do
11
19
  it "returns the number of radios" do
12
20
  browser.radios.length.should == 5
@@ -206,24 +206,24 @@ describe "SelectList" do
206
206
  end
207
207
  end
208
208
 
209
- describe "#includes?" do
209
+ describe "#include?" do
210
210
  it "returns true if the given option exists" do
211
- browser.select_list(:name, 'new_user_country').includes?('Denmark').should be_true
211
+ browser.select_list(:name, 'new_user_country').should include('Denmark')
212
212
  end
213
213
 
214
214
  it "returns false if the given option doesn't exist" do
215
- browser.select_list(:name, 'new_user_country').includes?('Ireland').should be_false
215
+ browser.select_list(:name, 'new_user_country').should_not include('Ireland')
216
216
  end
217
217
  end
218
218
 
219
219
  describe "#selected?" do
220
220
  it "returns true if the given option is selected" do
221
221
  browser.select_list(:name, 'new_user_country').select('Denmark')
222
- browser.select_list(:name, 'new_user_country').selected?('Denmark').should be_true
222
+ browser.select_list(:name, 'new_user_country').should be_selected('Denmark')
223
223
  end
224
224
 
225
225
  it "returns false if the given option is not selected" do
226
- browser.select_list(:name, 'new_user_country').selected?('Sweden').should be_false
226
+ browser.select_list(:name, 'new_user_country').should_not be_selected('Sweden')
227
227
  end
228
228
 
229
229
  it "raises UnknonwObjectException if the option doesn't exist" do
@@ -332,4 +332,4 @@ describe "SelectList" do
332
332
  end
333
333
  end
334
334
 
335
- end
335
+ end
@@ -7,6 +7,14 @@ describe "SelectLists" do
7
7
  browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
8
8
  end
9
9
 
10
+ bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
11
+ describe "with selectors" do
12
+ it "returns the matching elements" do
13
+ browser.select_lists(:name => "delete_user_username").to_a.should == [browser.select_list(:name => "delete_user_username")]
14
+ end
15
+ end
16
+ end
17
+
10
18
  describe "#length" do
11
19
  it "returns the correct number of select lists on the page" do
12
20
  browser.select_lists.length.should == 4
@@ -7,6 +7,14 @@ describe "Spans" do
7
7
  browser.goto(WatirSpec.files + "/non_control_elements.html")
8
8
  end
9
9
 
10
+ bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
11
+ describe "with selectors" do
12
+ it "returns the matching elements" do
13
+ browser.spans(:class => "footer").to_a.should == [browser.span(:class => "footer")]
14
+ end
15
+ end
16
+ end
17
+
10
18
  describe "#length" do
11
19
  it "returns the number of spans" do
12
20
  browser.spans.length.should == 6
@@ -7,6 +7,14 @@ describe "Strongs" do
7
7
  browser.goto(WatirSpec.files + "/non_control_elements.html")
8
8
  end
9
9
 
10
+ bug "http://github.com/jarib/celerity/issues#issue/25", :celerity do
11
+ describe "with selectors" do
12
+ it "returns the matching elements" do
13
+ browser.strongs(:class => "descartes").to_a.should == [browser.strong(:class => "descartes")]
14
+ end
15
+ end
16
+ end
17
+
10
18
  describe "#length" do
11
19
  it "returns the number of divs" do
12
20
  browser.strongs.length.should == 2
@@ -0,0 +1,50 @@
1
+ # encoding: utf-8
2
+ require File.expand_path('spec_helper', File.dirname(__FILE__))
3
+
4
+ describe "Table" do
5
+
6
+ before :each do
7
+ browser.goto(WatirSpec.files + "/nested_tables.html")
8
+ end
9
+
10
+ it "returns the correct number of rows under a table" do
11
+ tables = browser.div(:id => "table-rows-test").tables(:id => /^tbl/)
12
+ tables.length.should > 0
13
+
14
+ tables.each do |table|
15
+ expected = Integer(table.data_row_count)
16
+ actual = table.rows.length
17
+ browser_count = Integer(table.data_browser_count)
18
+
19
+ actual.should eql(expected), "expected #{expected} rows, got #{actual} for table id=#{table.id}, browser reported: #{browser_count}"
20
+ end
21
+ end
22
+
23
+ it "returns the correct number of cells under a row" do
24
+ rows = browser.div(:id => "row-cells-test").trs(:id => /^row/)
25
+ rows.length.should > 0
26
+
27
+ rows.each do |row|
28
+ expected = Integer(row.data_cell_count)
29
+ actual = row.cells.length
30
+ browser_count = Integer(row.data_browser_count)
31
+
32
+ actual.should eql(expected), "expected #{expected} cells, got #{actual} for row id=#{row.id}, browser reported: #{browser_count}"
33
+ end
34
+ end
35
+
36
+ it "returns the correct number of rows under a table section" do
37
+ tbodies = browser.table(:id => "tbody-rows-test").tbodys(:id => /^body/)
38
+ tbodies.length.should > 0
39
+
40
+ tbodies.each do |tbody|
41
+ expected = Integer(tbody.data_rows_count)
42
+ actual = tbody.rows.count
43
+ browser_count = Integer(tbody.data_browser_count)
44
+
45
+ actual.should eql(expected), "expected #{expected} rows, got #{actual} for tbody id=#{tbody.id}, browser reported: #{browser_count}"
46
+ end
47
+ end
48
+
49
+
50
+ end
@@ -41,75 +41,44 @@ describe "Table" do
41
41
  end
42
42
  end
43
43
 
44
- describe "#length" do
45
- it "returns the number of rows" do
46
- browser.table(:id, 'outer').rows.length.should == 3
47
- browser.table(:id, 'inner').rows.length.should == 1
48
- end
49
- end
50
-
51
44
  # Other
52
- describe "#to_a" do
45
+ describe "#strings" do
53
46
  it "returns a two-dimensional array representation of the table" do
54
- browser.table(:id, 'inner').to_a.should == [["Table 2, Row 1, Cell 1", "Table 2, Row 1, Cell 2"]]
55
- end
56
- end
57
-
58
- describe "#click" do
59
- it "fires the table's onclick event" do
60
- browser.table(:id, 'inner').click
61
- messages.first.should == 'table'
62
- end
63
- end
64
-
65
- bug "http://github.com/jarib/watir-webdriver/issues/#issue/2", :webdriver do
66
- describe "#row_count" do
67
- it "counts the number of rows correctly" do
68
- browser.table(:id, 'inner').row_count.should == 1
69
- browser.table(:id, 'outer').row_count.should == 3
70
- end
47
+ browser.table(:id, 'inner').strings.should == [
48
+ ["Table 2, Row 1, Cell 1",
49
+ "Table 2, Row 1, Cell 2"]
50
+ ]
71
51
 
72
- it "raises an UnknownObjectException if the table doesn't exist" do
73
- lambda { browser.table(:id, 'no_such_id').row_count }.should raise_error(UnknownObjectException)
74
- lambda { browser.table(:index, 1337).row_count }.should raise_error(UnknownObjectException)
75
- end
52
+ browser.table(:id, 'outer').strings.should == [
53
+ ["Table 1, Row 1, Cell 1", "Table 1, Row 1, Cell 2"],
54
+ ["Table 1, Row 2, Cell 1", "Table 1, Row 2, Cell 2 Table 2, Row 1, Cell 1 Table 2, Row 1, Cell 2"],
55
+ ["Table 1, Row 3, Cell 1", "Table 1, Row 3, Cell 2"]
56
+ ]
76
57
  end
77
58
  end
78
59
 
79
- bug "http://github.com/jarib/watir-webdriver/issues/#issue/2", :webdriver do
80
- describe "#row_values" do
81
- it "gets row values" do
82
- browser.table(:id, 'outer').row_values(0).should == ["Table 1, Row 1, Cell 1", "Table 1, Row 1, Cell 2"]
83
- browser.table(:id, 'inner').row_values(0).should == ["Table 2, Row 1, Cell 1", "Table 2, Row 1, Cell 2"]
84
- browser.table(:id, 'outer').row_values(2).should == ["Table 1, Row 3, Cell 1", "Table 1, Row 3, Cell 2"]
85
- end
60
+ describe "#hashes" do
61
+ it "returns an Array of Hashes for the common table usage" do
62
+ browser.table(:id => "axis_example").hashes.should == [
63
+ { "" => "March 2008", "Before income tax" => "", "Income tax" => "", "After income tax" => "" },
64
+ { "" => "Gregory House", "Before income tax" => "5 934", "Income tax" => "1 347", "After income tax" => "4 587" },
65
+ { "" => "Hugh Laurie", "Before income tax" => "6 300", "Income tax" => "1 479", "After income tax" => "4 821" },
66
+ { "" => "April 2008", "Before income tax" => "", "Income tax" => "", "After income tax" => "" },
67
+ { "" => "Gregory House", "Before income tax" => "5 863", "Income tax" => "1 331", "After income tax" => "4 532" },
68
+ { "" => "Hugh Laurie", "Before income tax" => "6 252", "Income tax" => "1 420", "After income tax" => "4 832" },
69
+ { "" => "Sum", "Before income tax" => "24 349", "Income tax" => "5 577", "After income tax" => "18 722"},
70
+ ]
86
71
  end
87
- end
88
-
89
- bug "http://github.com/jarib/watir-webdriver/issues/#issue/2", :webdriver do
90
- describe "#column_count" do
91
- it "counts the number of columns correctly" do
92
- browser.table(:id, 'inner').column_count.should == 2
93
- browser.table(:id, 'outer').column_count.should == 2
94
- end
95
72
 
96
- it "raises an UnknownObjectException if the table doesn't exist" do
97
- lambda { browser.table(:id, 'no_such_id').column_count }.should raise_error(UnknownObjectException)
98
- lambda { browser.table(:index, 1337).column_count }.should raise_error(UnknownObjectException)
99
- end
73
+ it "raises an error if the table could not be parsed" do
74
+ pending
100
75
  end
101
76
  end
102
77
 
103
- bug "http://github.com/jarib/watir-webdriver/issues/#issue/2", :webdriver do
104
- describe "#column_values" do
105
- it "gets column values" do
106
- browser.table(:id, 'inner').column_values(0).should == ["Table 2, Row 1, Cell 1"]
107
- browser.table(:id, 'outer').column_values(0).should == ["Table 1, Row 1, Cell 1", "Table 1, Row 2, Cell 1", "Table 1, Row 3, Cell 1"]
108
- end
109
-
110
- it "raises UnknownCellException when trying to locate non-existing cell" do
111
- lambda { browser.table(:id, 'inner').column_values(1337) }.should raise_error(UnknownCellException)
112
- end
78
+ describe "#click" do
79
+ it "fires the table's onclick event" do
80
+ browser.table(:id, 'inner').click
81
+ messages.first.should == 'table'
113
82
  end
114
83
  end
115
84
 
@@ -120,67 +89,58 @@ describe "Table" do
120
89
  browser.table(:id, 'outer')[2].id.should == "outer_last"
121
90
  end
122
91
 
123
-
124
- bug "http://github.com/jarib/watir-webdriver/issues/issue/26", :webdriver do
92
+ not_compliant_on :webdriver do
125
93
  it "raises UnknownRowException if the index is out of bounds" do
126
94
  lambda { browser.table(:id, 'outer')[1337] }.should raise_error(UnknownRowException)
127
95
  end
128
96
  end
129
97
  end
130
98
 
131
- bug "http://github.com/jarib/watir-webdriver/issues/#issue/2", :webdriver do
132
- describe "#child_row" do
133
- it "returns the nth child row" do
134
- browser.table(:id, 'outer').child_row(0).id.should == "outer_first"
135
- browser.table(:id, 'inner').child_row(0).id.should == "inner_first"
136
- browser.table(:id, 'outer').child_row(2).id.should == "outer_last"
137
- end
138
- it "raises UnknownRowException if the index is out of bounds" do
139
- lambda { browser.table(:id, 'outer').child_row(1337) }.should raise_error(UnknownRowException)
140
- end
99
+ describe "#row" do
100
+ let(:table) { browser.table(:id, 'outer') }
101
+
102
+ it "finds rows belonging to this table" do
103
+ table.row(:id => "outer_last").should exist
104
+ table.row(:text => /Table 1, Row 1, Cell 1/).should exist
141
105
  end
142
- end
143
106
 
144
- bug "http://github.com/jarib/watir-webdriver/issues/#issue/2", :webdriver do
145
- describe "#child_cell" do
146
- it "returns the nth child row" do
147
- browser.table(:id, 'outer').child_cell(4).text.should == "Table 1, Row 3, Cell 1"
148
- end
149
- it "raises UnknownCellException if the index is out of bounds" do
150
- lambda { browser.table(:id, 'outer').child_cell(1337) }.should raise_error(UnknownCellException)
151
- end
107
+ it "does not find rows from a nested table" do
108
+ table.row(:id => "inner_first").should_not exist
109
+ table.row(:text => /^Table 2, Row 1, Cell 1 Table 2, Row 1, Cell 2$/).should_not exist
152
110
  end
153
111
  end
154
112
 
155
- bug "http://github.com/jarib/watir-webdriver/issues/#issue/2", :webdriver do
156
- describe "#each" do
157
- it "iterates through the table's rows" do
158
- ids = ["outer_first", "outer_second", "outer_last"]
159
- browser.table(:id, 'outer').each_with_index do |r, idx|
160
- r.id.should == ids[idx]
161
- end
162
- end
113
+ describe "#rows" do
114
+ it "finds the correct number of rows (excluding nested tables)" do
115
+ browser.table(:id, 'inner').rows.length.should == 1
116
+ browser.table(:id, 'outer').rows.length.should == 3
117
+ end
118
+
119
+ it "finds rows matching the selector" do
120
+ pending
121
+ end
122
+
123
+ it "does not find rows from a nested table" do
124
+ pending
163
125
  end
164
126
  end
165
127
 
166
- bug "http://github.com/jarib/watir-webdriver/issues/#issue/2", :webdriver do
167
- describe "#body" do
168
- it "returns the correct instance of TableBody" do
169
- body = browser.table(:index, 0).body(:id, 'first')
170
- body.should be_instance_of(TableBody)
171
- body[0][0].text.should == "March 2008"
172
- end
128
+ describe "#tbody" do
129
+ it "returns the correct instance of TableSection" do
130
+ body = browser.table(:index, 0).tbody(:id, 'first')
131
+ body.should be_instance_of(TableSection)
132
+ body[0][0].text.should == "March 2008"
173
133
  end
174
134
  end
175
135
 
176
- bug "http://github.com/jarib/watir-webdriver/issues/#issue/2", :webdriver do
177
- describe "#bodies" do
178
- it "returns the correct instance of TableBodies" do
179
- bodies = browser.table(:index, 0).bodies
180
- bodies.should be_instance_of(TableBodies)
181
- bodies[0].id.should == "first"
182
- bodies[1].id.should == "second"
183
- end
136
+ describe "#tbodys" do
137
+ it "returns the correct instance of TableSection" do
138
+ bodies = browser.table(:index, 0).tbodys
139
+
140
+ bodies.should be_instance_of(TableSectionCollection)
141
+
142
+ bodies[0].id.should == "first"
143
+ bodies[1].id.should == "second"
184
144
  end
185
145
  end
186
146