lib/selenium-connect/runner.rb in selenium-connect-1.2.1 vs lib/selenium-connect/runner.rb in selenium-connect-1.3.0
- old
+ new
@@ -1,9 +1,5 @@
-#browser type determines server type
-#browser type determines config params
-#initializer *should* be the same
-
module SeleniumConnect
class Runner
attr_reader :driver, :configuration
def initialize(configuration)
@@ -15,12 +11,20 @@
def set_server_url
"http://#{configuration.host}:#{configuration.port}/wd/hub"
end
+ def get_profile
+ if configuration.profile_path
+ Selenium::WebDriver::Firefox::Profile.new configuration.profile_path
+ elsif configuration.profile_name
+ Selenium::WebDriver::Firefox::Profile.from_name configuration.profile_name
+ end
+ end
+
def set_profile
- profile = Selenium::WebDriver::Firefox::Profile.new(configuration.profile_path)
- profile.assume_untrusted_certificate_issuer = false
+ profile = get_profile
+ profile.assume_untrusted_certificate_issuer = false unless profile.nil?
Selenium::WebDriver::Remote::Capabilities.firefox(:firefox_profile => profile)
end
def initialize_driver
Selenium::WebDriver::Remote::Bridge.new(