From f06591a71034deaa87ec10cabfa5692659ee798f Mon Sep 17 00:00:00 2001 From: roy Date: Mon, 12 Nov 2012 19:12:38 +0100 Subject: [PATCH] first UI test (try) --- test/ui_test.rb | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 test/ui_test.rb diff --git a/test/ui_test.rb b/test/ui_test.rb new file mode 100644 index 000000000..7cefaa6b4 --- /dev/null +++ b/test/ui_test.rb @@ -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 + +