class Selenium::WebDriver::Safari::Options

Attributes

automatic_inspection[RW]
automatic_profiling[RW]

Public Class Methods

new(**opts) click to toggle source

Create a new Options instance for W3C-capable versions of Safari.

@example

options = Selenium::WebDriver::Safari::Options.new(automatic_inspection: true)
driver = Selenium::WebDriver.for :safari, options: options

@param [Hash] opts the pre-defined options to create the Safari::Options with @option opts [Boolean] :automatic_inspection Preloads Web Inspector and JavaScript debugger. Default is false @option opts [Boolean] :automatic_profiling Preloads Web Inspector and starts a timeline recording. Default is false

@see developer.apple.com/documentation/webkit/about_webdriver_for_safari

# File lib/selenium/webdriver/safari/options.rb, line 40
def initialize(**opts)
  @automatic_inspection = opts.delete(:automatic_inspection) || false
  @automatic_profiling = opts.delete(:automatic_profiling) || false
end

Public Instance Methods

as_json(*) click to toggle source

@api private

# File lib/selenium/webdriver/safari/options.rb, line 49
def as_json(*)
  opts = {}

  opts['safari:automaticInspection'] = true if @automatic_inspection
  opts['safari:automaticProfiling'] = true if @automatic_profiling

  opts
end