Commit bece18aa authored by Stan Hu's avatar Stan Hu

Make Capybara::Screenshot work with headless Chrome

parent ddbb8801
...@@ -20,6 +20,10 @@ Capybara.ignore_hidden_elements = false ...@@ -20,6 +20,10 @@ Capybara.ignore_hidden_elements = false
# Keep only the screenshots generated from the last failing test suite # Keep only the screenshots generated from the last failing test suite
Capybara::Screenshot.prune_strategy = :keep_last_run 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 Spinach.hooks.before_run do
TestEnv.eager_load_driver_server TestEnv.eager_load_driver_server
......
...@@ -24,6 +24,10 @@ Capybara.ignore_hidden_elements = true ...@@ -24,6 +24,10 @@ Capybara.ignore_hidden_elements = true
# Keep only the screenshots generated from the last failing test suite # Keep only the screenshots generated from the last failing test suite
Capybara::Screenshot.prune_strategy = :keep_last_run 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| RSpec.configure do |config|
config.before(:context, :js) do config.before(:context, :js) do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment