Module: Capybara::Screenshot::Diff::Drivers

Defined in:
lib/capybara/screenshot/diff/drivers/base_driver.rb,
lib/capybara/screenshot/diff/drivers.rb,
lib/capybara/screenshot/diff/drivers/vips_driver.rb,
lib/capybara/screenshot/diff/drivers/chunky_png_driver.rb

Overview

Compare two images and determine if they are equal, different, or within some comparison range considering color values and difference area size.

Defined Under Namespace

Classes: BaseDriver, ChunkyPNGDriver, VipsDriver

Constant Summary collapse

DEFAULT_HIGHLIGHT_COLOR =
[255, 0, 0, 255].freeze

Class Method Summary collapse

Class Method Details

.for(driver_options = {}) ⇒ Object



7
8
9
10
11
12
# File 'lib/capybara/screenshot/diff/drivers.rb', line 7

def self.for(driver_options = {})
  driver_option = driver_options.is_a?(Hash) ? driver_options.fetch(:driver, :chunky_png) : driver_options
  return driver_option unless driver_option.is_a?(Symbol)

  Utils.find_driver_class_for(driver_option).new
end