Created
October 22, 2008 14:17
-
-
Save haikuwebdev/18644 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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