Class: Applitools::Calabash::EyesCalabashIosScreenshot

Inherits:
EyesCalabashScreenshot show all
Defined in:
lib/applitools/calabash/eyes_calabash_ios_screenshot.rb

Constant Summary

Constants inherited from EyesCalabashScreenshot

Applitools::Calabash::EyesCalabashScreenshot::CONTEXT_RELATIVE, Applitools::Calabash::EyesCalabashScreenshot::DRIVER, Applitools::Calabash::EyesCalabashScreenshot::SCREENSHOT_AS_IS

Constants inherited from EyesScreenshot

EyesScreenshot::COORDINATE_TYPES

Instance Attribute Summary

Attributes inherited from EyesCalabashScreenshot

#scale_factor

Attributes inherited from EyesScreenshot

#image, #top_left_location

Instance Method Summary collapse

Methods inherited from EyesCalabashScreenshot

#convert_location, #initialize, #intersected_region, #location_in_screenshot, #scale_it!, #sub_screenshot

Methods inherited from EyesScreenshot

#initialize, #sub_screenshots

Methods included from Helpers

#abstract_attr_accessor, #abstract_method, #environment_attribute, environment_variables

Constructor Details

This class inherits a constructor from Applitools::Calabash::EyesCalabashScreenshot

Instance Method Details

#convert_region_location(region, from, to) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/applitools/calabash/eyes_calabash_ios_screenshot.rb', line 7

def convert_region_location(region, from, to)
  case from
  when DRIVER
    case to
    when SCREENSHOT_AS_IS
      region.scale_it!(scale_factor)
    else
      raise Applitools::EyesError, "from: #{from}, to: #{to}"
    end
  when CONTEXT_RELATIVE
    case to
    when SCREENSHOT_AS_IS
      region
    else
      raise Applitools::EyesError, "from: #{from}, to: #{to}"
    end
  else
    raise Applitools::EyesError, "from: #{from}, to: #{to}"
  end
  region
end