Skip to content

Instantly share code, notes, and snippets.

@tourdedave
Created February 23, 2016 03:45
Show Gist options
  • Save tourdedave/37abed1c3c5410db14d9 to your computer and use it in GitHub Desktop.
Save tourdedave/37abed1c3c5410db14d9 to your computer and use it in GitHub Desktop.
require 'selenium-webdriver'
require 'rspec/expectations'
include RSpec::Matchers
driver = Selenium::WebDriver.for :firefox
driver.get 'http://the-internet.herokuapp.com/exit_intent'
driver.action.move_by(5000, 0).perform
Selenium::WebDriver::Wait.new(timeout: 5).until {
driver.find_element(class: 'modal-body').displayed?
}
expect(driver.find_element(class: 'modal-body').displayed?).to eql true
driver.quit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment