unittests/form_test.rb in watir-1.5.4 vs unittests/form_test.rb in watir-1.5.5
- old
+ new
@@ -1,14 +1,14 @@
# feature tests for Forms
-# revision: $Revision: 1294 $
+# revision: $Revision: 1348 $
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__
require 'unittests/setup'
class TC_Forms2 < Test::Unit::TestCase # Note: there is no TC_Forms1
def setup
- $ie.goto($htmlRoot + "forms2.html")
+ goto_page "forms2.html"
end
def test_Form_Exists
assert($ie.form(:name, "test2").exists?)
assert(!$ie.form(:name, "missing").exists?)
@@ -48,11 +48,11 @@
require 'unittests/iostring'
class TC_Form_Display < Test::Unit::TestCase
include MockStdoutTestCase
def test_showforms
- $ie.goto($htmlRoot + "forms2.html")
+ goto_page "forms2.html"
$stdout = @mockout
$ie.showForms
assert_equal(<<END_OF_MESSAGE, @mockout)
There are 4 forms
Form name:
@@ -75,11 +75,11 @@
end
end
class TC_Forms3 < Test::Unit::TestCase
def setup
- $ie.goto($htmlRoot + "forms3.html")
+ goto_page "forms3.html"
end
# The following tests from bug 2261
def test_p_in_form
$ie.form(:name, 'buttonsubmit').p(:index, 1).text
@@ -179,21 +179,21 @@
end
class TC_Forms3_Display < Test::Unit::TestCase
include MockStdoutTestCase # BUG in test: output not verified!
def test_show_stuff
- $ie.goto($htmlRoot + "forms3.html")
+ goto_page "forms3.html"
$stdout = @mockout
$ie.showAllObjects
puts $ie.getText
puts $ie.getHTML
end
end
class TC_Forms4 < Test::Unit::TestCase
def setup
- $ie.goto($htmlRoot + "forms4.html")
+ goto_page "forms4.html"
end
def test_find_text_field_ignoring_form
assert_equal($ie.text_field(:name, 'name').getContents, 'apple') # should it raise a not-unique error instead?
end
@@ -219,10 +219,10 @@
end
end
class TC_Hidden_Fields < Test::Unit::TestCase
def setup
- $ie.goto($htmlRoot + "forms3.html")
+ goto_page "forms3.html"
end
def test_hidden
# test using index
\ No newline at end of file