first UI test (try)

This commit is contained in:
roy 2012-11-12 19:12:38 +01:00
parent 3044841bb3
commit f06591a710

31
test/ui_test.rb Normal file
View file

@ -0,0 +1,31 @@
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'test/unit'
gem 'selenium-client', ">=1.2.8"
require 'selenium/client'
class ExampleTest < Test::Unit::TestCase
attr_reader :browser
def setup
@browser = Selenium::Client::Driver.new \
:host => "localhost",
:port => 4444,
:browser => "*firefox",
:url => "http://kaldung.com",
:timeout_in_seconds => 60
browser.start_new_browser_session
end
def teardown
browser.close_current_browser_session
end
def test_page_search
browser.open "/"
assert_equal "Google", browser.title
end
end