# feature tests for Forms # revision: $Revision: 1079 $ $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") end def test_Form_Exists assert($ie.form(:name, "test2").exists?) assert(!$ie.form(:name, "missing").exists?) assert($ie.form("test2").exists?) assert(!$ie.form( "missing").exists?) assert($ie.form(:index, 1).exists?) assert(!$ie.form(:index, 88).exists?) assert($ie.form(:method, "get").exists?) assert(!$ie.form(:method, "missing").exists?) assert($ie.form(:id, 'f2').exists?) assert(!$ie.form(:id, 'missing').exists?) assert($ie.form(:action, "pass.html").exists?) assert(!$ie.form(:action, "missing").exists?) end def test_ButtonInForm assert($ie.form(:name, "test2").button(:caption , "Submit").exists?) end # The following tests from bug 2261 def test_form_html assert_equal("\r\n
", $ie.form(:name, 'test2').html) end def test_form_flash assert_nothing_raised{ $ie.form(:name, 'test2').flash } end def test_form_sub_element assert_equal('Click Me', $ie.form(:index, 1).button(:name, 'b1').value) end end require 'unittests/iostring' class TC_Form_Display < Test::Unit::TestCase include MockStdoutTestCase def test_showforms $ie.goto($htmlRoot + "forms2.html") $stdout = @mockout $ie.showForms assert_equal(<