-
-
Save wolfedale/33b2037c393b6fbc846c to your computer and use it in GitHub Desktop.
ruby-error
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 '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