Sha256: b8839236d95e082c2e3d58124a8aa07ef98d973e9dd741a61277db72b090eeec

Contents?: true

Size: 1.28 KB

Versions: 1

Compression:

Stored size: 1.28 KB

Contents

HOWITZER_KNOWN_DRIVERS = %i[
  appium
  selenium
  selenium_grid
  sauce
  testingbot
  browserstack
  crossbrowsertesting
  headless_chrome
  headless_firefox
].freeze

unless HOWITZER_KNOWN_DRIVERS.include?(Howitzer.driver.to_s.to_sym)
  raise Howitzer::UnknownDriverError, "Unknown '#{Howitzer.driver}' driver." \
                                      " Check your settings, it should be one of #{HOWITZER_KNOWN_DRIVERS}"
end

Capybara.configure do |config|
  config.run_server = false
  config.app_host = nil
  config.asset_host = Howitzer.app_uri.origin
  config.default_selector = :css
  config.default_max_wait_time = Howitzer.capybara_wait_time
  config.ignore_hidden_elements = true
  config.match = :one
  config.exact = true
  config.visible_text_only = true
  config.default_driver = Howitzer.driver.to_s.to_sym
  config.javascript_driver = Howitzer.driver.to_s.to_sym
end

require 'howitzer/capybara_helpers'

# namespace for capybara helpers
module CapybaraHelpers
  extend Howitzer::CapybaraHelpers
end

require_relative "drivers/#{Howitzer.driver}"

Capybara.save_path = Howitzer.log_dir

Capybara::Screenshot.append_timestamp = false
Capybara::Screenshot.register_filename_prefix_formatter(:default) do
  "capybara-screenshot-#{Gen.serial}"
end
Capybara::Screenshot.prune_strategy = :keep_all

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
howitzer-2.3.0 generators/config/templates/capybara.rb