class Applitools::Calabash::FullPageCaptureAlgorithm::Base

Constants

DEFAULT_SLEEP_INTERVAL

Attributes

context[R]
debug_screenshot_provider[R]
element[R]
screenshot_provider[R]
stitched_image[R]

Public Class Methods

new(screenshot_provider, element, options = {}) click to toggle source
# File lib/applitools/calabash/full_page_capture_algorithm/base.rb, line 15
def initialize(screenshot_provider, element, options = {})
  Applitools::ArgumentGuard.is_a?(element, 'element', Applitools::Calabash::CalabashElement)
  @screenshot_provider = screenshot_provider
  @element = element
  @context = screenshot_provider.context
  return unless options[:debug_screenshot_provider]
  Applitools::ArgumentGuard.is_a?(
    options[:debug_screenshot_provider],
    'options[:debug_screenshot_provider]',
    Applitools::DebugScreenshotProvider
  )
  @debug_screenshot_provider = options[:debug_screenshot_provider]
end

Private Instance Methods

create_entire_image() click to toggle source
# File lib/applitools/calabash/full_page_capture_algorithm/base.rb, line 31
def create_entire_image
  current_entire_size = entire_size
  @stitched_image = ::ChunkyPNG::Image.new(current_entire_size.width, current_entire_size.height)
end
entire_content() click to toggle source
# File lib/applitools/calabash/full_page_capture_algorithm/base.rb, line 36
def entire_content
  @entire_content ||= scrollable_element
end
put_it_on_canvas!(image, offset) click to toggle source
# File lib/applitools/calabash/full_page_capture_algorithm/base.rb, line 44
def put_it_on_canvas!(image, offset)
  debug_screenshot_provider.save(image, "#{offset.x} x #{offset.y}") if debug_screenshot_provider
  stitched_image.replace!(image, offset.x, offset.y)
end