Created
December 10, 2014 15:32
-
-
Save dobbs/287d392b9280b89d3e4e to your computer and use it in GitHub Desktop.
PRY, Capybara, and Selenium for DOM REPL
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 'capybara' | |
Capybara.default_driver = :selenium | |
Capybara.javascript_driver = :selenium | |
Capybara.run_server = false | |
Capybara.app_host = 'http://localhost:3000' | |
class Scratch | |
include Capybara::DSL | |
def sign_in(as:, password: '5up3rSecret') | |
visit '/' | |
fill_in 'Username', with: as | |
fill_in 'Password', with: password | |
click_button 'Sign In' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Super lightweight way to explore your web application's DOM to discover what selectors and other capybara incantations will work best for your tests.