module DotDiff

Constants

SUPPORTED_THRESHOLD_TYPES
VERSION

Attributes

failure_image_path[RW]
hide_elements_on_non_full_screen_screenshot[W]
image_magick_diff_bin[W]
image_magick_options[W]
image_store_path[RW]
overwrite_on_resave[RW]
resave_base_image[W]
xpath_elements_to_hide[W]

Public Class Methods

configure() { |self| ... } click to toggle source
# File lib/dotdiff.rb, line 37
def configure
  yield self
end
hide_elements_on_non_full_screen_screenshot() click to toggle source
# File lib/dotdiff.rb, line 49
def hide_elements_on_non_full_screen_screenshot
  @hide_elements_on_non_full_screen_screenshot ||= false
end
image_magick_diff_bin() click to toggle source
# File lib/dotdiff.rb, line 57
def image_magick_diff_bin
  @image_magick_diff_bin.to_s.strip
end
image_magick_options() click to toggle source
# File lib/dotdiff.rb, line 53
def image_magick_options
  @image_magick_options ||= '-fuzz 5% -metric AE'
end
pixel_threshold() click to toggle source
# File lib/dotdiff.rb, line 61
def pixel_threshold
  @pixel_threshold ||= { type: 'pixel', value: 100 }
end
pixel_threshold=(config) click to toggle source
# File lib/dotdiff.rb, line 65
def pixel_threshold=(config)
  unless config.class == Hash
    Kernel.warn '[Dotdiff deprecation] Pass a hash options instead of integer to support pixel/percentage threshold'
    @pixel_threshold = config
    return
  end

  unless SUPPORTED_THRESHOLD_TYPES.include?(config.fetch(:type))
    raise UnknownTypeError, "Unknown threshold type supports only: #{SUPPORTED_THRESHOLD_TYPES.join(',')}"
  end

  if config.fetch(:type) == 'percent' && config.fetch(:value) > 1
    raise InvalidValueError, 'Percent value should be a float between 0 and 1'
  end

  @pixel_threshold = config
end
resave_base_image() click to toggle source
# File lib/dotdiff.rb, line 41
def resave_base_image
  @resave_base_image ||= false
end
xpath_elements_to_hide() click to toggle source
# File lib/dotdiff.rb, line 45
def xpath_elements_to_hide
  @xpath_elements_to_hide ||= []
end