Skip to content

Commit

Permalink
Add support for selenium_chrome{,_headless}
Browse files Browse the repository at this point in the history
As of capybara 2.15.0 there are built-in drivers for :selenium_chrome
and :selenium_chrome_headless
  • Loading branch information
jhawthorn committed Sep 10, 2017
1 parent b2a253b commit 4b3e82c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/capybara-screenshot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,14 @@ def self.capybara_tmp_path=(path)
:not_supported
end

register_driver(:selenium) do |driver, path|
selenium_block = proc do |driver, path|
driver.browser.save_screenshot(path)
end

register_driver :selenium, &selenium_block
register_driver :selenium_chrome, &selenium_block
register_driver :selenium_chrome_headless, &selenium_block

register_driver(:poltergeist) do |driver, path|
driver.render(path, :full => true)
end
Expand Down

0 comments on commit 4b3e82c

Please sign in to comment.