Permalink
Browse files

Pass through options to drivers, final puzzle piece!

  • Loading branch information...
1 parent be6aaa9 commit 4c6c5cd4fad5d256ac54544d80421f0c837a2e14 @jnicklas jnicklas committed Sep 15, 2010
View
@@ -25,9 +25,9 @@ GEM
configuration (>= 0.0.5)
rake (>= 0.8.1)
mime-types (1.16)
+ nokogiri (1.4.2)
nokogiri (1.4.2-java)
weakling (>= 0.0.3)
- nokogiri (1.4.2)
rack (1.2.1)
rack-test (0.5.4)
rack (>= 1.0)
@@ -84,10 +84,11 @@ def select_node
end
- attr_reader :app, :rack_server
+ attr_reader :app, :rack_server, :options
- def initialize(app)
+ def initialize(app, options={})
@app = app
+ @options = options
@rack_server = Capybara::Server.new(@app)
@rack_server.boot if Capybara.run_server
end
@@ -14,7 +14,7 @@ def self.server
def browser
unless @_browser
- @_browser = ::Culerity::RemoteBrowserProxy.new self.class.server, {:browser => :firefox, :log_level => :off}
+ @_browser = ::Culerity::RemoteBrowserProxy.new self.class.server, options
at_exit do
@_browser.close
@_browser.exit
@@ -61,7 +61,7 @@ def tag_name
def visible?
native.displayed? and native.displayed? != "false"
end
-
+
def find(locator)
native.find_elements(:xpath, locator).map { |n| self.class.new(driver, n) }
end
@@ -83,7 +83,7 @@ def type
def browser
unless @browser
- @browser = Selenium::WebDriver.for(options[:browser] || :firefox)
+ @browser = Selenium::WebDriver.for(options.delete(:browser) || :firefox, options)
at_exit do
@browser.quit
end

0 comments on commit 4c6c5cd

Please sign in to comment.