Sha256: d11515bea5c4e40e62cc9c4a948a2edb66ba1eeb7cebb50371b90c20647e8d22

Contents?: true

Size: 1022 Bytes

Versions: 85

Compression:

Stored size: 1022 Bytes

Contents

# frozen_string_literal: true

module ActionDispatch
  module SystemTesting
    class Browser # :nodoc:
      attr_reader :name

      def initialize(name)
        @name = name
      end

      def type
        case name
        when :headless_chrome
          :chrome
        when :headless_firefox
          :firefox
        else
          name
        end
      end

      def options
        case name
        when :headless_chrome
          headless_chrome_browser_options
        when :headless_firefox
          headless_firefox_browser_options
        end
      end

      private
        def headless_chrome_browser_options
          options = Selenium::WebDriver::Chrome::Options.new
          options.args << "--headless"
          options.args << "--disable-gpu" if Gem.win_platform?

          options
        end

        def headless_firefox_browser_options
          options = Selenium::WebDriver::Firefox::Options.new
          options.args << "-headless"

          options
        end
    end
  end
end

Version data entries

85 entries across 85 versions & 4 rubygems

Version Path
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/system_testing/browser.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/system_testing/browser.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/system_testing/browser.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/system_testing/browser.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/system_testing/browser.rb
spiral_form-0.1.1 vendor/bundle/gems/actionpack-5.2.3/lib/action_dispatch/system_testing/browser.rb
spiral_form-0.1.0 vendor/bundle/gems/actionpack-5.2.3/lib/action_dispatch/system_testing/browser.rb
zuora_connect_ui-0.7.1 vendor/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/system_testing/browser.rb
zuora_connect_ui-0.7.0 vendor/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/system_testing/browser.rb
jets-1.9.7 vendor/rails/actionpack/lib/action_dispatch/system_testing/browser.rb
jets-1.9.6 vendor/rails/actionpack/lib/action_dispatch/system_testing/browser.rb
jets-1.9.5 vendor/rails/actionpack/lib/action_dispatch/system_testing/browser.rb
jets-1.9.4 vendor/rails/actionpack/lib/action_dispatch/system_testing/browser.rb
jets-1.9.3 vendor/rails/actionpack/lib/action_dispatch/system_testing/browser.rb
jets-1.9.2 vendor/rails/actionpack/lib/action_dispatch/system_testing/browser.rb
jets-1.9.1 vendor/rails/actionpack/lib/action_dispatch/system_testing/browser.rb
jets-1.9.0 vendor/rails/actionpack/lib/action_dispatch/system_testing/browser.rb
jets-1.8.14 vendor/rails/actionpack/lib/action_dispatch/system_testing/browser.rb
jets-1.8.13 vendor/rails/actionpack/lib/action_dispatch/system_testing/browser.rb
jets-1.8.12 vendor/rails/actionpack/lib/action_dispatch/system_testing/browser.rb