Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[settings]
multi_line_output = 3
known_third_party = dateutil,httpretty,pytest,selenium,setuptools,urllib3
known_first_party = test
8 changes: 4 additions & 4 deletions appium/webdriver/common/touch_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def tap(self, element=None, x=None, y=None, count=1):
"""Perform a tap action on the element

Args:
element (`WebElement`): the element to tap
element (`appium.webdriver.webelement.WebElement`): the element to tap
x (:obj:`int`, optional): x coordinate to tap, relative to the top left corner of the element.
y (:obj:`int`, optional): y coordinate. If y is used, x must also be set, and vice versa

Expand All @@ -54,7 +54,7 @@ def press(self, el=None, x=None, y=None, pressure=None):
"""Begin a chain with a press down action at a particular element or point

Args:
el (:obj:`WebElement`, optional): the element to press
el (:obj:`appium.webdriver.webelement.WebElement`, optional): the element to press
x (:obj:`int`, optional): x coordiate to press. If y is used, x must also be set
y (:obj:`int`, optional): y coordiate to press. If x is used, y must also be set
pressure (:obj:`float`, optional): [iOS Only] press as force touch. Read the description of `force` property on Apple's UITouch class
Expand All @@ -71,7 +71,7 @@ def long_press(self, el=None, x=None, y=None, duration=1000):
"""Begin a chain with a press down that lasts `duration` milliseconds

Args:
el (:obj:`WebElement`, optional): the element to press
el (:obj:`appium.webdriver.webelement.WebElement`, optional): the element to press
x (:obj:`int`, optional): x coordiate to press. If y is used, x must also be set
y (:obj:`int`, optional): y coordiate to press. If x is used, y must also be set
duration (:obj:`int`, optional): Duration to press
Expand Down Expand Up @@ -105,7 +105,7 @@ def move_to(self, el=None, x=None, y=None):
"""Move the pointer from the previous point to the element or point specified

Args:
el (:obj:`WebElement`, optional): the element to be moved to
el (:obj:`appium.webdriver.webelement.WebElement`, optional): the element to be moved to
x (:obj:`int`, optional): x coordiate to be moved to. If y is used, x must also be set
y (:obj:`int`, optional): y coordiate to be moved to. If x is used, y must also be set

Expand Down
18 changes: 9 additions & 9 deletions appium/webdriver/extensions/action_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ def scroll(self, origin_el, destination_el, duration=None):
"""Scrolls from one element to another

Args:
originalEl (`WebElement`): the element from which to being scrolling
destinationEl (`WebElement`): the element to scroll to
originalEl (`appium.webdriver.webelement.WebElement`): the element from which to being scrolling
destinationEl (`appium.webdriver.webelement.WebElement`): the element to scroll to
duration (int): a duration after pressing originalEl and move the element to destinationEl.
Default is 600 ms for W3C spec. Zero for MJSONWP.

Usage:
driver.scroll(el1, el2)

Returns:
`WebElement`
`appium.webdriver.webelement.WebElement`
"""

# XCUITest x W3C spec has no duration by default in server side
Expand All @@ -51,11 +51,11 @@ def drag_and_drop(self, origin_el, destination_el):
"""Drag the origin element to the destination element

Args:
originEl (`WebElement`): the element to drag
destinationEl (`WebElement`): the element to drag to
originEl (`appium.webdriver.webelement.WebElement`): the element to drag
destinationEl (`appium.webdriver.webelement.WebElement`): the element to drag to

Returns:
`WebElement`
`appium.webdriver.webelement.WebElement`
"""
action = TouchAction(self)
action.long_press(origin_el).move_to(destination_el).release().perform()
Expand All @@ -74,7 +74,7 @@ def tap(self, positions, duration=None):
driver.tap([(100, 20), (100, 60), (100, 100)], 500)

Returns:
`WebElement`
`appium.webdriver.webelement.WebElement`
"""
if len(positions) == 1:
action = TouchAction(self)
Expand Down Expand Up @@ -114,7 +114,7 @@ def swipe(self, start_x, start_y, end_x, end_y, duration=None):
driver.swipe(100, 100, 100, 400)

Returns:
`WebElement`
`appium.webdriver.webelement.WebElement`
"""
# `swipe` is something like press-wait-move_to-release, which the server
# will translate into the correct action
Expand All @@ -140,7 +140,7 @@ def flick(self, start_x, start_y, end_x, end_y):
driver.flick(100, 100, 100, 400)

