Skip to content

Commit

Permalink
Selenium and webkit drivers.
Browse files Browse the repository at this point in the history
  • Loading branch information
oesmith committed Oct 11, 2012
1 parent b985cc5 commit 9a21700
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion lib/billy/rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,21 @@ def proxy
end
end

# TODO selenium / webkit
if defined?(Capybara::Webkit)
Capybara.register_driver :webkit_billy do |app|
driver = Capybara::Webkit::Driver.new(app)
driver.browser.set_proxy(:host => Billy.proxy.host,
:port => Billy.proxy.port)
driver
end
end

if defined?(Selenium::WebDriver)
Capybara.register_driver :selenium_billy do |app|
profile = Selenium::WebDriver::Firefox::Profile.new
profile.proxy = Selenium::WebDriver::Proxy.new(
:http => "#{Billy.proxy.host}:#{Billy.proxy.port}")
Selenium::WebDriver.for :firefox, :profile => profile
end
end
end

0 comments on commit 9a21700

Please sign in to comment.