Class: Applitools::Calabash::EyesCalabashIosScreenshot

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

Instance Method Summary collapse

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