install phantomjs
on server
Created
August 21, 2015 09:04
-
-
Save rilian/0ed102ba66e10951271d to your computer and use it in GitHub Desktop.
poltergeist
This file contains hidden or 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
# spec/support/capybara.rb | |
Capybara.register_driver :poltergeist do |app| | |
Capybara::Poltergeist::Driver.new(app, phantomjs_logger: File.open("#{Rails.root}/log/test_phantomjs.log", 'a')) | |
end | |
Capybara.javascript_driver = :poltergeist | |
Capybara.save_and_open_page_path = '/tmp' | |
RSpec.configure do |config| | |
config.append_after(:each) do | |
Capybara.reset_sessions! | |
end | |
end | |
Capybara::Screenshot.prune_strategy = :keep_last_run |
This file contains hidden or 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
# ... | |
gem 'capybara' | |
gem 'selenium-webdriver' | |
gem 'poltergeist' | |
gem 'phantomjs', require: 'phantomjs/poltergeist' | |
gem 'capybara-screenshot' | |
# ... |
This file contains hidden or 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 'rspec/rails' | |
# ADD THIS after require 'rspec/rails' | |
require 'capybara/poltergeist' | |
require 'capybara-screenshot/rspec' | |
# ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment