ncancelliere-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-May-19 02:42 UTC
ruby/rails newby needs help with passing parameters to testcases
I''m trying to pass parameters into a Selenium testcase using Test::Unit:Testcase ... would I do this with a fixture or simply pass parameters somehow into a class I create like: myTest = TC_LoginTest.net(param1, param2, param3) Basically I want to write 1 test that will log into an application I made as different users and validate the outcome. The parameters are user name, password and database. I''m not really familiar with fixtures (if that''s what I should be using) or if I should be passing parameters in a separate test suite file ... not sure. Any advice or a website you could point me to I''d appreciate it. Nicholas My class is below__________________________________________ require ''test/unit'' require ''../selenium'' class TC_LoginTest < Test::Unit::TestCase include SeleniumHelper def setup @selenium = Selenium::SeleniumDriver.new("localhost", 4444, "*iexplore", 10000); @selenium.start end def teardown @selenium.stop end def test_doLogin #open the special test login page that doesn''t need SSL (since Se doesn''t like SSL) open(''/myapp/utils/specialLogin.cfm'') uncheck(name="myChkBox") type(name="UName", username) type(name="Pass", password) click(database) # after providing username and password we click the database button we want to test and validate sleep 5 assert_equal("nickc",get_text("userName"),["User name doesn''t match login name"]) assert_equal("Developer",get_text("profileName"),["Profile name doesn''t match login name"]) end end --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---