Sha256: a0770c35cacf28bbeb2b17ce06eb305c93aa067e1fe003e9c1b8a6782c8a5347

Contents?: true

Size: 808 Bytes

Versions: 1

Compression:

Stored size: 808 Bytes

Contents

# frozen_string_literal: true

require_relative "publishing_platform_test/version"

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

module PublishingPlatformTest
  def self.configure
    Capybara.register_driver :headless_chrome do |app|
      Capybara::Selenium::Driver.new(app,
                                     browser: :chrome,
                                     options: headless_chrome_selenium_options)
    end

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

  def self.headless_chrome_selenium_options
    Selenium::WebDriver::Chrome::Options.new.tap do |options|
      options.add_argument("--headless=new")
      options.add_argument("--no-sandbox") if ENV["PUBLISHING_PLATFORM_TEST_CHROME_NO_SANDBOX"]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
publishing_platform_test-0.1.0 lib/publishing_platform_test.rb