Sha256: f309f3b699a98580f238e98af15b728f591dfbc41274d6ee62dc20ca298b73af

Contents?: true

Size: 636 Bytes

Versions: 1

Compression:

Stored size: 636 Bytes

Contents

# :phantomjs driver

Capybara.register_driver :phantomjs do |app|
  caps = {
    javascript_enabled: !Howitzer.phantom_ignore_js_errors
  }
  caps['phantomjs.page.settings.userAgent'] = "WebKit #{Howitzer.user_agent}" if Howitzer.user_agent.present?
  Capybara::Selenium::Driver.new(
    app, browser: :phantomjs,
         desired_capabilities: caps,
         driver_opts: {
           args: ["--ignore-ssl-errors=#{Howitzer.phantom_ignore_ssl_errors ? 'yes' : 'no'}"]
         }
  )
end

Capybara.save_path = Howitzer.log_dir
Capybara::Screenshot.register_driver(:phantomjs) do |driver, path|
  driver.browser.save_screenshot path
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
howitzer-2.1.0 generators/config/templates/drivers/phantomjs.rb