# feature tests for Forms # revision: $Revision$ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED require 'unittests/setup' class TC_Forms2 < Test::Unit::TestCase # Note: there is no TC_Forms1 def setup uses_page "forms2.html" end def test_form_exists assert(browser.form(:name, "test2").exists?) assert_false(browser.form(:name, "missing").exists?) assert(browser.form("test2").exists?) assert_false(browser.form("missing").exists?) assert(browser.form(:index, 1).exists?) assert_false(browser.form(:index, 88).exists?) assert(browser.form(:method, "get").exists?) assert_false(browser.form(:method, "missing").exists?) assert(browser.form(:id, 'f2').exists?) assert_false(browser.form(:id, 'missing').exists?) assert(browser.form(:action, "pass.html").exists?) assert_false(browser.form(:action, "missing").exists?) end def test_button_in_form assert(browser.form(:name, "test2").button(:caption, "Submit").exists?) end def test_form_sub_element assert_equal('Click Me', browser.form(:index, 1).button(:name, 'b1').value) end # The following tests form bug 2261 tag_method :test_form_outer_html, :fails_on_firefox def test_form_outer_html expected = "\r\n
" assert_equal(expected, browser.form(:name, 'test2').html) end tag_method :test_form_inner_html, :fails_on_ie def test_form_inner_html expected = "\n