Last active
December 18, 2015 00:48
-
-
Save guiferrpereira/5698918 to your computer and use it in GitHub Desktop.
Capybara with phantomjs
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' | |
require 'capybara/poltergeist' | |
# Capybara configuration | |
Capybara.run_server = false | |
Capybara.javascript_driver = :poltergeist | |
Capybara.default_wait_time = 10 | |
Capybara.register_driver :poltergeist do |app| | |
Capybara::Poltergeist::Driver.new(app, { :phantomjs_options => ['--ignore-ssl-errors=yes'] }) | |
end | |
# Capybara initializer | |
session = Capybara::Session.new(:poltergeist) | |
session.visit 'http://xpto.com:8001/' | |
session.fill_in 'user', :with => '[email protected]' | |
session.fill_in 'pass', :with => 'cool1111' | |
session.click_button('Entrar') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment