Skip to content

Instantly share code, notes, and snippets.

@unicornrainbow
Created May 5, 2009 04:43
Show Gist options
  • Save unicornrainbow/106836 to your computer and use it in GitHub Desktop.
Save unicornrainbow/106836 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", "test"
@selenium.click "btnG"
begin
assert @selenium.is_text_present("Christie")
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