Class: Watir::Capabilities

Inherits:
Object
  • Object
show all
Defined in:
lib/watir/capabilities.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(browser, options = {}) ⇒ Capabilities

Returns a new instance of Capabilities.


5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/watir/capabilities.rb', line 5

def initialize(browser, options = {})
  @options = options.dup
  Watir.logger.info "Creating Browser instance of #{browser} with user provided options: #{@options.inspect}"
  @browser = if browser == :remote && @options.key?(:browser)
               @options.delete(:browser)
             elsif browser == :remote && @options.key?(:desired_capabilities)
               @options[:desired_capabilities].browser_name.to_sym
             else
               browser.to_sym
             end
  @selenium_browser = browser == :remote || options[:url] ? :remote : browser

  @selenium_opts = {}
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options


3
4
5
# File 'lib/watir/capabilities.rb', line 3

def options
  @options
end

Instance Method Details

#to_argsObject


20
21
22
# File 'lib/watir/capabilities.rb', line 20

def to_args
  [@selenium_browser, process_arguments]
end