@@ -77,6 +77,27 @@ module Device
7777 # @driver.get_performance_data package_name: package_name, data_type: data_type, data_read_timeout: 2
7878 #
7979
80+ # @!method start_recording_screen(package_name:, data_type:, data_read_timeout: 1000)
81+ # Record the display of devices running Android 4.4 (API level 19) and higher.
82+ # It records screen activity to an MPEG-4 file. Audio is not recorded with the video file.
83+ # @param [String] file_path A path to save the video. `/sdcard/default.mp4` is by default.
84+ # @param [String] video_size A video size. '1280x720' is by default.
85+ # @param [String] time_limit Recording time. 180 second is by default.
86+ # @param [String] bit_rate The video bit rate for the video, in megabits per second. 3000000(3Mbps) is by default.
87+ #
88+ # @example
89+ #
90+ # @driver.start_recording_screen file_path: '/sdcard/default.mp4', video_size: '1280x720', time_limit: '180', bit_rate: '3000000'
91+ #
92+
93+ # @!method stop_recording_screen
94+ # Stop recording the screen.
95+ #
96+ # @example
97+ #
98+ # @driver.stop_recording_screen
99+ #
100+
80101 ####
81102 ## class << self
82103 ####
@@ -138,6 +159,12 @@ def get_performance_data(package_name:, data_type:, data_read_timeout: 1000)
138159 dataReadTimeout : data_read_timeout
139160 end
140161 end
162+
163+ Appium ::Core ::Device . add_endpoint_method ( :start_recording_screen ) do
164+ def start_recording_screen ( file_path : '/sdcard/default.mp4' , video_size : '1280x720' , time_limit : '180' , bit_rate : '3000000' )
165+ execute :start_recording_screen , { } , filePath : file_path , videoSize : video_size , timeLimit : time_limit , bitRate : bit_rate
166+ end
167+ end
141168 end
142169 end
143170 end # module Device
0 commit comments