Module: Appium::Core::Base::Device::ScreenRecord::Command

Included in:
Bridge::MJSONWP, Bridge::W3C
Defined in:
lib/appium_lib_core/common/device/screen_record.rb

Instance Method Summary collapse

Instance Method Details

#stop_and_save_recording_screen(file_path) ⇒ Object


66
67
68
69
# File 'lib/appium_lib_core/common/device/screen_record.rb', line 66

def stop_and_save_recording_screen(file_path)
  base64data = execute(:stop_recording_screen, {}, {})
  File.open(file_path, 'wb') { |f| f << Base64.decode64(base64data) }
end

#stop_recording_screen(remote_path: nil, user: nil, pass: nil, method: 'PUT', file_field_name: nil, form_fields: nil, headers: nil) ⇒ Object


54
55
56
57
58
59
60
61
62
63
64
# File 'lib/appium_lib_core/common/device/screen_record.rb', line 54

def stop_recording_screen(remote_path: nil, user: nil, pass: nil, method: 'PUT',
                          file_field_name: nil, form_fields: nil, headers: nil)
  option = ::Appium::Core::Base::Device::ScreenRecord.new(
    remote_path: remote_path, user: user, pass: pass, method: method,
    file_field_name: file_field_name, form_fields: form_fields, headers: headers
  ).upload_option

  params = option.empty? ? {} : { options: option }

  execute(:stop_recording_screen, {}, params)
end