Skip to content

Instantly share code, notes, and snippets.

@tourdedave
Created July 24, 2014 17:20
Show Gist options
  • Save tourdedave/9ea9b360a914e319604f to your computer and use it in GitHub Desktop.
Save tourdedave/9ea9b360a914e319604f to your computer and use it in GitHub Desktop.
require 'selenium-webdriver'
describe 'Login' do
before(:each) do
@driver = Selenium::WebDriver.for :firefox
end
after(:each) do
@driver.quit
end
it 'succeeded' do
@driver.get 'http://the-internet.herokuapp.com/login'
@driver.find_element(id: 'username').send_keys('tomsmith')
@driver.find_element(id: 'password').send_keys('SuperSecretPassword!')
@driver.find_element(id: 'login').submit
expect(@driver.find_element(css: '.flash.success').displayed?).to eql(true)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment