unittests/textarea_xpath_test.rb in watir-1.5.4 vs unittests/textarea_xpath_test.rb in watir-1.5.5
- old
+ new
@@ -1,20 +1,19 @@
# feature tests for TextArea Fields
-# revision: $Revision: 963 $
+# revision: $Revision: 1348 $
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__
require 'unittests/setup'
class TC_TextArea_XPath < Test::Unit::TestCase
- include Watir
+ include Watir::Exception
- def goto_page
- $ie.goto($htmlRoot + "textArea.html")
+ def setup
+ goto_page "textArea.html"
end
def test_textarea_field_exists
- goto_page
#test for existance of 4 text area
assert($ie.text_field(:xpath , "//textarea[@name='txtMultiLine1']/").exists?)
assert($ie.text_field(:xpath , "//textarea[@name='txtMultiLine2']/").exists?)
assert($ie.text_field(:xpath , "//textarea[@name='txtMultiLine3']/").exists?)
assert($ie.text_field(:xpath , "//textarea[@name='txtReadOnly']/").exists?)
@@ -26,19 +25,17 @@
#test for missing
assert(!$ie.text_field(:xpath , "//textarea[@name='missing']/").exists?)
assert(!$ie.text_field(:xpath , "//textarea[@name='txtMultiLine4']/").exists?)
end
- def test_textarea_to_s
+ def xtest_textarea_to_s
# bug reported by Zeljko Filipin
# assert_nothing_raised { $ie.text_field(:xpath , "//textarea[@id='txtMultiLine3']/").to_s }
# The above assertion fails. No property or method called maxlength
end
def test_textarea_field
- goto_page
-
# test for read only method
assert(!$ie.text_field(:xpath , "//textarea[@name='txtMultiLine1']/").readonly? )
assert($ie.text_field(:xpath , "//textarea[@name='txtReadOnly']/").readonly?)
# test for enabled? method
@@ -74,9 +71,8 @@
assert_raises(ObjectDisabledException , "ObjectReadOnlyException was supposed to be thrown" ) { $ie.text_field(:xpath , "//textarea[@name='txtDisabled']/").append("Some Text") }
assert_raises(UnknownObjectException , "ObjectReadOnlyException was supposed to be thrown" ) { $ie.text_field(:xpath , "//textarea[@name='missing_field']/").append("Some Text") }
$ie.text_field(:xpath , "//textarea[@name='txtMultiLine2']/").clear
assert_equal( "" , $ie.text_field(:xpath , "//textarea[@name='txtMultiLine2']/").value )
-
end
end