Skip to content

Commit 2cfcf09

Browse files
authored
Update docstring (#407)
* Remove import error on pycharm And update docstring * Update docstring * Update docstring * Fix import error * fix * fix import order * tweak
1 parent 1dbaa1c commit 2cfcf09

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+241
-208
lines changed

.isort.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[settings]
22
multi_line_output = 3
33
known_third_party = dateutil,httpretty,pytest,selenium,setuptools,urllib3
4+
known_first_party = test

appium/webdriver/common/touch_action.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def tap(self, element=None, x=None, y=None, count=1):
3737
"""Perform a tap action on the element
3838
3939
Args:
40-
element (`WebElement`): the element to tap
40+
element (`appium.webdriver.webelement.WebElement`): the element to tap
4141
x (:obj:`int`, optional): x coordinate to tap, relative to the top left corner of the element.
4242
y (:obj:`int`, optional): y coordinate. If y is used, x must also be set, and vice versa
4343
@@ -54,7 +54,7 @@ def press(self, el=None, x=None, y=None, pressure=None):
5454
"""Begin a chain with a press down action at a particular element or point
5555
5656
Args:
57-
el (:obj:`WebElement`, optional): the element to press
57+
el (:obj:`appium.webdriver.webelement.WebElement`, optional): the element to press
5858
x (:obj:`int`, optional): x coordiate to press. If y is used, x must also be set
5959
y (:obj:`int`, optional): y coordiate to press. If x is used, y must also be set
6060
pressure (:obj:`float`, optional): [iOS Only] press as force touch. Read the description of `force` property on Apple's UITouch class
@@ -71,7 +71,7 @@ def long_press(self, el=None, x=None, y=None, duration=1000):
7171
"""Begin a chain with a press down that lasts `duration` milliseconds
7272
7373
Args:
74-
el (:obj:`WebElement`, optional): the element to press
74+
el (:obj:`appium.webdriver.webelement.WebElement`, optional): the element to press
7575
x (:obj:`int`, optional): x coordiate to press. If y is used, x must also be set
7676
y (:obj:`int`, optional): y coordiate to press. If x is used, y must also be set
7777
duration (:obj:`int`, optional): Duration to press
@@ -105,7 +105,7 @@ def move_to(self, el=None, x=None, y=None):
105105
"""Move the pointer from the previous point to the element or point specified
106106
107107
Args:
108-
el (:obj:`WebElement`, optional): the element to be moved to
108+
el (:obj:`appium.webdriver.webelement.WebElement`, optional): the element to be moved to
109109
x (:obj:`int`, optional): x coordiate to be moved to. If y is used, x must also be set
110110
y (:obj:`int`, optional): y coordiate to be moved to. If x is used, y must also be set
111111

appium/webdriver/extensions/action_helpers.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ def scroll(self, origin_el, destination_el, duration=None):
2424
"""Scrolls from one element to another
2525
2626
Args:
27-
originalEl (`WebElement`): the element from which to being scrolling
28-
destinationEl (`WebElement`): the element to scroll to
27+
originalEl (`appium.webdriver.webelement.WebElement`): the element from which to being scrolling
28+
destinationEl (`appium.webdriver.webelement.WebElement`): the element to scroll to
2929
duration (int): a duration after pressing originalEl and move the element to destinationEl.
3030
Default is 600 ms for W3C spec. Zero for MJSONWP.
3131
3232
Usage:
3333
driver.scroll(el1, el2)
3434
3535
Returns:
36-
`WebElement`
36+
`appium.webdriver.webelement.WebElement`
3737
"""
3838

3939
# XCUITest x W3C spec has no duration by default in server side
@@ -51,11 +51,11 @@ def drag_and_drop(self, origin_el, destination_el):
5151
"""Drag the origin element to the destination element
5252
5353
Args:
54-
originEl (`WebElement`): the element to drag
55-
destinationEl (`WebElement`): the element to drag to
54+
originEl (`appium.webdriver.webelement.WebElement`): the element to drag
55+
destinationEl (`appium.webdriver.webelement.WebElement`): the element to drag to
5656
5757
Returns:
58-
`WebElement`
58+
`appium.webdriver.webelement.WebElement`
5959
"""
6060
action = TouchAction(self)
6161
action.long_press(origin_el).move_to(destination_el).release().perform()
@@ -74,7 +74,7 @@ def tap(self, positions, duration=None):
7474
driver.tap([(100, 20), (100, 60), (100, 100)], 500)
7575
7676
Returns:
77-
`WebElement`
77+
`appium.webdriver.webelement.WebElement`
7878
"""
7979
if len(positions) == 1:
8080
action = TouchAction(self)
@@ -114,7 +114,7 @@ def swipe(self, start_x, start_y, end_x, end_y, duration=None):
114114
driver.swipe(100, 100, 100, 400)
115115
116116
Returns:
117-
`WebElement`
117+
`appium.webdriver.webelement.WebElement`
118118
"""
119119
# `swipe` is something like press-wait-move_to-release, which the server
120120
# will translate into the correct action
@@ -140,7 +140,7 @@ def flick(self, start_x, start_y, end_x, end_y):
140140
driver.flick(100, 100, 100, 400)
141141
142142
Returns:
143-
`WebElement`
143+
`appium.webdriver.webelement.WebElement`
144144
"""
145145
action = TouchAction(self)
146146
action \

appium/webdriver/extensions/android/gsm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def make_gsm_call(self, phone_number, action):
5454
Args:
5555
phone_number (str): The phone number to call to.
5656
action (str): The call action.
57-
A member of the const appium.webdriver.extensions.android.gsm.GsmCallActions
57+
A member of the const `appium.webdriver.extensions.android.gsm.GsmCallActions`
5858
5959
:Usage:
6060
self.driver.make_gsm_call('5551234567', GsmCallActions.CALL)
@@ -73,7 +73,7 @@ def set_gsm_signal(self, strength):
7373
7474
Args:
7575
strength (int): Signal strength.
76-
A member of the enum appium.webdriver.extensions.android.gsm.GsmSignalStrength
76+
A member of the enum `appium.webdriver.extensions.android.gsm.GsmSignalStrength`
7777
7878
Usage:
7979
self.driver.set_gsm_signal(GsmSignalStrength.GOOD)
@@ -92,7 +92,7 @@ def set_gsm_voice(self, state):
9292
9393
Args:
9494
state (str): State of GSM voice.
95-
A member of the const appium.webdriver.extensions.android.gsm.GsmVoiceState
95+
A member of the const `appium.webdriver.extensions.android.gsm.GsmVoiceState`
9696
9797
Usage:
9898
self.driver.set_gsm_voice(GsmVoiceState.HOME)

appium/webdriver/extensions/android/network.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def set_network_connection(self, connection_type):
5959
connection_type (int): a member of the enum appium.webdriver.ConnectionType
6060
6161
Returns:
62-
`WebDriver`
62+
`appium.webdriver.webdriver.WebDriver`
6363
"""
6464
data = {
6565
'parameters': {
@@ -72,7 +72,7 @@ def toggle_wifi(self):
7272
"""Toggle the wifi on the device, Android only.
7373
7474
Returns:
75-
`WebDriver`
75+
`appium.webdriver.webdriver.WebDriver`
7676
"""
7777
self.execute(Command.TOGGLE_WIFI, {})
7878
return self
@@ -90,7 +90,7 @@ def set_network_speed(self, speed_type):
9090
self.driver.set_network_speed(NetSpeed.LTE)
9191
9292
Returns:
93-
`WebDriver`
93+
`appium.webdriver.webdriver.WebDriver`
9494
"""
9595
constants = extract_const_attributes(NetSpeed)
9696
if speed_type not in constants.values():

appium/webdriver/extensions/android/power.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def set_power_capacity(self, percent):
3333
self.driver.set_power_capacity(50)
3434
3535
Returns:
36-
`WebDriver`
36+
`appium.webdriver.webdriver.WebDriver`
3737
"""
3838
self.execute(Command.SET_POWER_CAPACITY, {'percent': percent})
3939
return self
@@ -51,7 +51,7 @@ def set_power_ac(self, ac_state):
5151
self.driver.set_power_ac(Power.AC_ON)
5252
5353
Returns:
54-
`WebDriver`
54+
`appium.webdriver.webdriver.WebDriver`
5555
"""
5656
self.execute(Command.SET_POWER_AC, {'state': ac_state})
5757
return self

appium/webdriver/extensions/android/sms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def send_sms(self, phone_number, message):
3232
self.driver.send_sms('555-123-4567', 'Hey lol')
3333
3434
Returns:
35-
`WebDriver`
35+
`appium.webdriver.webdriver.WebDriver`
3636
"""
3737
self.execute(Command.SEND_SMS, {'phoneNumber': phone_number, 'message': message})
3838
return self

appium/webdriver/extensions/applications.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def background_app(self, seconds):
2525
seconds (int): the duration for the application to remain in the background
2626
2727
Returns:
28-
`WebDriver`
28+
`appium.webdriver.webdriver.WebDriver`
2929
"""
3030
data = {
3131
'seconds': seconds,
@@ -37,7 +37,7 @@ def is_app_installed(self, bundle_id):
3737
"""Checks whether the application specified by `bundle_id` is installed on the device.
3838
3939
Args:
40-
bundle_id (int): the id of the application to query
40+
bundle_id (str): the id of the application to query
4141
4242
Returns:
4343
bool: `True` if app is installed
@@ -65,7 +65,7 @@ def install_app(self, app_path, **options):
6565
on Android 6+ after the installation completes. False by default
6666
6767
Returns:
68-
`WebDriver`
68+
`appium.webdriver.webdriver.WebDriver`
6969
"""
7070
data = {
7171
'appPath': app_path,
@@ -88,7 +88,7 @@ def remove_app(self, app_id, **options):
8888
20000ms by default.
8989
9090
Returns:
91-
`WebDriver`
91+
`appium.webdriver.webdriver.WebDriver`
9292
"""
9393
data = {
9494
'appId': app_id,
@@ -102,7 +102,7 @@ def launch_app(self):
102102
"""Start on the device the application specified in the desired capabilities.
103103
104104
Returns:
105-
`WebDriver`
105+
`appium.webdriver.webdriver.WebDriver`
106106
"""
107107
self.execute(Command.LAUNCH_APP)
108108
return self
@@ -112,7 +112,7 @@ def close_app(self):
112112
the device.
113113
114114
Returns:
115-
`WebDriver`
115+
`appium.webdriver.webdriver.WebDriver`
116116
"""
117117
self.execute(Command.CLOSE_APP)
118118
return self
@@ -145,7 +145,7 @@ def activate_app(self, app_id):
145145
app_id (str): the application id to be activated
146146
147147
Returns:
148-
`WebDriver`
148+
`appium.webdriver.webdriver.WebDriver`
149149
"""
150150
data = {
151151
'appId': app_id,

appium/webdriver/extensions/hw_actions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def lock(self, seconds=None):
2929
the timeout expires and unlocks the screen automatically.
3030
3131
Returns:
32-
`WebDriver`
32+
`appium.webdriver.webdriver.WebDriver`
3333
"""
3434
if seconds is None:
3535
self.execute(Command.LOCK)
@@ -42,7 +42,7 @@ def unlock(self):
4242
"""Unlock the device. No changes are made if the device is already locked.
4343
4444
Returns:
45-
`WebDriver`
45+
`appium.webdriver.webdriver.WebDriver`
4646
"""
4747
self.execute(Command.UNLOCK)
4848
return self
@@ -59,7 +59,7 @@ def shake(self):
5959
"""Shake the device.
6060
6161
Returns:
62-
`WebDriver`
62+
`appium.webdriver.webdriver.WebDriver`
6363
"""
6464
self.execute(Command.SHAKE)
6565
return self
@@ -71,7 +71,7 @@ def touch_id(self, match):
7171
match (bool): Simulates a successful touch (`True`) or a failed touch (`False`)
7272
7373
Returns:
74-
`WebDriver`
74+
`appium.webdriver.webdriver.WebDriver`
7575
"""
7676
data = {
7777
'match': match
@@ -83,7 +83,7 @@ def toggle_touch_id_enrollment(self):
8383
"""Toggle enroll touchId on iOS Simulator
8484
8585
Returns:
86-
`WebDriver`
86+
`appium.webdriver.webdriver.WebDriver`
8787
"""
8888
self.execute(Command.TOGGLE_TOUCH_ID_ENROLLMENT)
8989
return self

appium/webdriver/extensions/ime.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def activate_ime_engine(self, engine):
5050
(e.g., 'com.android.inputmethod.latin/.LatinIME')
5151
5252
Returns:
53-
`WebDriver`
53+
`appium.webdriver.webdriver.WebDriver`
5454
"""
5555
data = {
5656
'engine': engine
@@ -64,7 +64,7 @@ def deactivate_ime_engine(self):
6464
Android only.
6565
6666
Returns:
67-
`WebDriver`
67+
`appium.webdriver.webdriver.WebDriver`
6868
"""
6969
self.execute(Command.DEACTIVATE_IME_ENGINE, {})
7070
return self

0 commit comments

Comments
 (0)