Sha256: 99a40e8c93dde5549b85cc202c731ac2b9308f38e5cbe0bd08e4bc153213961f

Contents?: true

Size: 797 Bytes

Versions: 4

Compression:

Stored size: 797 Bytes

Contents

require "govuk_test/version"

require "capybara"
require "puma"
require "selenium-webdriver"

unless ENV["GOVUK_TEST_USE_SYSTEM_CHROMEDRIVER"]
  require "webdrivers"

  # This stop webdrivers doing a lazy check for new versions
  # of chromedriver, which interferes with WebMock.disable_net_connect
  Selenium::WebDriver::Chrome::Service.driver_path = Webdrivers::Chromedriver.update
end

module GovukTest
  def self.configure(chrome_options: nil)
    chrome_options ||= Selenium::WebDriver::Chrome::Options.new
    chrome_options.headless!

    Capybara.register_driver :headless_chrome do |app|
      Capybara::Selenium::Driver.new(app, browser: :chrome, options: chrome_options)
    end

    Capybara.javascript_driver = :headless_chrome
    Capybara.server = :puma, { Silent: true }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
govuk_test-1.0.3 lib/govuk_test.rb
govuk_test-1.0.2 lib/govuk_test.rb
govuk_test-1.0.1 lib/govuk_test.rb
govuk_test-1.0.0 lib/govuk_test.rb