From f568cae3f498e298ec0ff153dab3fe69be7b126e Mon Sep 17 00:00:00 2001 From: Atsushi Mori Date: Tue, 9 Feb 2021 02:14:13 +0900 Subject: [PATCH 1/5] Add table for kwarg --- appium/webdriver/extensions/screen_record.py | 82 ++++++++++++++++---- 1 file changed, 69 insertions(+), 13 deletions(-) diff --git a/appium/webdriver/extensions/screen_record.py b/appium/webdriver/extensions/screen_record.py index d2f308377..18d6ff38c 100644 --- a/appium/webdriver/extensions/screen_record.py +++ b/appium/webdriver/extensions/screen_record.py @@ -29,6 +29,62 @@ class ScreenRecord(webdriver.Remote): def start_recording_screen(self: T, **options: Any) -> Union[bytes, str]: """Start asynchronous screen recording process. + +--------------+-----+---------+-----+-------+ + | Keyword Args | iOS | Android | Win | macOS | + +==============+=====+=========+=====+=======+ + | remotePath | O | O | O | O | + +--------------+-----+---------+-----+-------+ + | user | O | O | O | O | + +--------------+-----+---------+-----+-------+ + | password | O | O | O | O | + +--------------+-----+---------+-----+-------+ + | method | O | O | O | O | + +--------------+-----+---------+-----+-------+ + | timeLimit | O | O | O | O | + +--------------+-----+---------+-----+-------+ + | user | O | O | O | O | + +--------------+-----+---------+-----+-------+ + | forceRestart | O | O | O | O | + +--------------+-----+---------+-----+-------+ + | bugReport | O | O | O | O | + +--------------+-----+---------+-----+-------+ + | fileFieldName| O | O | O | O | + +--------------+-----+---------+-----+-------+ + | formFields | O | O | O | O | + +--------------+-----+---------+-----+-------+ + | bugReport | O | O | O | O | + +--------------+-----+---------+-----+-------+ + | headers | O | O | O | O | + +--------------+-----+---------+-----+-------+ + | videoQuality | O | | | | + +--------------+-----+---------+-----+-------+ + | videoType | O | | | | + +--------------+-----+---------+-----+-------+ + | videoFps | O | | | | + +--------------+-----+---------+-----+-------+ + | videoFilter | O | | O | O | + +--------------+-----+---------+-----+-------+ + | videoScale | O | | | | + +--------------+-----+---------+-----+-------+ + | pixelFormat | O | | | | + +--------------+-----+---------+-----+-------+ + | videoSize | | O | | | + +--------------+-----+---------+-----+-------+ + | bitRate | | O | | | + +--------------+-----+---------+-----+-------+ + | fps | | | O | O | + +--------------+-----+---------+-----+-------+ + | captureCursor| | | O | O | + +--------------+-----+---------+-----+-------+ + | captureClick | | | O | O | + +--------------+-----+---------+-----+-------+ + | deviceId | | | | O | + +--------------+-----+---------+-----+-------+ + | preset | | | O | O | + +--------------+-----+---------+-----+-------+ + | audioInput | | | O | | + +--------------+-----+---------+-----+-------+ + Keyword Args: remotePath (str): The remotePath upload option is the path to the remote location, where the resulting video from the previous screen recording should be uploaded. @@ -63,41 +119,41 @@ def start_recording_screen(self: T, **options: Any) -> Union[bytes, str]: the same key as `fileFieldName` then it is going to be ignored. (Since Appium 1.18.0) headers (dict): [multipart/form-data requests] Headers mapping (Since Appium 1.18.0) - videoQuality (str): [iOS only] The video encoding quality: 'low', 'medium', 'high', 'photo'. Defaults + videoQuality (str): [iOS] The video encoding quality: 'low', 'medium', 'high', 'photo'. Defaults to 'medium'. - videoType (str): [iOS only] The format of the screen capture to be recorded. + videoType (str): [iOS] The format of the screen capture to be recorded. Available formats: Execute `ffmpeg -codecs` in the terminal to see the list of supported video codecs. 'mjpeg' by default. (Since Appium 1.10.0) - videoFps (int): [iOS only] The Frames Per Second rate of the recorded video. Change this value if the + videoFps (int): [iOS] The Frames Per Second rate of the recorded video. Change this value if the resulting video is too slow or too fast. Defaults to 10. This can decrease the resulting file size. - videoFilters (str): [iOS, macOS only] The FFMPEG video filters to apply. These filters allow to scale, + videoFilters (str): [iOS, macOS] The FFMPEG video filters to apply. These filters allow to scale, flip, rotate and do many other useful transformations on the source video stream. The format of the property must comply with https://ffmpeg.org/ffmpeg-filters.html. (Since Appium 1.15) - videoScale (str): [iOS only] The scaling value to apply. Read https://trac.ffmpeg.org/wiki/Scaling for + videoScale (str): [iOS] The scaling value to apply. Read https://trac.ffmpeg.org/wiki/Scaling for possible values. No scale is applied by default. If videoFilters are set then the scale setting is effectively ignored. (Since Appium 1.10.0) - pixelFormat (str): [iOS only] Output pixel format. Run `ffmpeg -pix_fmts` to list possible values. + pixelFormat (str): [iOS] Output pixel format. Run `ffmpeg -pix_fmts` to list possible values. For Quicktime compatibility, set to "yuv420p" along with videoType: "libx264". (Since Appium 1.12.0) - videoSize (str): [Android only] The video size of the generated media file. The format is WIDTHxHEIGHT. + videoSize (str): [Android] The video size of the generated media file. The format is WIDTHxHEIGHT. The default value is the device's native display resolution (if supported), 1280x720 if not. For best results, use a size supported by your device's Advanced Video Coding (AVC) encoder. - bitRate (int): [Android only] The video bit rate for the video, in megabits per second. + bitRate (int): [Android] The video bit rate for the video, in megabits per second. The default value is 4. You can increase the bit rate to improve video quality, but doing so results in larger movie files. - fps (int): [macOS only] The count of frames per second in the resulting video. + fps (int): [macOS] The count of frames per second in the resulting video. Increasing fps value also increases the size of the resulting video file and the CPU usage. - captureCursor (bool): [macOS only] Whether to capture the mouse cursor while recording the screen. + captureCursor (bool): [macOS] Whether to capture the mouse cursor while recording the screen. Disabled by default. - captureClick (bool): [macOS only] Whether to capture the click gestures while recording the screen. + captureClick (bool): [macOS] Whether to capture the click gestures while recording the screen. Disabled by default. - deviceId (int): [macOS only] Screen device index to use for the recording. + deviceId (int): [macOS] Screen device index to use for the recording. The list of available devices could be retrieved using `ffmpeg -f avfoundation -list_devices true -i` command. This option is mandatory and must be always provided. - preset (str): [macOS only] A preset is a collection of options that will provide a certain encoding + preset (str): [macOS] A preset is a collection of options that will provide a certain encoding speed to compression ratio. A slower preset will provide better compression (compression is quality per filesize). This means that, for example, if you target a certain file size or constant bit rate, you will achieve better quality with a slower preset. From 17d3b139cf9b0f96fff47206847c20143e28f4ec Mon Sep 17 00:00:00 2001 From: Atsushi Mori Date: Wed, 10 Feb 2021 18:53:13 +0900 Subject: [PATCH 2/5] update --- appium/webdriver/extensions/screen_record.py | 26 +++++++++----------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/appium/webdriver/extensions/screen_record.py b/appium/webdriver/extensions/screen_record.py index 18d6ff38c..98e7a804a 100644 --- a/appium/webdriver/extensions/screen_record.py +++ b/appium/webdriver/extensions/screen_record.py @@ -46,14 +46,10 @@ def start_recording_screen(self: T, **options: Any) -> Union[bytes, str]: +--------------+-----+---------+-----+-------+ | forceRestart | O | O | O | O | +--------------+-----+---------+-----+-------+ - | bugReport | O | O | O | O | - +--------------+-----+---------+-----+-------+ | fileFieldName| O | O | O | O | +--------------+-----+---------+-----+-------+ | formFields | O | O | O | O | +--------------+-----+---------+-----+-------+ - | bugReport | O | O | O | O | - +--------------+-----+---------+-----+-------+ | headers | O | O | O | O | +--------------+-----+---------+-----+-------+ | videoQuality | O | | | | @@ -72,11 +68,13 @@ def start_recording_screen(self: T, **options: Any) -> Union[bytes, str]: +--------------+-----+---------+-----+-------+ | bitRate | | O | | | +--------------+-----+---------+-----+-------+ + | bugReport | | O | | | + +--------------+-----+---------+-----+-------+ | fps | | | O | O | +--------------+-----+---------+-----+-------+ | captureCursor| | | O | O | +--------------+-----+---------+-----+-------+ - | captureClick | | | O | O | + | captureClicks| | | O | O | +--------------+-----+---------+-----+-------+ | deviceId | | | | O | +--------------+-----+---------+-----+-------+ @@ -110,9 +108,6 @@ def start_recording_screen(self: T, **options: Any) -> Union[bytes, str]: forcedRestart (bool): Whether to ignore the result of previous capture and start a new recording immediately (`True` value). By default (`False`) the endpoint will try to catch and return the result of the previous capture if it's still available. - bugReport (str): Makes the recorder to display an additional information on the video overlay, - such as a timestamp, that is helpful in videos captured to illustrate bugs. - This option is only supported since API level 27 (Android P). fileFieldName (str): [multipart/form-data requests] The name of the form field containing the binary payload. "file" by default. (Since Appium 1.18.0) formFields (dict): [multipart/form-data requests] Additional form fields mapping. If any entry has @@ -126,7 +121,7 @@ def start_recording_screen(self: T, **options: Any) -> Union[bytes, str]: 'mjpeg' by default. (Since Appium 1.10.0) videoFps (int): [iOS] The Frames Per Second rate of the recorded video. Change this value if the resulting video is too slow or too fast. Defaults to 10. This can decrease the resulting file size. - videoFilters (str): [iOS, macOS] The FFMPEG video filters to apply. These filters allow to scale, + videoFilters (str): [iOS, Win, macOS] The FFMPEG video filters to apply. These filters allow to scale, flip, rotate and do many other useful transformations on the source video stream. The format of the property must comply with https://ffmpeg.org/ffmpeg-filters.html. (Since Appium 1.15) videoScale (str): [iOS] The scaling value to apply. Read https://trac.ffmpeg.org/wiki/Scaling for @@ -134,26 +129,29 @@ def start_recording_screen(self: T, **options: Any) -> Union[bytes, str]: effectively ignored. (Since Appium 1.10.0) pixelFormat (str): [iOS] Output pixel format. Run `ffmpeg -pix_fmts` to list possible values. For Quicktime compatibility, set to "yuv420p" along with videoType: "libx264". (Since Appium 1.12.0) + videoSize (str): [Android] The video size of the generated media file. The format is WIDTHxHEIGHT. The default value is the device's native display resolution (if supported), 1280x720 if not. For best results, use a size supported by your device's Advanced Video Coding (AVC) encoder. - bitRate (int): [Android] The video bit rate for the video, in megabits per second. The default value is 4. You can increase the bit rate to improve video quality, but doing so results in larger movie files. + bugReport (str): [Android] Makes the recorder to display an additional information on the video overlay, + such as a timestamp, that is helpful in videos captured to illustrate bugs. + This option is only supported since API level 27 (Android P). - fps (int): [macOS] The count of frames per second in the resulting video. + fps (int): [Win, macOS] The count of frames per second in the resulting video. Increasing fps value also increases the size of the resulting video file and the CPU usage. - captureCursor (bool): [macOS] Whether to capture the mouse cursor while recording the screen. + captureCursor (bool): [Win, macOS] Whether to capture the mouse cursor while recording the screen. Disabled by default. - captureClick (bool): [macOS] Whether to capture the click gestures while recording the screen. + captureClick (bool): [Win, macOS] Whether to capture the click gestures while recording the screen. Disabled by default. deviceId (int): [macOS] Screen device index to use for the recording. The list of available devices could be retrieved using `ffmpeg -f avfoundation -list_devices true -i` command. This option is mandatory and must be always provided. - preset (str): [macOS] A preset is a collection of options that will provide a certain encoding + preset (str): [Win, macOS] A preset is a collection of options that will provide a certain encoding speed to compression ratio. A slower preset will provide better compression (compression is quality per filesize). This means that, for example, if you target a certain file size or constant bit rate, you will achieve better quality with a slower preset. From 9948d6e3a833f78b07ecfabf072e6701cdb84c02 Mon Sep 17 00:00:00 2001 From: Atsushi Mori Date: Wed, 10 Feb 2021 19:01:47 +0900 Subject: [PATCH 3/5] Add missing doc to stop_recording --- appium/webdriver/extensions/screen_record.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/appium/webdriver/extensions/screen_record.py b/appium/webdriver/extensions/screen_record.py index 98e7a804a..2520ffc16 100644 --- a/appium/webdriver/extensions/screen_record.py +++ b/appium/webdriver/extensions/screen_record.py @@ -186,6 +186,11 @@ def stop_recording_screen(self: T, **options: Any) -> bytes: Only has an effect if both `remotePath` and `user` are set. method (str): The HTTP method name ('PUT'/'POST'). PUT method is used by default. Only has an effect if `remotePath` is set. + fileFieldName (str): [multipart/form-data requests] The name of the form field + containing the binary payload. "file" by default. (Since Appium 1.18.0) + formFields (dict): [multipart/form-data requests] Additional form fields mapping. If any entry has + the same key as `fileFieldName` then it is going to be ignored. (Since Appium 1.18.0) + headers (dict): [multipart/form-data requests] Headers mapping (Since Appium 1.18.0) Returns: bytes: Base-64 encoded content of the recorded media file or an empty string From 9f3f81099af195fa7ee549cdeb218977c26c5545 Mon Sep 17 00:00:00 2001 From: Atsushi Mori Date: Wed, 10 Feb 2021 19:37:50 +0900 Subject: [PATCH 4/5] Push auto-generated changes by sphinx --- docs/index.rst | 2 +- docs/webdriver.common.rst | 1 - docs/webdriver.extensions.android.rst | 1 - docs/webdriver.extensions.rst | 1 - docs/webdriver.extensions.search_context.rst | 1 - docs/webdriver.rst | 1 - 6 files changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 40c4de966..9f0bdbea5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,5 +1,5 @@ .. Appium python client documentation master file, created by - sphinx-quickstart on Sun May 10 14:33:16 2020. + sphinx-quickstart on Wed Feb 10 19:35:06 2021. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. diff --git a/docs/webdriver.common.rst b/docs/webdriver.common.rst index 1da461fbb..2814929da 100644 --- a/docs/webdriver.common.rst +++ b/docs/webdriver.common.rst @@ -28,7 +28,6 @@ webdriver.common.touch\_action module :undoc-members: :show-inheritance: - Module contents --------------- diff --git a/docs/webdriver.extensions.android.rst b/docs/webdriver.extensions.android.rst index 55a32a1f4..31924c890 100644 --- a/docs/webdriver.extensions.android.rst +++ b/docs/webdriver.extensions.android.rst @@ -84,7 +84,6 @@ webdriver.extensions.android.system\_bars module :undoc-members: :show-inheritance: - Module contents --------------- diff --git a/docs/webdriver.extensions.rst b/docs/webdriver.extensions.rst index 048cb4933..23bacd0d8 100644 --- a/docs/webdriver.extensions.rst +++ b/docs/webdriver.extensions.rst @@ -149,7 +149,6 @@ webdriver.extensions.settings module :undoc-members: :show-inheritance: - Module contents --------------- diff --git a/docs/webdriver.extensions.search_context.rst b/docs/webdriver.extensions.search_context.rst index cff8b87eb..575d41bac 100644 --- a/docs/webdriver.extensions.search_context.rst +++ b/docs/webdriver.extensions.search_context.rst @@ -52,7 +52,6 @@ webdriver.extensions.search\_context.windows module :undoc-members: :show-inheritance: - Module contents --------------- diff --git a/docs/webdriver.rst b/docs/webdriver.rst index 2f1bbff6a..18de03b0c 100644 --- a/docs/webdriver.rst +++ b/docs/webdriver.rst @@ -93,7 +93,6 @@ webdriver.webelement module :undoc-members: :show-inheritance: - Module contents --------------- From 6bad1714b2ac24c42cfc49ba8d4a089a78c8cc11 Mon Sep 17 00:00:00 2001 From: Atsushi Mori Date: Wed, 10 Feb 2021 21:49:58 +0900 Subject: [PATCH 5/5] delete duplicated entry [skip ci] --- appium/webdriver/extensions/screen_record.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/appium/webdriver/extensions/screen_record.py b/appium/webdriver/extensions/screen_record.py index 2520ffc16..3ab5e4c39 100644 --- a/appium/webdriver/extensions/screen_record.py +++ b/appium/webdriver/extensions/screen_record.py @@ -42,8 +42,6 @@ def start_recording_screen(self: T, **options: Any) -> Union[bytes, str]: +--------------+-----+---------+-----+-------+ | timeLimit | O | O | O | O | +--------------+-----+---------+-----+-------+ - | user | O | O | O | O | - +--------------+-----+---------+-----+-------+ | forceRestart | O | O | O | O | +--------------+-----+---------+-----+-------+ | fileFieldName| O | O | O | O |