# feature tests for Forms $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 class TC_Form_Display_XPath < Test::Unit::TestCase include CaptureIOHelper def test_showforms goto_page "forms2.html" actual = capture_stdout { browser.show_forms } assert_equal(<