lib/selenium-connect/runner.rb in selenium-connect-2.0.0 vs lib/selenium-connect/runner.rb in selenium-connect-2.1.0
- old
+ new
@@ -1,13 +1,16 @@
+# Encoding: utf-8
+
require 'selenium-connect/runners/firefox'
require 'selenium-connect/runners/ie'
require 'selenium-connect/runners/chrome'
require 'selenium-connect/runners/phantomjs'
require 'selenium-connect/runners/no_browser'
require 'selenium-connect/runners/saucelabs'
module SeleniumConnect
+ # Initializes the driver
class Runner
attr_reader :driver, :config
def initialize(config)
@config = config
@@ -24,27 +27,27 @@
if config.host == 'saucelabs'
Saucelabs.new(config).launch
else
Selenium::WebDriver.for(
:remote,
- :url => set_server_url,
- :desired_capabilities => get_browser)
+ url: set_server_url,
+ desired_capabilities: get_browser
+ )
end
end
def get_browser
- browser = browsers.find { |browser| browser.match? }
+ browser = browsers.find { |found_browser| found_browser.match? }
browser.launch
end
def browsers
firefox = Firefox.new(config)
ie = InternetExplorer.new(config)
chrome = Chrome.new(config)
phantomjs = PhantomJS.new(config)
no_browser = NoBrowser.new(config)
-
- browsers = [ firefox, ie, chrome, phantomjs, no_browser ]
+ [firefox, ie, chrome, phantomjs, no_browser]
end
- end #Runner
-end #SeleniumConnect
+ end # Runner
+end # SeleniumConnect