lib/fluent.rb in fluent-0.3.0 vs lib/fluent.rb in fluent-0.4.0

- old
+ new

@@ -7,21 +7,22 @@ require 'fluent/evaluators' require 'fluent/generators' require 'watir-webdriver' require 'selenium-webdriver' +require 'mechanize' module Fluent include Platforms include Evaluators include Enclosers # Browser drivers will be: # [Watir::Browser] or [Selenium::WebDriver::Driver] # # @return [Object] browser driver reference - attr_reader :browser + attr_reader :driver # Platform references will be: # [Fluent::Platforms::WatirWebDriver::PlatformObject] # [Fluent::Platforms::SeleniumWebDriver::PlatformObject] # @@ -49,18 +50,16 @@ # A few key things are happening here that are critical to everything # working properly: # (1) A browser instance is being created. # (2) A platform object is created for that browser. # - # @param browser [Object] a browser instance with a tool driver - def initialize(browser=nil, visit=nil) - @browser = browser - @browser = Watir::Browser.new if browser.nil? or browser == :watir - @browser = Selenium::WebDriver.for :firefox if browser == :selenium - - Fluent::trace("Fluent attached to browser: #{@browser}") + # @param driver [Object] a tool driver instance + def initialize(driver=nil, visit=nil) + @driver = driver - establish_platform_object_for @browser + Fluent::trace("Fluent attached to driver: #{@driver}") + + establish_platform_object_for @driver view if visit && respond_to?(:view) end # Returns the default wait value for pages. This value is the default