Sha256: b1e1a016427129b36bb279e854c324cf4324f06b3d656a32ae494a42cc772c46

Contents?: true

Size: 953 Bytes

Versions: 35

Compression:

Stored size: 953 Bytes

Contents

require 'selenium-webdriver'
require 'show_me_the_cookies'

Capybara.register_driver :chrome_headless do |app|
  Capybara::Selenium::Driver.load_selenium
  browser_options = ::Selenium::WebDriver::Chrome::Options.new.tap do |opts|
    opts.args << '--headless'
    opts.args << '--disable-gpu' if Gem.win_platform?
    opts.args << '--no-sandbox'
    # Workaround https://bugs.chromium.org/p/chromedriver/issues/detail?id=2650&q=load&sort=-id&colspec=ID%20Status%20Pri%20Owner%20Summary
    opts.args << '--disable-site-isolation-trials'
    opts.args << '--window-size=1920,1080'
    opts.args << '--enable-features=NetworkService,NetworkServiceInProcess'
  end
  Capybara::Selenium::Driver.new(app, browser: :chrome, options: browser_options)
end

Capybara::Screenshot.register_driver(:chrome_headless) do |driver, path|
  driver.browser.save_screenshot(path)
end

ShowMeTheCookies.register_adapter(:chrome_headless, ShowMeTheCookies::SeleniumChrome)

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
ndr_dev_support-5.9.0 lib/ndr_dev_support/integration_testing/drivers/chrome_headless.rb
ndr_dev_support-5.8.2 lib/ndr_dev_support/integration_testing/drivers/chrome_headless.rb
ndr_dev_support-5.8.1 lib/ndr_dev_support/integration_testing/drivers/chrome_headless.rb
ndr_dev_support-5.8.0 lib/ndr_dev_support/integration_testing/drivers/chrome_headless.rb
ndr_dev_support-5.7.1 lib/ndr_dev_support/integration_testing/drivers/chrome_headless.rb
ndr_dev_support-5.7.0 lib/ndr_dev_support/integration_testing/drivers/chrome_headless.rb
ndr_dev_support-5.6.0 lib/ndr_dev_support/integration_testing/drivers/chrome_headless.rb
ndr_dev_support-5.5.0 lib/ndr_dev_support/integration_testing/drivers/chrome_headless.rb
ndr_dev_support-5.4.8 lib/ndr_dev_support/integration_testing/drivers/chrome_headless.rb
ndr_dev_support-5.4.7 lib/ndr_dev_support/integration_testing/drivers/chrome_headless.rb
ndr_dev_support-5.4.6 lib/ndr_dev_support/integration_testing/drivers/chrome_headless.rb
ndr_dev_support-5.4.5 lib/ndr_dev_support/integration_testing/drivers/chrome_headless.rb
ndr_dev_support-5.4.4 lib/ndr_dev_support/integration_testing/drivers/chrome_headless.rb
ndr_dev_support-5.4.3 lib/ndr_dev_support/integration_testing/drivers/chrome_headless.rb
ndr_dev_support-5.4.2 lib/ndr_dev_support/integration_testing/drivers/chrome_headless.rb