watir-webdriver 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +53 -31
- data/VERSION +1 -1
- data/lib/watir-webdriver.rb +6 -8
- data/lib/watir-webdriver/attribute_helper.rb +121 -0
- data/lib/watir-webdriver/browser.rb +13 -6
- data/lib/watir-webdriver/collections/element_collection.rb +21 -15
- data/lib/watir-webdriver/collections/table_row_collection.rb +11 -0
- data/lib/watir-webdriver/container.rb +17 -11
- data/lib/watir-webdriver/element.rb +201 -0
- data/lib/watir-webdriver/elements/button.rb +19 -2
- data/lib/watir-webdriver/elements/checkbox.rb +24 -4
- data/lib/watir-webdriver/elements/file_field.rb +24 -4
- data/lib/watir-webdriver/elements/font.rb +10 -11
- data/lib/watir-webdriver/elements/frame.rb +11 -3
- data/lib/watir-webdriver/elements/generated.rb +2491 -1313
- data/lib/watir-webdriver/elements/hidden.rb +16 -5
- data/lib/watir-webdriver/elements/input.rb +44 -5
- data/lib/watir-webdriver/elements/link.rb +6 -8
- data/lib/watir-webdriver/elements/radio.rb +25 -6
- data/lib/watir-webdriver/elements/{select_list.rb → select.rb} +8 -9
- data/lib/watir-webdriver/elements/text_field.rb +32 -3
- data/lib/watir-webdriver/html.rb +18 -0
- data/lib/watir-webdriver/html/generator.rb +112 -0
- data/lib/watir-webdriver/html/idl_sorter.rb +49 -0
- data/lib/watir-webdriver/html/spec_extractor.rb +111 -0
- data/lib/watir-webdriver/html/util.rb +31 -0
- data/lib/watir-webdriver/html/visitor.rb +186 -0
- data/lib/watir-webdriver/locators/element_locator.rb +4 -0
- data/lib/watir-webdriver/locators/text_field_locator.rb +2 -2
- data/lib/watir-webdriver/xpath_support.rb +3 -5
- data/lib/yard/handlers/watir.rb +57 -0
- data/spec/{base_element_spec.rb → element_spec.rb} +3 -2
- data/spec/input_spec.rb +65 -0
- data/spec/spec_helper.rb +9 -2
- data/spec/watirspec/area_spec.rb +9 -13
- data/spec/watirspec/areas_spec.rb +7 -1
- data/spec/watirspec/browser_spec.rb +68 -72
- data/spec/watirspec/button_spec.rb +16 -9
- data/spec/watirspec/buttons_spec.rb +11 -9
- data/spec/watirspec/checkbox_spec.rb +1 -1
- data/spec/watirspec/checkboxes_spec.rb +7 -1
- data/spec/watirspec/collections_spec.rb +18 -0
- data/spec/watirspec/dd_spec.rb +1 -1
- data/spec/watirspec/dds_spec.rb +7 -1
- data/spec/watirspec/del_spec.rb +141 -0
- data/spec/watirspec/dels_spec.rb +37 -0
- data/spec/watirspec/div_spec.rb +6 -22
- data/spec/watirspec/divs_spec.rb +8 -2
- data/spec/watirspec/dl_spec.rb +1 -1
- data/spec/watirspec/dls_spec.rb +7 -1
- data/spec/watirspec/dt_spec.rb +1 -1
- data/spec/watirspec/dts_spec.rb +7 -1
- data/spec/watirspec/element_spec.rb +11 -20
- data/spec/watirspec/em_spec.rb +1 -1
- data/spec/watirspec/ems_spec.rb +7 -1
- data/spec/watirspec/filefield_spec.rb +8 -11
- data/spec/watirspec/filefields_spec.rb +7 -1
- data/spec/watirspec/font_spec.rb +2 -2
- data/spec/watirspec/form_spec.rb +10 -18
- data/spec/watirspec/forms_spec.rb +7 -1
- data/spec/watirspec/frame_spec.rb +69 -73
- data/spec/watirspec/frames_spec.rb +15 -2
- data/spec/watirspec/hidden_spec.rb +1 -1
- data/spec/watirspec/hiddens_spec.rb +7 -1
- data/spec/watirspec/hn_spec.rb +1 -1
- data/spec/watirspec/hns_spec.rb +23 -27
- data/spec/watirspec/image_spec.rb +9 -15
- data/spec/watirspec/images_spec.rb +7 -1
- data/spec/watirspec/ins_spec.rb +142 -0
- data/spec/watirspec/inses_spec.rb +37 -0
- data/spec/watirspec/label_spec.rb +1 -1
- data/spec/watirspec/labels_spec.rb +7 -1
- data/spec/watirspec/li_spec.rb +1 -1
- data/spec/watirspec/lib/guards.rb +12 -12
- data/spec/watirspec/lib/implementation.rb +48 -0
- data/spec/watirspec/lib/watirspec.rb +17 -12
- data/spec/watirspec/link_spec.rb +6 -11
- data/spec/watirspec/links_spec.rb +1 -1
- data/spec/watirspec/lis_spec.rb +7 -1
- data/spec/watirspec/map_spec.rb +1 -1
- data/spec/watirspec/maps_spec.rb +7 -1
- data/spec/watirspec/meta_spec.rb +13 -15
- data/spec/watirspec/metas_spec.rb +6 -1
- data/spec/watirspec/ol_spec.rb +57 -59
- data/spec/watirspec/ols_spec.rb +10 -4
- data/spec/watirspec/option_spec.rb +50 -83
- data/spec/watirspec/p_spec.rb +1 -1
- data/spec/watirspec/pre_spec.rb +1 -1
- data/spec/watirspec/pres_spec.rb +7 -1
- data/spec/watirspec/ps_spec.rb +7 -1
- data/spec/watirspec/radio_spec.rb +9 -11
- data/spec/watirspec/radios_spec.rb +1 -1
- data/spec/watirspec/select_list_spec.rb +27 -40
- data/spec/watirspec/select_lists_spec.rb +1 -1
- data/spec/watirspec/span_spec.rb +1 -1
- data/spec/watirspec/spans_spec.rb +7 -1
- data/spec/watirspec/spec_helper.rb +1 -0
- data/spec/watirspec/strong_spec.rb +1 -1
- data/spec/watirspec/strongs_spec.rb +7 -1
- data/spec/watirspec/table_bodies_spec.rb +22 -10
- data/spec/watirspec/table_body_spec.rb +33 -40
- data/spec/watirspec/table_cell_spec.rb +1 -1
- data/spec/watirspec/table_cells_spec.rb +36 -15
- data/spec/watirspec/table_footer_spec.rb +43 -40
- data/spec/watirspec/table_footers_spec.rb +35 -19
- data/spec/watirspec/table_header_spec.rb +44 -39
- data/spec/watirspec/table_headers_spec.rb +37 -19
- data/spec/watirspec/table_row_spec.rb +13 -9
- data/spec/watirspec/table_rows_spec.rb +16 -6
- data/spec/watirspec/table_spec.rb +83 -62
- data/spec/watirspec/tables_spec.rb +7 -1
- data/spec/watirspec/text_field_spec.rb +4 -6
- data/spec/watirspec/text_fields_spec.rb +1 -1
- data/spec/watirspec/ul_spec.rb +1 -1
- data/spec/watirspec/uls_spec.rb +25 -22
- data/support/html5.html +89235 -0
- data/watir-webdriver.gemspec +31 -21
- metadata +52 -23
- data/TODO +0 -15
- data/lib/watir-webdriver/base_element.rb +0 -361
- data/lib/watir-webdriver/collections/buttons_collection.rb +0 -15
- data/lib/watir-webdriver/collections/table_rows_collection.rb +0 -16
- data/lib/watir-webdriver/collections/text_fields_collection.rb +0 -15
- data/lib/watir-webdriver/elements/headings.rb +0 -48
- data/support/html5/html5.idl +0 -1274
- data/support/html5/old/html5.idl +0 -962
- data/support/html5/old/html5_extras.idl +0 -145
- data/support/html5/watir_visitor.rb +0 -173
- data/support/yard_handlers.rb +0 -87
@@ -1,5 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
require File.dirname(__FILE__)
|
2
|
+
require File.expand_path('spec_helper', File.dirname(__FILE__))
|
3
3
|
|
4
4
|
describe "TableCells" do
|
5
5
|
|
@@ -7,40 +7,61 @@ describe "TableCells" do
|
|
7
7
|
browser.goto(WatirSpec.files + "/tables.html")
|
8
8
|
end
|
9
9
|
|
10
|
-
# describe "#length" do
|
11
|
-
# it "returns the number of cells" do
|
12
|
-
# browser.table(:id, 'outer').cells.length.should == 6
|
13
|
-
# browser.table(:id, 'inner').cells.length.should == 2
|
14
|
-
# end
|
15
|
-
# end
|
16
|
-
#
|
17
|
-
# describe "#[]" do
|
18
|
-
# it "returns the row at the given index" do
|
19
|
-
# browser.table(:id, 'outer').cells[0].text.should == "Table 1, Row 1, Cell 1"
|
20
|
-
# browser.table(:id, 'inner').cells[0].text.should == "Table 2, Row 1, Cell 1"
|
21
|
-
# browser.table(:id, 'outer').cells[6].text.should == "Table 1, Row 3, Cell 2"
|
22
|
-
# end
|
23
|
-
# end
|
10
|
+
# describe "#length" do
|
11
|
+
# it "returns the number of cells" do
|
12
|
+
# browser.table(:id, 'outer').cells.length.should == 6
|
13
|
+
# browser.table(:id, 'inner').cells.length.should == 2
|
14
|
+
# end
|
15
|
+
# end
|
16
|
+
#
|
17
|
+
# describe "#[]" do
|
18
|
+
# it "returns the row at the given index" do
|
19
|
+
# browser.table(:id, 'outer').cells[0].text.should == "Table 1, Row 1, Cell 1"
|
20
|
+
# browser.table(:id, 'inner').cells[0].text.should == "Table 2, Row 1, Cell 1"
|
21
|
+
# browser.table(:id, 'outer').cells[6].text.should == "Table 1, Row 3, Cell 2"
|
22
|
+
# end
|
23
|
+
# end
|
24
24
|
|
25
25
|
describe "#each" do
|
26
26
|
it "iterates through cells correctly" do
|
27
27
|
# All cells on the page
|
28
|
+
count = 0
|
29
|
+
|
28
30
|
browser.cells.each_with_index do |c, index|
|
29
31
|
c.id.should == browser.cell(:index, index).id
|
30
32
|
c.value.should == browser.cell(:index, index).value
|
33
|
+
|
34
|
+
count += 1
|
31
35
|
end
|
36
|
+
|
37
|
+
count.should > 0
|
38
|
+
|
32
39
|
# Cells inside a table
|
40
|
+
count = 0
|
41
|
+
|
33
42
|
inner_table = browser.table(:id, 'inner')
|
34
43
|
inner_table.cells.each_with_index do |c, index|
|
35
44
|
c.id.should == inner_table.cell(:index, index).id
|
36
45
|
c.value.should == inner_table.cell(:index, index).value
|
46
|
+
|
47
|
+
count += 1
|
37
48
|
end
|
49
|
+
|
50
|
+
count.should > 0
|
51
|
+
|
52
|
+
|
38
53
|
# Cells inside a table (should not include cells inside a table inside a table)
|
39
54
|
outer_table = browser.table(:id, 'outer')
|
55
|
+
count = 0
|
56
|
+
|
40
57
|
outer_table.cells.each_with_index do |c, index|
|
41
58
|
c.id.should == outer_table.cell(:index, index).id
|
42
59
|
c.value.should == outer_table.cell(:index, index).value
|
60
|
+
|
61
|
+
count += 1
|
43
62
|
end
|
63
|
+
|
64
|
+
count.should > 0
|
44
65
|
end
|
45
66
|
end
|
46
67
|
|
@@ -1,53 +1,52 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
require File.dirname(__FILE__)
|
2
|
+
require File.expand_path('spec_helper', File.dirname(__FILE__))
|
3
3
|
|
4
|
-
|
4
|
+
describe "TableFooter" do
|
5
|
+
before :each do
|
6
|
+
browser.goto(WatirSpec.files + "/tables.html")
|
7
|
+
end
|
5
8
|
|
6
|
-
describe "
|
7
|
-
|
8
|
-
browser.
|
9
|
+
describe "#exists?" do
|
10
|
+
it "returns true if the table tfoot exists (page context)" do
|
11
|
+
browser.tfoot(:id, 'tax_totals').should exist
|
12
|
+
browser.tfoot(:id, /tax_totals/).should exist
|
13
|
+
browser.tfoot(:index, 0).should exist
|
14
|
+
browser.tfoot(:xpath, "//tfoot[@id='tax_totals']").should exist
|
9
15
|
end
|
10
16
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
end
|
18
|
-
|
19
|
-
it "returns true if the table tfoot exists (table context)" do
|
20
|
-
browser.table(:index, 0).tfoot(:id, 'tax_totals').should exist
|
21
|
-
browser.table(:index, 0).tfoot(:id, /tax_totals/).should exist
|
22
|
-
browser.table(:index, 0).tfoot(:index, 0).should exist
|
23
|
-
browser.table(:index, 0).tfoot(:xpath, "//tfoot[@id='tax_totals']").should exist
|
24
|
-
end
|
17
|
+
it "returns true if the table tfoot exists (table context)" do
|
18
|
+
browser.table(:index, 0).tfoot(:id, 'tax_totals').should exist
|
19
|
+
browser.table(:index, 0).tfoot(:id, /tax_totals/).should exist
|
20
|
+
browser.table(:index, 0).tfoot(:index, 0).should exist
|
21
|
+
browser.table(:index, 0).tfoot(:xpath, "//tfoot[@id='tax_totals']").should exist
|
22
|
+
end
|
25
23
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
24
|
+
it "returns false if the table tfoot doesn't exist (page context)" do
|
25
|
+
browser.tfoot(:id, 'no_such_id').should_not exist
|
26
|
+
browser.tfoot(:id, /no_such_id/).should_not exist
|
27
|
+
browser.tfoot(:index, 1337).should_not exist
|
28
|
+
browser.tfoot(:xpath, "//tfoot[@id='no_such_id']").should_not exist
|
29
|
+
end
|
32
30
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
31
|
+
it "returns false if the table tfoot doesn't exist (table context)" do
|
32
|
+
browser.table(:index, 0).tfoot(:id, 'no_such_id').should_not exist
|
33
|
+
browser.table(:index, 0).tfoot(:id, /no_such_id/).should_not exist
|
34
|
+
browser.table(:index, 0).tfoot(:index, 1337).should_not exist
|
35
|
+
browser.table(:index, 0).tfoot(:xpath, "//tfoot[@id='no_such_id']").should_not exist
|
36
|
+
end
|
39
37
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
38
|
+
it "raises TypeError when 'what' argument is invalid" do
|
39
|
+
lambda { browser.tfoot(:id, 3.14).exists? }.should raise_error(TypeError)
|
40
|
+
lambda { browser.table(:index, 0).tfoot(:id, 3.14).exists? }.should raise_error(TypeError)
|
41
|
+
end
|
44
42
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
end
|
43
|
+
it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
|
44
|
+
lambda { browser.tfoot(:no_such_how, 'some_value').exists? }.should raise_error(MissingWayOfFindingObjectException)
|
45
|
+
lambda { browser.table(:index, 0).tfoot(:no_such_how, 'some_value').exists? }.should raise_error(MissingWayOfFindingObjectException)
|
49
46
|
end
|
47
|
+
end
|
50
48
|
|
49
|
+
bug "http://github.com/jarib/watir-webdriver/issues/#issue/2", :webdriver do
|
51
50
|
describe "#length" do
|
52
51
|
it "returns the correct number of table footers (page context)" do
|
53
52
|
browser.tfoot(:id, 'tax_totals').length.should == 1
|
@@ -57,7 +56,9 @@ bug "WTR-358", :watir do
|
|
57
56
|
browser.table(:index, 0).tfoot(:id, 'tax_totals').length.should == 1
|
58
57
|
end
|
59
58
|
end
|
59
|
+
end
|
60
60
|
|
61
|
+
bug "http://github.com/jarib/watir-webdriver/issues/#issue/2", :webdriver do
|
61
62
|
describe "#[]" do
|
62
63
|
it "returns the row at the given index (page context)" do
|
63
64
|
browser.tfoot(:id, 'tax_totals')[0].id.should == 'tfoot_row_1'
|
@@ -71,7 +72,9 @@ bug "WTR-358", :watir do
|
|
71
72
|
browser.table(:index, 0).tfoot(:id, 'tax_totals')[0][2].text.should == '5 577'
|
72
73
|
end
|
73
74
|
end
|
75
|
+
end
|
74
76
|
|
77
|
+
bug "http://github.com/jarib/watir-webdriver/issues/#issue/2", :webdriver do
|
75
78
|
describe "#each" do
|
76
79
|
it "iterates through rows correctly" do
|
77
80
|
tfoot = browser.table(:index, 0).tfoot(:id, 'tax_totals')
|
@@ -82,4 +85,4 @@ bug "WTR-358", :watir do
|
|
82
85
|
end
|
83
86
|
end
|
84
87
|
|
85
|
-
end
|
88
|
+
end
|
@@ -1,47 +1,63 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
require File.dirname(__FILE__)
|
2
|
+
require File.expand_path('spec_helper', File.dirname(__FILE__))
|
3
3
|
|
4
|
-
|
4
|
+
describe "TableFooters" do
|
5
|
+
before :each do
|
6
|
+
browser.goto(WatirSpec.files + "/tables.html")
|
7
|
+
end
|
5
8
|
|
6
|
-
describe "
|
7
|
-
|
8
|
-
browser.
|
9
|
+
describe "#length" do
|
10
|
+
it "returns the correct number of table tfoots (page context)" do
|
11
|
+
browser.tfoots.length.should == 1
|
9
12
|
end
|
10
13
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
14
|
+
it "returns the correct number of table tfoots (table context)" do
|
15
|
+
browser.table(:index, 0).tfoots.length.should == 1
|
16
|
+
end
|
17
|
+
end
|
15
18
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
+
describe "#[]" do
|
20
|
+
it "returns the row at the given index (page context)" do
|
21
|
+
browser.tfoots[0].id.should == "tax_totals"
|
19
22
|
end
|
20
23
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
24
|
+
it "returns the row at the given index (table context)" do
|
25
|
+
browser.table(:index, 0).tfoots[0].id.should == "tax_totals"
|
26
|
+
end
|
27
|
+
end
|
25
28
|
|
26
|
-
|
27
|
-
|
29
|
+
describe "#each" do
|
30
|
+
it "iterates through table tfoots correctly (page context)" do
|
31
|
+
browser.tfoots.each_with_index do |tfoot, index|
|
32
|
+
tfoot.id.should == browser.tfoot(:index, index).id
|
28
33
|
end
|
29
34
|
end
|
30
35
|
|
31
36
|
describe "#each" do
|
32
37
|
it "iterates through table tfoots correctly (page context)" do
|
38
|
+
count = 0
|
39
|
+
|
33
40
|
browser.tfoots.each_with_index do |tfoot, index|
|
34
41
|
tfoot.id.should == browser.tfoot(:index, index).id
|
42
|
+
|
43
|
+
count += 1
|
35
44
|
end
|
45
|
+
|
46
|
+
count.should > 0
|
36
47
|
end
|
37
48
|
|
38
49
|
it "iterates through table tfoots correctly (table context)" do
|
39
50
|
table = browser.table(:index, 0)
|
51
|
+
count = 0
|
52
|
+
|
40
53
|
table.tfoots.each_with_index do |tfoot, index|
|
41
54
|
tfoot.id.should == table.tfoot(:index, index).id
|
55
|
+
|
56
|
+
count += 1
|
42
57
|
end
|
58
|
+
|
59
|
+
count.should > 0
|
43
60
|
end
|
44
61
|
end
|
45
62
|
end
|
46
|
-
|
47
63
|
end
|
@@ -1,53 +1,53 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
require File.dirname(__FILE__)
|
2
|
+
require File.expand_path('spec_helper', File.dirname(__FILE__))
|
3
3
|
|
4
|
-
|
5
|
-
describe "TableHeader" do
|
4
|
+
describe "TableHeader" do
|
6
5
|
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
before :each do
|
7
|
+
browser.goto(WatirSpec.files + "/tables.html")
|
8
|
+
end
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
10
|
+
describe "#exists?" do
|
11
|
+
it "returns true if the table theader exists (page context)" do
|
12
|
+
browser.thead(:id, 'tax_headers').should exist
|
13
|
+
browser.thead(:id, /tax_headers/).should exist
|
14
|
+
browser.thead(:index, 0).should exist
|
15
|
+
browser.thead(:xpath, "//thead[@id='tax_headers']").should exist
|
16
|
+
end
|
18
17
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
it "returns true if the table theader exists (table context)" do
|
19
|
+
browser.table(:index, 0).thead(:id, 'tax_headers').should exist
|
20
|
+
browser.table(:index, 0).thead(:id, /tax_headers/).should exist
|
21
|
+
browser.table(:index, 0).thead(:index, 0).should exist
|
22
|
+
browser.table(:index, 0).thead(:xpath, "//thead[@id='tax_headers']").should exist
|
23
|
+
end
|
25
24
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
25
|
+
it "returns false if the table theader doesn't exist (page context)" do
|
26
|
+
browser.thead(:id, 'no_such_id').should_not exist
|
27
|
+
browser.thead(:id, /no_such_id/).should_not exist
|
28
|
+
browser.thead(:index, 1337).should_not exist
|
29
|
+
browser.thead(:xpath, "//thead[@id='no_such_id']").should_not exist
|
30
|
+
end
|
32
31
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
32
|
+
it "returns false if the table theader doesn't exist (table context)" do
|
33
|
+
browser.table(:index, 0).thead(:id, 'no_such_id').should_not exist
|
34
|
+
browser.table(:index, 0).thead(:id, /no_such_id/).should_not exist
|
35
|
+
browser.table(:index, 0).thead(:index, 1337).should_not exist
|
36
|
+
browser.table(:index, 0).thead(:xpath, "//thead[@id='no_such_id']").should_not exist
|
37
|
+
end
|
39
38
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
it "raises TypeError when 'what' argument is invalid" do
|
40
|
+
lambda { browser.thead(:id, 3.14).exists? }.should raise_error(TypeError)
|
41
|
+
lambda { browser.table(:index, 0).thead(:id, 3.14).exists? }.should raise_error(TypeError)
|
42
|
+
end
|
44
43
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
end
|
44
|
+
it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
|
45
|
+
lambda { browser.thead(:no_such_how, 'some_value').exists? }.should raise_error(MissingWayOfFindingObjectException)
|
46
|
+
lambda { browser.table(:index, 0).thead(:no_such_how, 'some_value').exists? }.should raise_error(MissingWayOfFindingObjectException)
|
49
47
|
end
|
48
|
+
end
|
50
49
|
|
50
|
+
bug "http://github.com/jarib/watir-webdriver/issues/#issue/2", :webdriver do
|
51
51
|
describe "#length" do
|
52
52
|
it "returns the correct number of table bodies (page context)" do
|
53
53
|
browser.thead(:id, 'tax_headers').length.should == 1
|
@@ -57,7 +57,9 @@ bug "WTR-357", :watir do
|
|
57
57
|
browser.table(:index, 0).thead(:id, 'tax_headers').length.should == 1
|
58
58
|
end
|
59
59
|
end
|
60
|
+
end
|
60
61
|
|
62
|
+
bug "http://github.com/jarib/watir-webdriver/issues/#issue/2", :webdriver do
|
61
63
|
describe "#[]" do
|
62
64
|
it "returns the row at the given index (page context)" do
|
63
65
|
browser.thead(:id, 'tax_headers')[0].id.should == 'thead_row_1'
|
@@ -71,7 +73,9 @@ bug "WTR-357", :watir do
|
|
71
73
|
browser.table(:index, 0).thead(:id, 'tax_headers')[0][2].text.should == 'Income tax'
|
72
74
|
end
|
73
75
|
end
|
76
|
+
end
|
74
77
|
|
78
|
+
bug "http://github.com/jarib/watir-webdriver/issues/#issue/2", :webdriver do
|
75
79
|
describe "#each" do
|
76
80
|
it "iterates through rows correctly" do
|
77
81
|
theader = browser.table(:index, 0).thead(:id, 'tax_headers')
|
@@ -82,4 +86,5 @@ bug "WTR-357", :watir do
|
|
82
86
|
end
|
83
87
|
end
|
84
88
|
end
|
89
|
+
|
85
90
|
end
|
@@ -1,45 +1,63 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
require File.dirname(__FILE__)
|
2
|
+
require File.expand_path('spec_helper', File.dirname(__FILE__))
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
describe "TableHeaders" do
|
5
|
+
before :each do
|
6
|
+
browser.goto(WatirSpec.files + "/tables.html")
|
7
|
+
end
|
8
|
+
|
9
|
+
describe "#length" do
|
10
|
+
it "returns the correct number of table theads (page context)" do
|
11
|
+
browser.theads.length.should == 1
|
8
12
|
end
|
9
13
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
+
it "returns the correct number of table theads (table context)" do
|
15
|
+
browser.table(:index, 0).theads.length.should == 1
|
16
|
+
end
|
17
|
+
end
|
14
18
|
|
15
|
-
|
16
|
-
|
17
|
-
|
19
|
+
describe "#[]" do
|
20
|
+
it "returns the row at the given index (page context)" do
|
21
|
+
browser.theads[0].id.should == "tax_headers"
|
18
22
|
end
|
19
23
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
+
it "returns the row at the given index (table context)" do
|
25
|
+
browser.table(:index, 0).theads[0].id.should == "tax_headers"
|
26
|
+
end
|
27
|
+
end
|
24
28
|
|
25
|
-
|
26
|
-
|
29
|
+
describe "#each" do
|
30
|
+
it "iterates through table theads correctly (page context)" do
|
31
|
+
browser.theads.each_with_index do |thead, index|
|
32
|
+
thead.id.should == browser.thead(:index, index).id
|
27
33
|
end
|
28
34
|
end
|
29
35
|
|
30
36
|
describe "#each" do
|
31
37
|
it "iterates through table theads correctly (page context)" do
|
38
|
+
count = 0
|
39
|
+
|
32
40
|
browser.theads.each_with_index do |thead, index|
|
33
41
|
thead.id.should == browser.thead(:index, index).id
|
42
|
+
|
43
|
+
count += 1
|
34
44
|
end
|
45
|
+
|
46
|
+
count.should > 0
|
35
47
|
end
|
36
48
|
|
37
49
|
it "iterates through table theads correctly (table context)" do
|
38
50
|
table = browser.table(:index, 0)
|
51
|
+
count = 0
|
52
|
+
|
39
53
|
table.theads.each_with_index do |thead, index|
|
40
54
|
thead.id.should == table.thead(:index, index).id
|
55
|
+
|
56
|
+
count += 1
|
41
57
|
end
|
58
|
+
|
59
|
+
count.should > 0
|
42
60
|
end
|
43
61
|
end
|
44
62
|
end
|
45
|
-
end
|
63
|
+
end
|