Skip to content

Commit 2e28b32

Browse files
authored
fix: Tweak screen option (#256)
* tweak screen option * update * fix robocop
1 parent e981b2c commit 2e28b32

File tree

5 files changed

+11
-22
lines changed

5 files changed

+11
-22
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Read `release_notes.md` for commit level details.
1010

1111
### Deprecations
1212

13-
## [3.6.0] - 2020-03-15
13+
## [3.6.1, 3.6.0] - 2020-03-15
1414

1515
### Enhancements
1616
- Add screen record feature for Windows driver (https://github.com/appium/appium-windows-driver/pull/66)

lib/appium_lib_core/android/device.rb

+2
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ module Device
245245
# @param [Boolean] bug_report Set it to +true+ in order to display additional information on the video overlay,
246246
# such as a timestamp, that is helpful in videos captured to illustrate bugs.
247247
# This option is only supported since API level 27 (Android P).
248+
# @return [String] Base64 encoded content of the recorded media file or an empty string
249+
# if the file has been successfully uploaded to a remote location (depends on the actual options)
248250
#
249251
# @example
250252
#

lib/appium_lib_core/ios/xcuitest/device.rb

+2
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ module Device
9191
# - https://www.reddit.com/r/linux4noobs/comments/671z6b/width_not_divisible_by_2_error_when_using_ffmpeg/
9292
# @param [String] pixel_format Output pixel format. Run +ffmpeg -pix_fmts+ to list possible values.
9393
# For Quicktime compatibility, set to "yuv420p" along with videoType: "libx264".
94+
# @return [String] Base64 encoded content of the recorded media file or an empty string
95+
# if the file has been successfully uploaded to a remote location (depends on the actual options)
9496
#
9597
# @example
9698
#

lib/appium_lib_core/windows/device.rb

+3-15
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,8 @@ module Device
2929
# This method requires FFMPEG (https://www.ffmpeg.org/download.html) to be installed and present in PATH.
3030
# The resulting video uses H264 codec and is ready to be played by media players built-in into web browsers.
3131
#
32-
# @param [String] remote_path The path to the remote location, where the resulting video should be uploaded.
33-
# The following protocols are supported: http/https, ftp.
34-
# Null or empty string value (the default setting) means the content of resulting
35-
# file should be encoded as Base64 and passed as the endpount response value.
36-
# An exception will be thrown if the generated media file is too big to
37-
# fit into the available process memory.
38-
# This option only has an effect if there is screen recording process in progreess
39-
# and +forceRestart+ parameter is not set to +true+.
40-
# @param [String] user The name of the user for the remote authentication.
41-
# @param [String] pass The password for the remote authentication.
42-
# @param [String] method The http multipart upload method name. The 'PUT' one is used by default.
43-
# @param [Boolean] force_restart Whether to try to catch and upload/return the currently running screen recording
44-
# (+false+, the default setting on server) or ignore the result of it
45-
# and start a new recording immediately (+true+).
46-
# @param [String] time_limit Recording time. 180 seconds is by default.
32+
# @param [Boolean] force_restart Whether to stop existing recording process forcefully and start a new recording process.
33+
# @param [String] time_limit Recording time. 600 seconds is by default.
4734
# @param [Number|String] fps The count of frames per second in the resulting video.
4835
# Increasing fps value also increases the size of the resulting
4936
# video file and the CPU usage. Defaults to 15.
@@ -73,6 +60,7 @@ module Device
7360
# @param [String] audio_input If provided then the given audio input will be used to record the computer audio
7461
# along with the desktop video. The list of available devices could be retrieved using
7562
# +ffmpeg -list_devices true -f dshow -i dummy+ command.
63+
# @return [String] Base64 encoded content of the recorded media file
7664
#
7765
# @example
7866
#

lib/appium_lib_core/windows/device/screen.rb

+3-6
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,11 @@ module Screen
2020
def self.add_methods
2121
::Appium::Core::Device.add_endpoint_method(:start_recording_screen) do
2222
# rubocop:disable Metrics/ParameterLists
23-
def start_recording_screen(remote_path: nil, user: nil, pass: nil, method: 'PUT',
24-
force_restart: nil, time_limit: nil,
23+
def start_recording_screen(force_restart: nil, time_limit: nil,
2524
fps: nil, preset: nil, video_filter: nil,
2625
capture_clicks: nil, capture_cursor: nil, audio_input: nil)
27-
option = ::Appium::Core::Base::Device::ScreenRecord.new(
28-
remote_path: remote_path, user: user, pass: pass, method: method, force_restart: force_restart
29-
).upload_option
30-
26+
option = {}
27+
option[:forceRestart] = force_restart unless force_restart.nil?
3128
option[:timeLimit] = time_limit unless time_limit.nil?
3229
option[:fps] = fps unless fps.nil?
3330
option[:preset] = preset unless preset.nil?

0 commit comments

Comments
 (0)