Module: Appium::Core::Mac2::Device::Screen

Defined in:
lib/appium_lib_core/mac2/device/screen.rb

Class Method Summary collapse

Class Method Details

.add_methodsObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/appium_lib_core/mac2/device/screen.rb', line 20

def self.add_methods
  ::Appium::Core::Device.add_endpoint_method(:start_recording_screen) do
    def start_recording_screen(remote_path: nil, user: nil, pass: nil, method: 'PUT',
                               file_field_name: nil, form_fields: nil, headers: nil, force_restart: nil,
                               fps: nil, preset: nil, video_filter: nil, time_limit: nil,
                               enable_capture_clicks: nil, enable_cursor_capture: nil, device_id: 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,
        force_restart: force_restart
      ).upload_option

      option[:fps] = fps unless fps.nil?
      option[:preset] = preset unless preset.nil?
      option[:videoFilter] = video_filter unless video_filter.nil?
      option[:captureClicks] = enable_capture_clicks unless enable_capture_clicks.nil?
      option[:captureCursor] = enable_cursor_capture unless enable_cursor_capture.nil?
      option[:deviceId] = device_id unless device_id.nil?
      option[:timeLimit] = time_limit unless time_limit.nil?

      execute(:start_recording_screen, {}, { options: option })
    end
  end
end