Skip to content

Instantly share code, notes, and snippets.

@haikuwebdev
Created October 22, 2008 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haikuwebdev/18644 to your computer and use it in GitHub Desktop.
Save haikuwebdev/18644 to your computer and use it in GitHub Desktop.
require "selenium"
require "test/unit"
class NewTest < Test::Unit::TestCase
def setup
@verification_errors = []
if $selenium
@selenium = $selenium
else
@selenium = Selenium::SeleniumDriver.new("localhost", 4444, "*chrome", "http://www.google.com/", 10000);
@selenium.start
end
@selenium.set_context("test_new")
end
def teardown
@selenium.stop unless $selenium
assert_equal [], @verification_errors
end
def test_new
@selenium.open "/"
@selenium.type "q", "duke health"
@selenium.click "btnG"
@selenium.wait_for_page_to_load "30000"
@selenium.click "//div[@id='res']/div[1]/ol/li[1]/h3/a/em"
@selenium.wait_for_page_to_load "30000"
@selenium.type "search_input", "directions"
@selenium.click "search_button"
@selenium.wait_for_page_to_load "30000"
begin
assert @selenium.is_text_present("Hospital")
rescue Test::Unit::AssertionFailedError
@verification_errors << $!
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment