# feature tests for Forms # revision: $Revision: 1544 $ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED require 'unittests/setup' class TC_Forms2_XPath < Test::Unit::TestCase def setup goto_page "forms2.html" end def test_Form_Exists assert(browser.form(:xpath , "//form[@name='test2']/").exists?) assert_false(browser.form(:xpath , "//form[@name='missing']/").exists?) assert(browser.form(:xpath , "//form[@method='get']/").exists?) assert_false(browser.form(:xpath , "//form[@method='missing']/").exists?) assert(browser.form(:xpath , "//form[@action='pass.html']/").exists?) assert_false(browser.form(:xpath , "//form[@action='missing']/").exists?) end def test_ButtonInForm assert(browser.form(:xpath , "//form[@name='test2']/").button(:caption , "Submit").exists?) end end require 'unittests/iostring' class TC_Form_Display_XPath < Test::Unit::TestCase include MockStdoutTestCase def test_showforms goto_page "forms2.html" $stdout = @mockout browser.show_forms assert_equal(<