Skip to content

Instantly share code, notes, and snippets.

@pmeinhardt
Created September 18, 2012 06:39
Show Gist options
  • Save pmeinhardt/3741625 to your computer and use it in GitHub Desktop.
Save pmeinhardt/3741625 to your computer and use it in GitHub Desktop.
interactive capybara session
#!/usr/bin/env ruby
require 'irb'
require 'irb/completion'
require 'selenium/webdriver'
require 'capybara/dsl'
if ARGV.delete "--chrome"
chrome = true
end
Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new app, browser: :chrome
end
Capybara.configure do |config|
config.default_driver = chrome ? :chrome : :selenium
end
include Capybara::DSL
IRB.conf[:AUTO_INDENT] = true
IRB.conf[:PROMPT_MODE] = :SIMPLE
IRB.start
@TitouanVanBelle
Copy link

require 'rspec/expectations' would be a plus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment