Class: Applitools::Calabash::AndroidScreenshotProvider
- Inherits:
-
CalabashScreenshotProvider
- Object
- CalabashScreenshotProvider
- Applitools::Calabash::AndroidScreenshotProvider
- Includes:
- Singleton
- Defined in:
- lib/applitools/calabash/calabash_screenshot_provider.rb
Constant Summary
Constants inherited from CalabashScreenshotProvider
CalabashScreenshotProvider::WAIT_BEFORE_SCREENSHOT
Instance Attribute Summary
Attributes inherited from CalabashScreenshotProvider
#context, #debug_screenshot_provider, #density
Instance Method Summary collapse
Methods inherited from CalabashScreenshotProvider
#initialize, #using_context, #with_debug_screenshot_provider, #with_density
Constructor Details
This class inherits a constructor from Applitools::Calabash::CalabashScreenshotProvider
Instance Method Details
#capture_screenshot(options = {}) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/applitools/calabash/calabash_screenshot_provider.rb', line 44 def capture_screenshot( = {}) sleep WAIT_BEFORE_SCREENSHOT result = nil Applitools::Calabash::Utils.using_screenshot(context) do |screenshot_path| screenshot = ::ChunkyPNG::Image.from_file(screenshot_path) save_debug_screenshot(screenshot, ['original', [:debug_suffix]]) = Applitools::Calabash::EyesSettings.instance. screenshot.crop!(0, 0, [:width], [:height]) save_debug_screenshot(screenshot, ['cropped', [:debug_suffix]]) result = Applitools::Calabash::EyesCalabashAndroidScreenshot.new( Applitools::Screenshot.from_image( screenshot ), density: density ) end result end |