Class: Hive::Diagnostic::Android::Screenshot

Inherits:
Hive::Diagnostic show all
Defined in:
lib/hive/diagnostic/android/screenshot.rb

Instance Method Summary collapse

Instance Method Details

#diagnoseObject



7
8
9
10
11
12
13
# File 'lib/hive/diagnostic/android/screenshot.rb', line 7

def diagnose
  screenshot_file = Tempfile.new(["#{@device_api.serial}-screenshot", '.png']).path
  @device_api.screenshot(filename: screenshot_file)
  hive_device = Hive.hive_mind.device_details['connected_devices'].select { |d| d['serial'] == @device_api.serial }.first
  Hive.hive_mind.send_screenshot( { device_id: hive_device[:id], screenshot: screenshot_file } ) unless hive_device.nil?
  self.pass('Screenshot captured')
end

#repair(result) ⇒ Object



15
16
17
# File 'lib/hive/diagnostic/android/screenshot.rb', line 15

def repair(result)

end