lib/watirgrid.rb in watirgrid-1.1.3.pre vs lib/watirgrid.rb in watirgrid-1.1.3

- old
+ new

@@ -11,24 +11,24 @@ class Grid attr_accessor :drb_server_uri, :ring_server, :browsers, :tuples, :providers def initialize(params = {}) - @drb_server_host = params[:drb_server_host] || external_interface - @drb_server_port = params[:drb_server_port] || 0 - @controller_uri = params[:controller_uri] - @ring_server_host = params[:ring_server_host] || external_interface unless @controller_uri - @ring_server_port = params[:ring_server_port] || Rinda::Ring_PORT - @renewer = params[:renewer] || Rinda::SimpleRenewer.new - logfile = params[:logfile] || STDOUT - @log = Logger.new(logfile, 'daily') - @log.level = params[:loglevel] || Logger::ERROR - @log.datetime_format = "%Y-%m-%d %H:%M:%S " - @webdriver_browser_type = params[:browser].to_sym if params[:browser] - @browsers = [] - @tuples = [] - @providers = [] + @drb_server_host = params[:drb_server_host] || external_interface + @drb_server_port = params[:drb_server_port] || 0 + @controller_uri = params[:controller_uri] + @ring_server_host = params[:ring_server_host] || external_interface unless @controller_uri + @ring_server_port = params[:ring_server_port] || Rinda::Ring_PORT + @renewer = params[:renewer] || Rinda::SimpleRenewer.new + logfile = params[:logfile] || STDOUT + @log = Logger.new(logfile, 'daily') + @log.level = params[:loglevel] || Logger::ERROR + @log.datetime_format = "%Y-%m-%d %H:%M:%S " + @browser_type = params[:browser_type] + @browsers = [] + @tuples = [] + @providers = [] end ## # Start required services def start(params = {}) @@ -53,11 +53,11 @@ ## # Instantiate new browser object on each of the remote providers def setup @browsers.each_with_index do |browser, index| sleep 0.15 - @providers[index] ||= browser[:object].new_browser(@webdriver_browser_type) + @providers[index] ||= browser[:object].new_browser @browser_type end end ## # Iterate with a block over each of the remote providers @@ -81,11 +81,11 @@ threads = [] grid.browsers.each_with_index do |browser, index| sleep rampup(grid.size, params) threads << Thread.new do start = ::Time.now - @browser = browser[:object].new_browser + @browser = browser[:object].new_browser params[:browser_type] yield @browser, "#{index}" end end threads.each {|thread| thread.join} end @@ -174,11 +174,11 @@ nil, # watir provider nil, # browser front object nil, # provider description nil, # hostname params[:architecture], - params[:browser_type] + params[:driver] ]) end ## # Filter tuple by hostnames @@ -210,10 +210,10 @@ tuple_hash[:class] = tuple[1] tuple_hash[:object] = tuple[2] tuple_hash[:description] = tuple[3] tuple_hash[:hostname] = tuple[4] tuple_hash[:architecture] = tuple[5] - tuple_hash[:browser_type] = tuple[6] + tuple_hash[:driver] = tuple[6] tuple_hash end end