#-------------------------------------------------------------------------------------------------------------# # test with the WATIR controller # # Simple test based on Google/watir demo # #------------------------------------------------------------------------------------------------------------ # #includes require '../watir' # the controller #test::unit includes require 'test/unit' require 'test/unit/ui/console/testrunner' require '../unittests/testUnitAddons' #code to set your current path in Windows $myDir = File.dirname(__FILE__) $LOAD_PATH << $myDir class TC_rwdtinker_suite < Test::Unit::TestCase def test_a_Open1 #-------------------------------------------------------- # test case that shows basic WATIR functionality: # * enter text in a field # * click a button # #variables testSite = 'http://localhost:7705' #open the IE browser $ie = IE.new puts '## Beginning of test: rwdtinker' puts ' ' $ie.goto(testSite) puts ' Action: entered ' + testSite + 'in the address bar.' sleep 1 $ie.button(:caption, "View Photo").click puts ' Action: clicked the View Photo link' sleep 1 $ie.link(:url, 'javascript:document.bodyform.rwd_action.value="rwd_main";document.bodyform.submit();').click puts ' Action: clicked the main top link' end def test_b_Buttons1 sleep 1 $ie.link(:url, 'javascript:document.bodyform.rwd_action.value="rwd_tab_filelister";document.bodyform.submit();').click puts ' Action: clicked the file lister tab' sleep 1 $ie.button(:caption, "List Files").click puts ' Action: clicked the List Files button.' sleep 1 assert($ie.pageContainsText("File Name") ) sleep 1 $ie.button(:caption, "View Install Text").click puts ' Action: clicked the View Install Text button.' sleep 1 $ie.link(:url, 'javascript:document.bodyform.rwd_action.value="rwd_tab_zipslister";document.bodyform.submit();').click puts ' ' puts '## End of 2st test: ' end # end of test_b_buttons1 def test_c_tabs $ie.button(:caption, "List applets available for installing").click puts ' Action: clicked the List applets available for installing button.' end end #end of class TC_google_suite