Created
February 17, 2012 21:58
-
-
Save VirtuosiMedia/1855690 to your computer and use it in GitHub Desktop.
Trial Selenium Test - Pricing Page
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-webdriver" | |
require "test/unit" | |
class FindPricingPage < Test::Unit::TestCase | |
def setup | |
@driver = Selenium::WebDriver.for :firefox | |
@base_url = "http://staging.youeye.com/" | |
@driver.manage.timeouts.implicit_wait = 30 | |
@verification_errors = [] | |
end | |
def teardown | |
@driver.quit | |
assert_equal [], @verification_errors | |
end | |
def test_find_pricing_page | |
@driver.get(@base_url + "/") | |
@driver.find_element(:link, "Pricing").click | |
assert_equal "http://staging.youeye.com/pricing", @driver.current_url | |
end | |
def element_present?(how, what) | |
@driver.find_element(how, what) | |
true | |
rescue Selenium::WebDriver::Error::NoSuchElementError | |
false | |
end | |
def verify(&blk) | |
yield | |
rescue Test::Unit::AssertionFailedError => ex | |
@verification_errors << ex | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment