Permalink
Browse files

name and value are not valid attributes for div elements

  • Loading branch information...
1 parent e640bfa commit d31192094d2dbcdb53de62c8d5701857a1fe6f8d @jarmo jarmo committed Mar 12, 2012
Showing with 3 additions and 21 deletions.
  1. +3 −21 watir/unittests/div_test.rb
@@ -10,17 +10,6 @@ def setup
uses_page "div.html"
end
- def test_divs
- assert_raises(UnknownObjectException) { browser.div(:id, "div77").click }
- assert_raises(UnknownObjectException) { browser.div(:title, "div77").click }
-
- assert browser.text_field(:name, "text1").verify_contains("0")
- browser.div(:id, "div3").click
- assert browser.text_field(:name, "text1").verify_contains("1")
- browser.div(:id, "div4").click
- assert browser.text_field(:name, "text1").verify_contains("0")
- end
-
tag_method :test_div_properties, :fails_on_firefox
def test_div_properties
assert_raises(UnknownObjectException) { browser.div(:id, "div77").text }
@@ -39,9 +28,7 @@ def test_div_properties
assert_equal("div1" , browser.div(:index, 0).id)
assert_equal("" , browser.div(:index, 0).class_name)
assert_equal("blueText" , browser.div(:index, 1).class_name)
- assert_equal("" , browser.div(:index, 1).value)
- assert_equal(false , browser.div(:index, 1).disabled)
- assert_equal("" , browser.div(:index, 1).name)
+ assert_equal(false , browser.div(:index, 1).disabled?)
assert_equal("div2", browser.div(:index, 1).id)
end
@@ -51,7 +38,6 @@ def test_div_iterator
index = 0
browser.divs.each do |s|
- assert_equal(browser.div(:index,index).name, s.name)
assert_equal(browser.div(:index,index).id, s.id)
assert_equal(browser.div(:index,index).class_name , s.class_name)
index += 1
@@ -118,9 +104,7 @@ def test_span_properties
assert_equal("span1" , browser.span(:index , 0).id )
assert_equal("" , browser.span(:index , 0).class_name )
assert_equal("blueText" , browser.span(:index , 1).class_name )
- assert_equal("" , browser.span(:index , 1).value)
- assert_equal(false , browser.span(:index , 1).disabled)
- assert_equal("" , browser.span(:index , 1).name)
+ assert_equal(false , browser.span(:index , 1).disabled?)
assert_equal("span2", browser.span(:index , 1).id)
end
@@ -130,8 +114,6 @@ def test_span_iterator
index = 0
browser.spans.each do |s|
- # puts "each - span = " + s.to_s
- assert_equal(browser.span(:index, index ).name , s.name )
assert_equal(browser.span(:index, index ).id , s.id )
assert_equal(browser.span(:index, index ).class_name , s.class_name )
index += 1
@@ -166,7 +148,7 @@ def test_p
assert_raises( UnknownObjectException) {browser.p(:id , 'missing').text }
assert_raises( UnknownObjectException) {browser.p(:id , 'missing').title }
assert_raises( UnknownObjectException) {browser.p(:id , 'missing').to_s }
- assert_raises( UnknownObjectException) {browser.p(:id , 'missing').disabled }
+ assert_raises( UnknownObjectException) {browser.p(:id , 'missing').disabled? }
assert_equal('redText' , browser.p(:index,0).class_name)
assert_equal('P_tag_1' , browser.p(:index,0).title)

0 comments on commit d311920

Please sign in to comment.