Created
March 31, 2015 09:08
-
-
Save bergerjac/c6c88102d191f5d94ad3 to your computer and use it in GitHub Desktop.
capybara-screenshot
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
# nano features/support/capybara-screenshot.rb | |
# screenshot_and_save_page | |
# screenshot_and_open_image | |
# disable the auto-generate on failure feature | |
# Capybara::Screenshot.autosave_on_failure = false | |
# only keep screenshots from last fail | |
Capybara::Screenshot.prune_strategy = :keep_last_run | |
# only keep up to n screenshots | |
Capybara::Screenshot.prune_strategy = { keep: 20 } | |
Capybara::Screenshot.webkit_options = { width: 1024, height: 768 } | |
Capybara.save_and_open_page_path = "tmp/capybara/screenshots" |
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
# nano features/support/env.rb | |
require 'capybara-screenshot/cucumber' | |
Capybara.configure do |config| | |
config.run_server = false | |
config.app_host = 'http://localhost:3066' | |
end |
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
group :test do | |
gem 'capybara-screenshot' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment