lib/billy/browsers/capybara.rb in puffing-billy-3.0.3 vs lib/billy/browsers/capybara.rb in puffing-billy-3.0.4
- old
+ new
@@ -6,11 +6,12 @@
DRIVERS = {
poltergeist: 'capybara/poltergeist',
webkit: 'capybara/webkit',
selenium: 'selenium/webdriver',
- apparition: 'capybara/apparition'
+ apparition: 'capybara/apparition',
+ cuprite: 'capybara/cuprite'
}
def self.register_drivers
DRIVERS.each do |name, driver|
begin
@@ -101,9 +102,23 @@
end
def self.register_apparition_driver
::Capybara.register_driver :apparition_billy do |app|
::Capybara::Apparition::Driver.new(app, ignore_https_errors: true).tap do |driver|
+ driver.set_proxy(Billy.proxy.host, Billy.proxy.port)
+ end
+ end
+ end
+
+ def self.register_cuprite_driver
+ driver_otions = {
+ browser_options: {
+ 'ignore-certificate-errors' => nil
+ }
+ }.deep_merge(Billy.config.cuprite_options)
+
+ ::Capybara.register_driver :cuprite_billy do |app|
+ ::Capybara::Cuprite::Driver.new(app, **driver_otions).tap do |driver|
driver.set_proxy(Billy.proxy.host, Billy.proxy.port)
end
end
end