Sha256: 09dea045ca17a5aab4065c502719858121c3cd8a17ded9dcd2925a5ae27424ed
Contents?: true
Size: 1.89 KB
Versions: 12
Compression:
Stored size: 1.89 KB
Contents
# frozen_string_literal: true Capybara.register_driver :rack_test do |app| Capybara::RackTest::Driver.new(app) end Capybara.register_driver :selenium do |app| Capybara::Selenium::Driver.new(app) end Capybara.register_driver :selenium_headless do |app| version = Capybara::Selenium::Driver.load_selenium options_key = Capybara::Selenium::Driver::CAPS_VERSION.satisfied_by?(version) ? :capabilities : :options browser_options = ::Selenium::WebDriver::Firefox::Options.new.tap do |opts| opts.add_argument '-headless' end Capybara::Selenium::Driver.new(app, **Hash[:browser => :firefox, options_key => browser_options]) end Capybara.register_driver :selenium_chrome do |app| version = Capybara::Selenium::Driver.load_selenium options_key = Capybara::Selenium::Driver::CAPS_VERSION.satisfied_by?(version) ? :capabilities : :options browser_options = ::Selenium::WebDriver::Chrome::Options.new.tap do |opts| # Workaround https://bugs.chromium.org/p/chromedriver/issues/detail?id=2650&q=load&sort=-id&colspec=ID%20Status%20Pri%20Owner%20Summary opts.add_argument('--disable-site-isolation-trials') end Capybara::Selenium::Driver.new(app, **Hash[:browser => :chrome, options_key => browser_options]) end Capybara.register_driver :selenium_chrome_headless do |app| version = Capybara::Selenium::Driver.load_selenium options_key = Capybara::Selenium::Driver::CAPS_VERSION.satisfied_by?(version) ? :capabilities : :options browser_options = ::Selenium::WebDriver::Chrome::Options.new.tap do |opts| opts.add_argument('--headless') opts.add_argument('--disable-gpu') if Gem.win_platform? # Workaround https://bugs.chromium.org/p/chromedriver/issues/detail?id=2650&q=load&sort=-id&colspec=ID%20Status%20Pri%20Owner%20Summary opts.add_argument('--disable-site-isolation-trials') end Capybara::Selenium::Driver.new(app, **Hash[:browser => :chrome, options_key => browser_options]) end
Version data entries
12 entries across 7 versions & 2 rubygems