lib/watir/capabilities.rb in watir-6.6.2 vs lib/watir/capabilities.rb in watir-6.6.3
- old
+ new
@@ -2,13 +2,19 @@
class Capabilities
attr_reader :options
def initialize(browser, options = {})
- @browser = browser == :remote ? @options.delete(:browser).to_sym : browser.to_sym
+ @options = options.dup
+ @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
- @options = options.dup
@selenium_opts = {}
end
def to_args
[@selenium_browser, process_capabilities]
\ No newline at end of file