Returns:
`WebElement`
`appium.webdriver.webelement.WebElement`
"""
action = TouchAction(self)
action \
Expand Down
6 changes: 3 additions & 3 deletions appium/webdriver/extensions/android/gsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def make_gsm_call(self, phone_number, action):
Args:
phone_number (str): The phone number to call to.
action (str): The call action.
A member of the const appium.webdriver.extensions.android.gsm.GsmCallActions
A member of the const `appium.webdriver.extensions.android.gsm.GsmCallActions`

:Usage:
self.driver.make_gsm_call('5551234567', GsmCallActions.CALL)
Expand All @@ -73,7 +73,7 @@ def set_gsm_signal(self, strength):

Args:
strength (int): Signal strength.
A member of the enum appium.webdriver.extensions.android.gsm.GsmSignalStrength
A member of the enum `appium.webdriver.extensions.android.gsm.GsmSignalStrength`

Usage:
self.driver.set_gsm_signal(GsmSignalStrength.GOOD)
Expand All @@ -92,7 +92,7 @@ def set_gsm_voice(self, state):

Args:
state (str): State of GSM voice.
A member of the const appium.webdriver.extensions.android.gsm.GsmVoiceState
A member of the const `appium.webdriver.extensions.android.gsm.GsmVoiceState`

Usage:
self.driver.set_gsm_voice(GsmVoiceState.HOME)
Expand Down
6 changes: 3 additions & 3 deletions appium/webdriver/extensions/android/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def set_network_connection(self, connection_type):
connection_type (int): a member of the enum appium.webdriver.ConnectionType

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
data = {
'parameters': {
Expand All @@ -72,7 +72,7 @@ def toggle_wifi(self):
"""Toggle the wifi on the device, Android only.

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
self.execute(Command.TOGGLE_WIFI, {})
return self
Expand All @@ -90,7 +90,7 @@ def set_network_speed(self, speed_type):
self.driver.set_network_speed(NetSpeed.LTE)

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
constants = extract_const_attributes(NetSpeed)
if speed_type not in constants.values():
Expand Down
4 changes: 2 additions & 2 deletions appium/webdriver/extensions/android/power.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def set_power_capacity(self, percent):
self.driver.set_power_capacity(50)

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
self.execute(Command.SET_POWER_CAPACITY, {'percent': percent})
return self
Expand All @@ -51,7 +51,7 @@ def set_power_ac(self, ac_state):
self.driver.set_power_ac(Power.AC_ON)

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
self.execute(Command.SET_POWER_AC, {'state': ac_state})
return self
Expand Down
2 changes: 1 addition & 1 deletion appium/webdriver/extensions/android/sms.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def send_sms(self, phone_number, message):
self.driver.send_sms('555-123-4567', 'Hey lol')

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
self.execute(Command.SEND_SMS, {'phoneNumber': phone_number, 'message': message})
return self
Expand Down
14 changes: 7 additions & 7 deletions appium/webdriver/extensions/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def background_app(self, seconds):
seconds (int): the duration for the application to remain in the background

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
data = {
'seconds': seconds,
Expand All @@ -37,7 +37,7 @@ def is_app_installed(self, bundle_id):
"""Checks whether the application specified by `bundle_id` is installed on the device.

Args:
bundle_id (int): the id of the application to query
bundle_id (str): the id of the application to query

Returns:
bool: `True` if app is installed
Expand Down Expand Up @@ -65,7 +65,7 @@ def install_app(self, app_path, **options):
on Android 6+ after the installation completes. False by default

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
data = {
'appPath': app_path,
Expand All @@ -88,7 +88,7 @@ def remove_app(self, app_id, **options):
20000ms by default.

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
data = {
'appId': app_id,
Expand All @@ -102,7 +102,7 @@ def launch_app(self):
"""Start on the device the application specified in the desired capabilities.

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
self.execute(Command.LAUNCH_APP)
return self
Expand All @@ -112,7 +112,7 @@ def close_app(self):
the device.

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
self.execute(Command.CLOSE_APP)
return self
Expand Down Expand Up @@ -145,7 +145,7 @@ def activate_app(self, app_id):
app_id (str): the application id to be activated

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
data = {
'appId': app_id,
Expand Down
10 changes: 5 additions & 5 deletions appium/webdriver/extensions/hw_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def lock(self, seconds=None):
the timeout expires and unlocks the screen automatically.

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
if seconds is None:
self.execute(Command.LOCK)
Expand All @@ -42,7 +42,7 @@ def unlock(self):
"""Unlock the device. No changes are made if the device is already locked.

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
self.execute(Command.UNLOCK)
return self
Expand All @@ -59,7 +59,7 @@ def shake(self):
"""Shake the device.

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
self.execute(Command.SHAKE)
return self
Expand All @@ -71,7 +71,7 @@ def touch_id(self, match):
match (bool): Simulates a successful touch (`True`) or a failed touch (`False`)

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
data = {
'match': match
Expand All @@ -83,7 +83,7 @@ def toggle_touch_id_enrollment(self):
"""Toggle enroll touchId on iOS Simulator

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
self.execute(Command.TOGGLE_TOUCH_ID_ENROLLMENT)
return self
Expand Down
4 changes: 2 additions & 2 deletions appium/webdriver/extensions/ime.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def activate_ime_engine(self, engine):
(e.g., 'com.android.inputmethod.latin/.LatinIME')

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
data = {
'engine': engine
Expand All @@ -64,7 +64,7 @@ def deactivate_ime_engine(self):
Android only.

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
self.execute(Command.DEACTIVATE_IME_ENGINE, {})
return self
Expand Down
6 changes: 3 additions & 3 deletions appium/webdriver/extensions/keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def keyevent(self, keycode, metastate=None):
metastate (:obj:`int`, optional): meta information about the keycode being sent

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
data = {
'keycode': keycode,
Expand All @@ -81,7 +81,7 @@ def press_keycode(self, keycode, metastate=None, flags=None):
flags (:obj:`int`, optional): the set of key event flags

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
data = {
'keycode': keycode,
Expand All @@ -104,7 +104,7 @@ def long_press_keycode(self, keycode, metastate=None, flags=None):
flags (:obj:`int`, optional): the set of key event flags

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
data = {
'keycode': keycode
Expand Down
4 changes: 2 additions & 2 deletions appium/webdriver/extensions/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def toggle_location_services(self):
Android only.

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
self.execute(Command.TOGGLE_LOCATION_SERVICES, {})
return self
Expand All @@ -38,7 +38,7 @@ def set_location(self, latitude, longitude, altitude):
altitude (float): String or numeric value

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
data = {
"location": {
Expand Down
2 changes: 1 addition & 1 deletion appium/webdriver/extensions/remote_fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def push_file(self, destination_path, base64data=None, source_path=None):
source_path (:obj:`str`, optional): local file path for the file to be loaded on device

Returns:
`WebDriver`
`appium.webdriver.webdriver.WebDriver`
"""
if source_path is None and base64data is None:
raise InvalidArgumentException('Must either pass base64 data or a local file path')
Expand Down
4 changes: 2 additions & 2 deletions appium/webdriver/extensions/search_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def find_element_by_android_data_matcher(self, name=None, args=None, className=N
(e.g.: `class=CursorMatchers` fully qualified is `class=androidx.test.espresso.matcher.CursorMatchers`

Returns:
`WebElement`: The found element
`appium.webdriver.webelement.WebElement`: The found element

Raises:
TypeError - Raises a TypeError if the arguments are not validated for JSON format
Expand Down Expand Up @@ -79,7 +79,7 @@ def find_elements_by_android_data_matcher(self, name=None, args=None, className=
(e.g.: `class=CursorMatchers` fully qualified is `class=androidx.test.espresso.matcher.CursorMatchers`

Returns:
`WebElement`: The found elements
`appium.webdriver.webelement.WebElement`: The found elements

Usage:
driver.find_elements_by_android_data_matcher(name='hasEntry', args=['title', 'Animation'])
Expand Down
Loading