Skip to content

Instantly share code, notes, and snippets.

@nickboyce
Created May 1, 2012 09:29
Show Gist options
  • Save nickboyce/2566740 to your computer and use it in GitHub Desktop.
Save nickboyce/2566740 to your computer and use it in GitHub Desktop.
Sample test
# encoding: UTF-8
require "rubygems"
require "selenium-webdriver"
require "awesome_print"
# allow colour in RSpec results
RSpec.configure do |config| config.color_enabled = true end
describe "The Easyart website" do
before(:all) do
# set up our driver and wait instances
@driver = Selenium::WebDriver.for(:firefox)
@wait = Selenium::WebDriver::Wait.new(:timeout => 10)
end
after(:all) do
# quit the browser after the tests run
@driver.quit
end
# let's start with an easy one...
it "should have a home page" do
# navigate to the page
@driver.get "http://www.easyart.com/"
# check the title is as expected
@driver.title.should == "Buy Art Prints, Canvas Prints, Framed Art at Easyart.com"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment