From d6c12acfa12e68ef40c9c94bbd7e654ed6fe08ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=90=A6?= Date: Fri, 14 Jul 2023 18:18:57 +0800 Subject: [PATCH] add: docstring in api.py (cherry picked from commit 69fea3a2213014a33419b3951bfeec19ceba4ce9) --- airtest/core/api.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/airtest/core/api.py b/airtest/core/api.py index f8e91220..98bcd304 100644 --- a/airtest/core/api.py +++ b/airtest/core/api.py @@ -230,11 +230,15 @@ def install(filepath, **kwargs): :param filepath: the path to file to be installed on target device :param kwargs: platform specific `kwargs`, please refer to corresponding docs :return: None - :platforms: Android + :platforms: Android, iOS :Example: - >>> install(r"D:\\demo\\test.apk") + >>> install(r"D:\\demo\\test.apk") # install Android apk >>> # adb install -r -t D:\\demo\\test.apk >>> install(r"D:\\demo\\test.apk", install_options=["-r", "-t"]) + + >>> install(r"D:\\demo\\test.ipa") # install iOS ipa + >>> install("http://www.example.com/test.ipa") # install iOS ipa from url + """ return G.DEVICE.install_app(filepath, **kwargs) @@ -246,7 +250,7 @@ def uninstall(package): :param package: name of the package, see also `start_app` :return: None - :platforms: Android + :platforms: Android, iOS :Example: >>> uninstall("com.netease.cloudmusic") """ @@ -665,6 +669,12 @@ def get_clipboard(*args, **kwargs): Get the content from the clipboard. :return: str + :platforms: iOS + :Example: + + >>> text = get_clipboard(wda_bundle_id="com.WebDriverAgentRunner.xctrunner") # iOS + >>> print(text) + """ return G.DEVICE.get_clipboard(*args, **kwargs) @@ -673,6 +683,14 @@ def get_clipboard(*args, **kwargs): def set_clipboard(content, *args, **kwargs): """ Set the content from the clipboard. + + :param content: str + :return: None + :platforms: iOS + :Example: + + >>> set_clipboard("content", wda_bundle_id="com.WebDriverAgentRunner.xctrunner") # iOS + """ G.DEVICE.set_clipboard(content, *args, **kwargs)