class Applitools::Calabash::Target

Attributes

floating_regions[RW]
ignored_regions[RW]
options[RW]
region_to_check[RW]

Public Class Methods

new() click to toggle source
# File lib/applitools/calabash/target.rb, line 10
def initialize
  self.ignored_regions = []
  self.floating_regions = []
  self.options = {
    trim: false
  }
end

Public Instance Methods

fully() click to toggle source
# File lib/applitools/calabash/target.rb, line 18
def fully
  options[:stitch_content] = true
  self
end
ignore(region = nil) click to toggle source
# File lib/applitools/calabash/target.rb, line 23
def ignore(region = nil)
  if region
    Applitools::ArgumentGuard.is_a? region, 'region', Applitools::Calabash::CalabashElement
    ignored_regions << region.region
  else
    self.ignored_regions = []
  end
  self
end
region(region = nil) click to toggle source
# File lib/applitools/calabash/target.rb, line 33
def region(region = nil)
  if region
    case region
    when Applitools::Calabash::CalabashElement, Applitools::Region
      self.region_to_check = region
    else
      self.region_to_check = nil
      raise(
        Applitools::EyesIllegalArgument,
        'Expected region to be instance of Applitools::Calabash::CalabashElement or Applitools::Region'
      )
    end
  else
    self.region_to_check = nil
  end
  self
end