lib/rdee/browser_factory.rb in RDee-0.2 vs lib/rdee/browser_factory.rb in RDee-0.3
- old
+ new
@@ -1,18 +1,17 @@
require_relative 'target_parser'
+require_relative 'mobile_devices'
-
-
module RDee
class ConnectionError < StandardError
end
class BrowserFactory
include TargetParser
attr_accessor :url, :persistent_http, :chrome_options, :firefox_options,
- :ie_options, :safari_options
+ :ie_options, :safari_options, :iphone_options
def watir_browser(target, options)
platform, options = platform_and_options(target, options)
watir_browser_for(platform, options)
end
@@ -79,10 +78,11 @@
options = {}
options.merge!(chrome_options) if need_chrome_options? target
options.merge!(firefox_options) if need_firefox_options? target
options.merge!(ie_options) if need_ie_optons? target
options.merge!(safari_options) if need_safari_options? target
+ options.merge!(iphone_options) if need_iphone_options? target
options
end
def need_chrome_options?(target)
not chrome_options.nil? and target.to_s.include? 'chrome'
@@ -96,8 +96,12 @@
not ie_options.nil? and target.to_s.include? 'ie'
end
def need_safari_options?(target)
not safari_options.nil? and target.to_s.include? 'safari'
+ end
+
+ def need_iphone_options?(target)
+ not iphone_options.nil? and target.to_s.include? 'iphone'
end
end
end