Forum: Ruby on Rails ruby/rails newby needs help with passing parameters to testc

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D57f8a6095df6b8a3aae2eeae014ccee?d=identicon&s=25 ncancelliere@gmail.com (Guest)
on 2007-05-19 04:44
(Received via mailing list)
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
This topic is locked and can not be replied to.