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.
Files changed (129) hide show
  1. data/Rakefile +53 -31
  2. data/VERSION +1 -1
  3. data/lib/watir-webdriver.rb +6 -8
  4. data/lib/watir-webdriver/attribute_helper.rb +121 -0
  5. data/lib/watir-webdriver/browser.rb +13 -6
  6. data/lib/watir-webdriver/collections/element_collection.rb +21 -15
  7. data/lib/watir-webdriver/collections/table_row_collection.rb +11 -0
  8. data/lib/watir-webdriver/container.rb +17 -11
  9. data/lib/watir-webdriver/element.rb +201 -0
  10. data/lib/watir-webdriver/elements/button.rb +19 -2
  11. data/lib/watir-webdriver/elements/checkbox.rb +24 -4
  12. data/lib/watir-webdriver/elements/file_field.rb +24 -4
  13. data/lib/watir-webdriver/elements/font.rb +10 -11
  14. data/lib/watir-webdriver/elements/frame.rb +11 -3
  15. data/lib/watir-webdriver/elements/generated.rb +2491 -1313
  16. data/lib/watir-webdriver/elements/hidden.rb +16 -5
  17. data/lib/watir-webdriver/elements/input.rb +44 -5
  18. data/lib/watir-webdriver/elements/link.rb +6 -8
  19. data/lib/watir-webdriver/elements/radio.rb +25 -6
  20. data/lib/watir-webdriver/elements/{select_list.rb → select.rb} +8 -9
  21. data/lib/watir-webdriver/elements/text_field.rb +32 -3
  22. data/lib/watir-webdriver/html.rb +18 -0
  23. data/lib/watir-webdriver/html/generator.rb +112 -0
  24. data/lib/watir-webdriver/html/idl_sorter.rb +49 -0
  25. data/lib/watir-webdriver/html/spec_extractor.rb +111 -0
  26. data/lib/watir-webdriver/html/util.rb +31 -0
  27. data/lib/watir-webdriver/html/visitor.rb +186 -0
  28. data/lib/watir-webdriver/locators/element_locator.rb +4 -0
  29. data/lib/watir-webdriver/locators/text_field_locator.rb +2 -2
  30. data/lib/watir-webdriver/xpath_support.rb +3 -5
  31. data/lib/yard/handlers/watir.rb +57 -0
  32. data/spec/{base_element_spec.rb → element_spec.rb} +3 -2
  33. data/spec/input_spec.rb +65 -0
  34. data/spec/spec_helper.rb +9 -2
  35. data/spec/watirspec/area_spec.rb +9 -13
  36. data/spec/watirspec/areas_spec.rb +7 -1
  37. data/spec/watirspec/browser_spec.rb +68 -72
  38. data/spec/watirspec/button_spec.rb +16 -9
  39. data/spec/watirspec/buttons_spec.rb +11 -9
  40. data/spec/watirspec/checkbox_spec.rb +1 -1
  41. data/spec/watirspec/checkboxes_spec.rb +7 -1
  42. data/spec/watirspec/collections_spec.rb +18 -0
  43. data/spec/watirspec/dd_spec.rb +1 -1
  44. data/spec/watirspec/dds_spec.rb +7 -1
  45. data/spec/watirspec/del_spec.rb +141 -0
  46. data/spec/watirspec/dels_spec.rb +37 -0
  47. data/spec/watirspec/div_spec.rb +6 -22
  48. data/spec/watirspec/divs_spec.rb +8 -2
  49. data/spec/watirspec/dl_spec.rb +1 -1
  50. data/spec/watirspec/dls_spec.rb +7 -1
  51. data/spec/watirspec/dt_spec.rb +1 -1
  52. data/spec/watirspec/dts_spec.rb +7 -1
  53. data/spec/watirspec/element_spec.rb +11 -20
  54. data/spec/watirspec/em_spec.rb +1 -1
  55. data/spec/watirspec/ems_spec.rb +7 -1
  56. data/spec/watirspec/filefield_spec.rb +8 -11
  57. data/spec/watirspec/filefields_spec.rb +7 -1
  58. data/spec/watirspec/font_spec.rb +2 -2
  59. data/spec/watirspec/form_spec.rb +10 -18
  60. data/spec/watirspec/forms_spec.rb +7 -1
  61. data/spec/watirspec/frame_spec.rb +69 -73
  62. data/spec/watirspec/frames_spec.rb +15 -2
  63. data/spec/watirspec/hidden_spec.rb +1 -1
  64. data/spec/watirspec/hiddens_spec.rb +7 -1
  65. data/spec/watirspec/hn_spec.rb +1 -1
  66. data/spec/watirspec/hns_spec.rb +23 -27
  67. data/spec/watirspec/image_spec.rb +9 -15
  68. data/spec/watirspec/images_spec.rb +7 -1
  69. data/spec/watirspec/ins_spec.rb +142 -0
  70. data/spec/watirspec/inses_spec.rb +37 -0
  71. data/spec/watirspec/label_spec.rb +1 -1
  72. data/spec/watirspec/labels_spec.rb +7 -1
  73. data/spec/watirspec/li_spec.rb +1 -1
  74. data/spec/watirspec/lib/guards.rb +12 -12
  75. data/spec/watirspec/lib/implementation.rb +48 -0
  76. data/spec/watirspec/lib/watirspec.rb +17 -12
  77. data/spec/watirspec/link_spec.rb +6 -11
  78. data/spec/watirspec/links_spec.rb +1 -1
  79. data/spec/watirspec/lis_spec.rb +7 -1
  80. data/spec/watirspec/map_spec.rb +1 -1
  81. data/spec/watirspec/maps_spec.rb +7 -1
  82. data/spec/watirspec/meta_spec.rb +13 -15
  83. data/spec/watirspec/metas_spec.rb +6 -1
  84. data/spec/watirspec/ol_spec.rb +57 -59
  85. data/spec/watirspec/ols_spec.rb +10 -4
  86. data/spec/watirspec/option_spec.rb +50 -83
  87. data/spec/watirspec/p_spec.rb +1 -1
  88. data/spec/watirspec/pre_spec.rb +1 -1
  89. data/spec/watirspec/pres_spec.rb +7 -1
  90. data/spec/watirspec/ps_spec.rb +7 -1
  91. data/spec/watirspec/radio_spec.rb +9 -11
  92. data/spec/watirspec/radios_spec.rb +1 -1
  93. data/spec/watirspec/select_list_spec.rb +27 -40
  94. data/spec/watirspec/select_lists_spec.rb +1 -1
  95. data/spec/watirspec/span_spec.rb +1 -1
  96. data/spec/watirspec/spans_spec.rb +7 -1
  97. data/spec/watirspec/spec_helper.rb +1 -0
  98. data/spec/watirspec/strong_spec.rb +1 -1
  99. data/spec/watirspec/strongs_spec.rb +7 -1
  100. data/spec/watirspec/table_bodies_spec.rb +22 -10
  101. data/spec/watirspec/table_body_spec.rb +33 -40
  102. data/spec/watirspec/table_cell_spec.rb +1 -1
  103. data/spec/watirspec/table_cells_spec.rb +36 -15
  104. data/spec/watirspec/table_footer_spec.rb +43 -40
  105. data/spec/watirspec/table_footers_spec.rb +35 -19
  106. data/spec/watirspec/table_header_spec.rb +44 -39
  107. data/spec/watirspec/table_headers_spec.rb +37 -19
  108. data/spec/watirspec/table_row_spec.rb +13 -9
  109. data/spec/watirspec/table_rows_spec.rb +16 -6
  110. data/spec/watirspec/table_spec.rb +83 -62
  111. data/spec/watirspec/tables_spec.rb +7 -1
  112. data/spec/watirspec/text_field_spec.rb +4 -6
  113. data/spec/watirspec/text_fields_spec.rb +1 -1
  114. data/spec/watirspec/ul_spec.rb +1 -1
  115. data/spec/watirspec/uls_spec.rb +25 -22
  116. data/support/html5.html +89235 -0
  117. data/watir-webdriver.gemspec +31 -21
  118. metadata +52 -23
  119. data/TODO +0 -15
  120. data/lib/watir-webdriver/base_element.rb +0 -361
  121. data/lib/watir-webdriver/collections/buttons_collection.rb +0 -15
  122. data/lib/watir-webdriver/collections/table_rows_collection.rb +0 -16
  123. data/lib/watir-webdriver/collections/text_fields_collection.rb +0 -15
  124. data/lib/watir-webdriver/elements/headings.rb +0 -48
  125. data/support/html5/html5.idl +0 -1274
  126. data/support/html5/old/html5.idl +0 -962
  127. data/support/html5/old/html5_extras.idl +0 -145
  128. data/support/html5/watir_visitor.rb +0 -173
  129. data/support/yard_handlers.rb +0 -87
@@ -35,21 +35,26 @@ module WatirSpec
35
35
  end
36
36
 
37
37
  def implementation
38
- @implementation ||= case Browser.name
39
- when "Watir::IE"
40
- :watir
41
- when "Watir::Firefox", "FireWatir::Firefox"
42
- :firewatir
43
- when "Celerity::Browser"
44
- :celerity
45
- else
46
- :unknown
47
- end
38
+ @implementation ||= (
39
+ imp = WatirSpec::Implementation.new
40
+ yield imp if block_given?
41
+
42
+ imp
43
+ )
44
+ end
45
+
46
+ def implementation=(imp)
47
+ unless imp.kind_of? WatirSpec::Implementation
48
+ raise TypeError, "expected WatirSpec::Implementation, got #{imp.class}"
49
+ end
50
+
51
+ @implementation = imp
48
52
  end
49
53
 
50
54
  def new_browser
51
- args = WatirSpec.browser_args
52
- args ? Browser.new(*args) : Browser.new
55
+ klass = WatirSpec.implementation.browser_class
56
+ args = WatirSpec.implementation.browser_args
57
+ args ? klass.new(*args) : klass.new
53
58
  end
54
59
 
55
60
  def ruby
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.dirname(__FILE__) + '/spec_helper'
2
+ require File.expand_path('spec_helper', File.dirname(__FILE__))
3
3
 
4
4
  describe "Link" do
5
5
 
@@ -22,11 +22,8 @@ describe "Link" do
22
22
  browser.link(:xpath, "//a[@id='link_2']").should exist
23
23
  end
24
24
 
25
- not_compliant_on :webdriver do
26
- # not a technical issue - just not sure if it's really the behaviour we want
27
- it "strips spaces from URL attributes when locating elements" do
28
- browser.link(:url, /strip_space$/).should exist
29
- end
25
+ it "strips spaces from URL attributes when locating elements" do
26
+ browser.link(:url, /strip_space$/).should exist
30
27
  end
31
28
 
32
29
  it "returns false if the link doesn't exist" do
@@ -80,11 +77,9 @@ describe "Link" do
80
77
  end
81
78
  end
82
79
 
83
- bug "WTR-366", :watir do
84
- describe "#url" do
85
- it "returns the href attribute" do
86
- browser.link(:index, 1).url.should =~ /non_control_elements/
87
- end
80
+ describe "#url" do
81
+ it "returns the href attribute" do
82
+ browser.link(:index, 1).url.should =~ /non_control_elements/
88
83
  end
89
84
  end
90
85
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.dirname(__FILE__) + '/spec_helper'
2
+ require File.expand_path('spec_helper', File.dirname(__FILE__))
3
3
 
4
4
  describe "Links" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.dirname(__FILE__) + '/spec_helper'
2
+ require File.expand_path('spec_helper', File.dirname(__FILE__))
3
3
 
4
4
  describe "Lis" do
5
5
 
@@ -21,10 +21,16 @@ describe "Lis" do
21
21
 
22
22
  describe "#each" do
23
23
  it "iterates through lis correctly" do
24
+ count = 0
25
+
24
26
  browser.lis.each_with_index do |l, index|
25
27
  l.id.should == browser.li(:index, index).id
26
28
  l.value.should == browser.li(:index, index).value
29
+
30
+ count += 1
27
31
  end
32
+
33
+ count.should > 0
28
34
  end
29
35
  end
30
36
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.dirname(__FILE__) + '/spec_helper'
2
+ require File.expand_path('spec_helper', File.dirname(__FILE__))
3
3
 
4
4
  describe "Map" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.dirname(__FILE__) + '/spec_helper'
2
+ require File.expand_path('spec_helper', File.dirname(__FILE__))
3
3
 
4
4
  describe "Maps" do
5
5
 
@@ -21,11 +21,17 @@ describe "Maps" do
21
21
 
22
22
  describe "#each" do
23
23
  it "iterates through maps correctly" do
24
+ count = 0
25
+
24
26
  browser.maps.each_with_index do |m, index|
25
27
  m.name.should == browser.map(:index, index).name
26
28
  m.id.should == browser.map(:index, index).id
27
29
  m.value.should == browser.map(:index, index).value
30
+
31
+ count += 1
28
32
  end
33
+
34
+ count.should > 0
29
35
  end
30
36
  end
31
37
 
@@ -1,22 +1,20 @@
1
1
  # encoding: utf-8
2
- require File.dirname(__FILE__) + '/spec_helper'
2
+ require File.expand_path('spec_helper', File.dirname(__FILE__))
3
3
 
4
- bug "WTR-334", :watir do
5
- describe "Meta" do
6
- before :each do
7
- browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
8
- end
4
+ describe "Meta" do
5
+ before :each do
6
+ browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
7
+ end
9
8
 
10
- describe "#exist?" do
11
- it "returns true if the meta tag exists" do
12
- browser.meta(:http_equiv, "Content-Type").should exist
13
- end
9
+ describe "#exist?" do
10
+ it "returns true if the meta tag exists" do
11
+ browser.meta(:http_equiv, "Content-Type").should exist
14
12
  end
13
+ end
15
14
 
16
- describe "content" do
17
- it "returns the content attribute of the tag" do
18
- browser.meta(:http_equiv, "Content-Type").content.should == "text/html; charset=utf-8"
19
- end
15
+ describe "content" do
16
+ it "returns the content attribute of the tag" do
17
+ browser.meta(:http_equiv, "Content-Type").content.should == "text/html; charset=utf-8"
20
18
  end
21
19
  end
22
- end
20
+ end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.dirname(__FILE__) + '/spec_helper'
2
+ require File.expand_path('spec_helper', File.dirname(__FILE__))
3
3
 
4
4
  describe "Metas" do
5
5
 
@@ -21,9 +21,14 @@ describe "Metas" do
21
21
 
22
22
  describe "#each" do
23
23
  it "iterates through meta elements correctly" do
24
+ count = 0
25
+
24
26
  browser.metas.each_with_index do |m, index|
25
27
  m.content.should == browser.meta(:index, index).content
28
+ count += 1
26
29
  end
30
+
31
+ count.should > 0
27
32
  end
28
33
  end
29
34
 
@@ -1,78 +1,76 @@
1
1
  # encoding: utf-8
2
- require File.dirname(__FILE__) + '/spec_helper'
2
+ require File.expand_path('spec_helper', File.dirname(__FILE__))
3
3
 
4
- bug "WTR-333", :watir do
5
- describe "Ol" do
4
+ describe "Ol" do
6
5
 
7
- before :each do
8
- browser.goto(WatirSpec.files + "/non_control_elements.html")
9
- end
10
-
11
- # Exists method
12
- describe "#exist?" do
13
- it "returns true if the 'ol' exists" do
14
- browser.ol(:id, "favorite_compounds").should exist
15
- browser.ol(:id, /favorite_compounds/).should exist
16
- browser.ol(:index, 0).should exist
17
- browser.ol(:xpath, "//ol[@id='favorite_compounds']").should exist
18
- end
6
+ before :each do
7
+ browser.goto(WatirSpec.files + "/non_control_elements.html")
8
+ end
19
9
 
20
- it "returns false if the 'ol' doesn't exist" do
21
- browser.ol(:id, "no_such_id").should_not exist
22
- browser.ol(:id, /no_such_id/).should_not exist
23
- browser.ol(:text, "no_such_text").should_not exist
24
- browser.ol(:text, /no_such_text/).should_not exist
25
- browser.ol(:class, "no_such_class").should_not exist
26
- browser.ol(:class, /no_such_class/).should_not exist
27
- browser.ol(:index, 1337).should_not exist
28
- browser.ol(:xpath, "//ol[@id='no_such_id']").should_not exist
29
- end
10
+ # Exists method
11
+ describe "#exist?" do
12
+ it "returns true if the 'ol' exists" do
13
+ browser.ol(:id, "favorite_compounds").should exist
14
+ browser.ol(:id, /favorite_compounds/).should exist
15
+ browser.ol(:index, 0).should exist
16
+ browser.ol(:xpath, "//ol[@id='favorite_compounds']").should exist
17
+ end
30
18
 
31
- it "raises TypeError when 'what' argument is invalid" do
32
- lambda { browser.ol(:id, 3.14).exists? }.should raise_error(TypeError)
33
- end
19
+ it "returns false if the 'ol' doesn't exist" do
20
+ browser.ol(:id, "no_such_id").should_not exist
21
+ browser.ol(:id, /no_such_id/).should_not exist
22
+ browser.ol(:text, "no_such_text").should_not exist
23
+ browser.ol(:text, /no_such_text/).should_not exist
24
+ browser.ol(:class, "no_such_class").should_not exist
25
+ browser.ol(:class, /no_such_class/).should_not exist
26
+ browser.ol(:index, 1337).should_not exist
27
+ browser.ol(:xpath, "//ol[@id='no_such_id']").should_not exist
28
+ end
34
29
 
35
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
36
- lambda { browser.ol(:no_such_how, 'some_value').exists? }.should raise_error(MissingWayOfFindingObjectException)
37
- end
30
+ it "raises TypeError when 'what' argument is invalid" do
31
+ lambda { browser.ol(:id, 3.14).exists? }.should raise_error(TypeError)
38
32
  end
39
33
 
40
- # Attribute methods
41
- describe "#class_name" do
42
- it "returns the class attribute" do
43
- browser.ol(:id, 'favorite_compounds').class_name.should == 'chemistry'
44
- end
34
+ it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
35
+ lambda { browser.ol(:no_such_how, 'some_value').exists? }.should raise_error(MissingWayOfFindingObjectException)
36
+ end
37
+ end
45
38
 
46
- it "returns an empty string if the element exists and the attribute doesn't" do
47
- browser.ol(:index, 1).class_name.should == ''
48
- end
39
+ # Attribute methods
40
+ describe "#class_name" do
41
+ it "returns the class attribute" do
42
+ browser.ol(:id, 'favorite_compounds').class_name.should == 'chemistry'
43
+ end
49
44
 
50
- it "raises UnknownObjectException if the ol doesn't exist" do
51
- lambda { browser.ol(:id, 'no_such_id').class_name }.should raise_error(UnknownObjectException)
52
- end
45
+ it "returns an empty string if the element exists and the attribute doesn't" do
46
+ browser.ol(:index, 1).class_name.should == ''
53
47
  end
54
48
 
55
- describe "#id" do
56
- it "returns the id attribute" do
57
- browser.ol(:class, 'chemistry').id.should == "favorite_compounds"
58
- end
49
+ it "raises UnknownObjectException if the ol doesn't exist" do
50
+ lambda { browser.ol(:id, 'no_such_id').class_name }.should raise_error(UnknownObjectException)
51
+ end
52
+ end
59
53
 
60
- it "returns an empty string if the element exists and the attribute doesn't" do
61
- browser.ol(:index, 1).id.should == ''
62
- end
54
+ describe "#id" do
55
+ it "returns the id attribute" do
56
+ browser.ol(:class, 'chemistry').id.should == "favorite_compounds"
57
+ end
63
58
 
64
- it "raises UnknownObjectException if the ol doesn't exist" do
65
- lambda { browser.ol(:id, "no_such_id").id }.should raise_error(UnknownObjectException)
66
- lambda { browser.ol(:index, 1337).id }.should raise_error(UnknownObjectException)
67
- end
59
+ it "returns an empty string if the element exists and the attribute doesn't" do
60
+ browser.ol(:index, 1).id.should == ''
68
61
  end
69
62
 
70
- describe "#respond_to?" do
71
- it "returns true for all attribute methods" do
72
- browser.ol(:index, 0).should respond_to(:class_name)
73
- browser.ol(:index, 0).should respond_to(:id)
74
- end
63
+ it "raises UnknownObjectException if the ol doesn't exist" do
64
+ lambda { browser.ol(:id, "no_such_id").id }.should raise_error(UnknownObjectException)
65
+ lambda { browser.ol(:index, 1337).id }.should raise_error(UnknownObjectException)
75
66
  end
67
+ end
76
68
 
69
+ describe "#respond_to?" do
70
+ it "returns true for all attribute methods" do
71
+ browser.ol(:index, 0).should respond_to(:class_name)
72
+ browser.ol(:index, 0).should respond_to(:id)
73
+ end
77
74
  end
78
- end
75
+
76
+ end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.dirname(__FILE__) + '/spec_helper'
2
+ require File.expand_path('spec_helper', File.dirname(__FILE__))
3
3
 
4
4
  describe "Ols" do
5
5
 
@@ -21,10 +21,16 @@ describe "Ols" do
21
21
 
22
22
  describe "#each" do
23
23
  it "iterates through ols correctly" do
24
- browser.ols.each_with_index do |ol, index|
25
- ol.id.should == browser.ol(:index, index).id
26
- ol.value.should == browser.ol(:index, index).value
24
+ count = 0
25
+
26
+ browser.ols.each_with_index do |ul, index|
27
+ ul.id.should == browser.ol(:index, index).id
28
+ ul.value.should == browser.ol(:index, index).value
29
+
30
+ count += 1
27
31
  end
32
+
33
+ count.should > 0
28
34
  end
29
35
  end
30
36
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.dirname(__FILE__) + '/spec_helper'
2
+ require File.expand_path('spec_helper', File.dirname(__FILE__))
3
3
 
4
4
  describe "Option" do
5
5
 
@@ -8,28 +8,21 @@ describe "Option" do
8
8
  end
9
9
 
10
10
  describe "#exists?" do
11
- bug "WTR-367", :watir do
12
- it "returns true if the element exists (page context)" do
13
- bug "WTR-330", :watir do
14
- browser.option(:id, "nor").should exist
15
- browser.option(:id, /nor/).should exist
16
- end
17
- browser.option(:value, "2").should exist
18
- browser.option(:value, /2/).should exist
19
- browser.option(:text, "Norway").should exist
20
- browser.option(:text, /Norway/).should exist
21
- browser.option(:class, "scandinavia").should exist
22
- browser.option(:index, 1).should exist
23
- browser.option(:xpath, "//option[@id='nor']").should exist
24
- end
11
+ it "returns true if the element exists (page context)" do
12
+ browser.option(:id, "nor").should exist
13
+ browser.option(:id, /nor/).should exist
14
+ browser.option(:value, "2").should exist
15
+ browser.option(:value, /2/).should exist
16
+ browser.option(:text, "Norway").should exist
17
+ browser.option(:text, /Norway/).should exist
18
+ browser.option(:class, "scandinavia").should exist
19
+ browser.option(:index, 1).should exist
20
+ browser.option(:xpath, "//option[@id='nor']").should exist
25
21
  end
26
22
 
27
23
  it "returns true if the element exists (select_list context)" do
28
- bug "WTR-330", :watir do
29
- browser.select_list(:name, "new_user_country").option(:id, "nor").should exist
30
- browser.select_list(:name, "new_user_country").option(:id, /nor/).should exist
31
- end
32
-
24
+ browser.select_list(:name, "new_user_country").option(:id, "nor").should exist
25
+ browser.select_list(:name, "new_user_country").option(:id, /nor/).should exist
33
26
  browser.select_list(:name, "new_user_country").option(:value, "2").should exist
34
27
  browser.select_list(:name, "new_user_country").option(:value, /2/).should exist
35
28
  browser.select_list(:name, "new_user_country").option(:text, "Norway").should exist
@@ -41,28 +34,21 @@ describe "Option" do
41
34
  browser.select_list(:name, "new_user_country").option(:label, "Germany").should exist
42
35
  end
43
36
 
44
- bug "WTR-367", :watir do
45
- it "returns false if the element does not exist (page context)" do
46
- bug "WTR-330", :watir do
47
- browser.option(:id, "no_such_id").should_not exist
48
- browser.option(:id, /no_such_id/).should_not exist
49
- end
50
- browser.option(:value, "no_such_value").should_not exist
51
- browser.option(:value, /no_such_value/).should_not exist
52
- browser.option(:text, "no_such_text").should_not exist
53
- browser.option(:text, /no_such_text/).should_not exist
54
- browser.option(:class, "no_such_class").should_not exist
55
- browser.option(:index, 1337).should_not exist
56
- browser.option(:xpath, "//option[@id='no_such_id']").should_not exist
57
- end
37
+ it "returns false if the element does not exist (page context)" do
38
+ browser.option(:id, "no_such_id").should_not exist
39
+ browser.option(:id, /no_such_id/).should_not exist
40
+ browser.option(:value, "no_such_value").should_not exist
41
+ browser.option(:value, /no_such_value/).should_not exist
42
+ browser.option(:text, "no_such_text").should_not exist
43
+ browser.option(:text, /no_such_text/).should_not exist
44
+ browser.option(:class, "no_such_class").should_not exist
45
+ browser.option(:index, 1337).should_not exist
46
+ browser.option(:xpath, "//option[@id='no_such_id']").should_not exist
58
47
  end
59
48
 
60
49
  it "returns false if the element does not exist (select_list context)" do
61
- bug "WTR-330", :watir do
62
- browser.select_list(:name, "new_user_country").option(:id, "no_such_id").should_not exist
63
- browser.select_list(:name, "new_user_country").option(:id, /no_such_id/).should_not exist
64
- end
65
-
50
+ browser.select_list(:name, "new_user_country").option(:id, "no_such_id").should_not exist
51
+ browser.select_list(:name, "new_user_country").option(:id, /no_such_id/).should_not exist
66
52
  browser.select_list(:name, "new_user_country").option(:value, "no_such_value").should_not exist
67
53
  browser.select_list(:name, "new_user_country").option(:value, /no_such_value/).should_not exist
68
54
  browser.select_list(:name, "new_user_country").option(:text, "no_such_text").should_not exist
@@ -73,27 +59,20 @@ describe "Option" do
73
59
  end
74
60
 
75
61
  it "raises TypeError when 'what' argument is invalid" do
76
- bug "WTR-367", :watir do
77
- lambda { browser.option(:id, 3.14).exists? }.should raise_error(TypeError)
78
- end
79
-
62
+ lambda { browser.option(:id, 3.14).exists? }.should raise_error(TypeError)
80
63
  lambda { browser.select_list(:name, "new_user_country").option(:id, 3.14).exists? }.should raise_error(TypeError)
81
64
  end
82
65
 
83
66
  it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
84
- bug "WTR-367", :watir do
85
- lambda { browser.option(:no_such_how, 'some_value').exists? }.should raise_error(MissingWayOfFindingObjectException)
86
- end
67
+ lambda { browser.option(:no_such_how, 'some_value').exists? }.should raise_error(MissingWayOfFindingObjectException)
87
68
  lambda { browser.select_list(:name, "new_user_country").option(:no_such_how, 'some_value').exists? }.should raise_error(MissingWayOfFindingObjectException)
88
69
  end
89
70
  end
90
71
 
91
72
  describe "#select" do
92
- bug "WTR-367", :watir do
93
- it "selects the chosen option (page context)" do
94
- browser.option(:text, "Denmark").select
95
- browser.select_list(:name, "new_user_country").selected_options.should == ["Denmark"]
96
- end
73
+ it "selects the chosen option (page context)" do
74
+ browser.option(:text, "Denmark").select
75
+ browser.select_list(:name, "new_user_country").selected_options.should == ["Denmark"]
97
76
  end
98
77
 
99
78
  it "selects the chosen option (select_list context)" do
@@ -101,22 +80,18 @@ describe "Option" do
101
80
  browser.select_list(:name, "new_user_country").selected_options.should == ["Denmark"]
102
81
  end
103
82
 
104
- bug "WTR-367, WTR-329", :watir do
105
- it "selects the option when found by text (page context)" do
106
- browser.option(:text, 'Sweden').select
107
- browser.option(:text, 'Sweden').should be_selected
108
- end
83
+ it "selects the option when found by text (page context)" do
84
+ browser.option(:text, 'Sweden').select
85
+ browser.option(:text, 'Sweden').should be_selected
86
+ end
109
87
 
110
- it "selects the option when found by text (select_list context)" do
111
- browser.select_list(:name, 'new_user_country').option(:text, 'Sweden').select
112
- browser.select_list(:name, 'new_user_country').option(:text, 'Sweden').should be_selected
113
- end
88
+ it "selects the option when found by text (select_list context)" do
89
+ browser.select_list(:name, 'new_user_country').option(:text, 'Sweden').select
90
+ browser.select_list(:name, 'new_user_country').option(:text, 'Sweden').should be_selected
114
91
  end
115
92
 
116
93
  it "fires the onclick event (page context)" do
117
- bug "WTR-367, WTR-335", :watir do
118
- browser.option(:text, "Username 3").select
119
- end
94
+ browser.option(:text, "Username 3").select
120
95
  browser.text_field(:id, 'delete_user_comment').value.should == 'Don\'t do it!'
121
96
  end
122
97
 
@@ -125,11 +100,9 @@ describe "Option" do
125
100
  browser.text_field(:id, 'delete_user_comment').value.should == 'Don\'t do it!'
126
101
  end
127
102
 
128
- bug "WTR-367", :watir do
129
- it "raises UnknownObjectException if the option does not exist (page context)" do
130
- lambda { browser.option(:text, "no_such_text").select }.should raise_error(UnknownObjectException)
131
- lambda { browser.option(:text, /missing/).select }.should raise_error(UnknownObjectException)
132
- end
103
+ it "raises UnknownObjectException if the option does not exist (page context)" do
104
+ lambda { browser.option(:text, "no_such_text").select }.should raise_error(UnknownObjectException)
105
+ lambda { browser.option(:text, /missing/).select }.should raise_error(UnknownObjectException)
133
106
  end
134
107
 
135
108
  it "raises UnknownObjectException if the option does not exist (select_list context)" do
@@ -137,10 +110,8 @@ describe "Option" do
137
110
  lambda { browser.select_list(:name, "new_user_country").option(:text, /missing/).select }.should raise_error(UnknownObjectException)
138
111
  end
139
112
 
140
- bug "WTR-367", :watir do
141
- it "raises MissingWayOfFindingObjectException when given a bad 'how' (page context)" do
142
- lambda { browser.option(:missing, "Denmark").select }.should raise_error(MissingWayOfFindingObjectException)
143
- end
113
+ it "raises MissingWayOfFindingObjectException when given a bad 'how' (page context)" do
114
+ lambda { browser.option(:missing, "Denmark").select }.should raise_error(MissingWayOfFindingObjectException)
144
115
  end
145
116
 
146
117
  it "raises MissingWayOfFindingObjectException when given a bad 'how' (select_list context)" do
@@ -148,17 +119,13 @@ describe "Option" do
148
119
  end
149
120
  end
150
121
 
151
- bug "WTR-331", :watir do
152
- describe "#class_name" do
153
- bug "WTR-367", :watir do
154
- it "is able to get attributes (page context)" do
155
- browser.option(:text, 'Sweden').class_name.should == "scandinavia"
156
- end
157
- end
158
-
159
- it "is able to get attributes (select_list context)" do
160
- browser.select_list(:name, "new_user_country").option(:text , 'Sweden').class_name.should == "scandinavia"
161
- end
122
+ describe "#class_name" do
123
+ it "is able to get attributes (page context)" do
124
+ browser.option(:text, 'Sweden').class_name.should == "scandinavia"
125
+ end
126
+
127
+ it "is able to get attributes (select_list context)" do
128
+ browser.select_list(:name, "new_user_country").option(:text , 'Sweden').class_name.should == "scandinavia"
162
129
  end
163
130
  end
164
131