diff options
author | Stan Hu <stanhu@gmail.com> | 2017-06-17 08:35:46 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-06-17 08:35:46 +0300 |
commit | bece18aa592f3b93c1a697310dc1ee6d943fde25 (patch) | |
tree | b3b424fee8b0f8ad4f697fefee6a1263570320b9 | |
parent | ddbb88010e05f6295dd6e46724d585494c8cc84a (diff) |
Make Capybara::Screenshot work with headless Chrome
-rw-r--r-- | features/support/capybara.rb | 4 | ||||
-rw-r--r-- | spec/support/capybara.rb | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/features/support/capybara.rb b/features/support/capybara.rb index 1d1626a064b..595577804bd 100644 --- a/features/support/capybara.rb +++ b/features/support/capybara.rb @@ -20,6 +20,10 @@ Capybara.ignore_hidden_elements = false # Keep only the screenshots generated from the last failing test suite Capybara::Screenshot.prune_strategy = :keep_last_run +# From https://github.com/mattheworiordan/capybara-screenshot/issues/84#issuecomment-41219326 +Capybara::Screenshot.register_driver(:chrome) do |driver, path| + driver.browser.save_screenshot(path) +end Spinach.hooks.before_run do TestEnv.eager_load_driver_server diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index fbe8ae30565..4a4b037d0b1 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -24,6 +24,10 @@ Capybara.ignore_hidden_elements = true # Keep only the screenshots generated from the last failing test suite Capybara::Screenshot.prune_strategy = :keep_last_run +# From https://github.com/mattheworiordan/capybara-screenshot/issues/84#issuecomment-41219326 +Capybara::Screenshot.register_driver(:chrome) do |driver, path| + driver.browser.save_screenshot(path) +end RSpec.configure do |config| config.before(:context, :js) do |