Skip to content

Commit

Permalink
add: docstring in api.py
Browse files Browse the repository at this point in the history
(cherry picked from commit 69fea3a)
  • Loading branch information
yimelia committed Jul 17, 2023
1 parent d86e596 commit d6c12ac
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions airtest/core/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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")
"""
Expand Down Expand Up @@ -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)

Expand All @@ -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)

Expand Down

0 comments on commit d6c12ac

Please sign in to comment.