Skip to content

Instantly share code, notes, and snippets.

@wolfedale

wolfedale/.rb Secret

Created October 12, 2015 15:41
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 wolfedale/33b2037c393b6fbc846c to your computer and use it in GitHub Desktop.
Save wolfedale/33b2037c393b6fbc846c to your computer and use it in GitHub Desktop.
ruby-error
require 'yaml'
require 'selenium-webdriver'
require 'rspec/expectations'
require 'rspec'
include RSpec::Matchers
class Chuj
def setup
@driver = Selenium::WebDriver.for(
:remote,
url: 'http://localhost:4444/wd/hub',
desired_capabilities: :firefox)
end
def teardown
@driver.quit
end
def run
puts "Connecting to the Hub."
setup
yield
teardown
end
run do
puts "Testing::Google"
@driver.get 'https://google.com'
begin
expect(@driver.title).to eq('Login')
puts "Testing::Login - PASSED"
rescue RSpec::Expectations::ExpectationNotMetError => msg
puts msg.message
puts "Testing::Login - FAILED"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment