Skip to content

Commit bc7eb91

Browse files
authored
Move android commands to android package (appium#371)
* Reorder mobilecommands * Move android commands to android package * Update setup.py to include added packages * Changed find_packages to whitelist style
1 parent 2620e6f commit bc7eb91

File tree

14 files changed

+78
-73
lines changed

14 files changed

+78
-73
lines changed

appium/webdriver/extensions/android/__init__.py

Whitespace-only changes.

appium/webdriver/extensions/activities.py renamed to appium/webdriver/extensions/android/activities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from selenium import webdriver
1616
from selenium.common.exceptions import TimeoutException
1717
from selenium.webdriver.support.ui import WebDriverWait
18-
from ..mobilecommand import MobileCommand as Command
18+
from appium.webdriver.mobilecommand import MobileCommand as Command
1919

2020

2121
class Activities(webdriver.Remote):

appium/webdriver/extensions/gsm.py renamed to appium/webdriver/extensions/android/gsm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
from selenium import webdriver
16-
from ..mobilecommand import MobileCommand as Command
16+
from appium.webdriver.mobilecommand import MobileCommand as Command
1717

1818
from appium.common.logger import logger
1919
from appium.common.helper import extract_const_attributes

appium/webdriver/extensions/network.py renamed to appium/webdriver/extensions/android/network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
from selenium import webdriver
16-
from ..mobilecommand import MobileCommand as Command
16+
from appium.webdriver.mobilecommand import MobileCommand as Command
1717

1818

1919
class Network(webdriver.Remote):

appium/webdriver/extensions/performance.py renamed to appium/webdriver/extensions/android/performance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
from selenium import webdriver
16-
from ..mobilecommand import MobileCommand as Command
16+
from appium.webdriver.mobilecommand import MobileCommand as Command
1717

1818

1919
class Performance(webdriver.Remote):

appium/webdriver/extensions/power.py renamed to appium/webdriver/extensions/android/power.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
from selenium import webdriver
16-
from ..mobilecommand import MobileCommand as Command
16+
from appium.webdriver.mobilecommand import MobileCommand as Command
1717

1818

1919
class Power(webdriver.Remote):

appium/webdriver/extensions/sms.py renamed to appium/webdriver/extensions/android/sms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
from selenium import webdriver
16-
from ..mobilecommand import MobileCommand as Command
16+
from appium.webdriver.mobilecommand import MobileCommand as Command
1717

1818

1919
class Sms(webdriver.Remote):

appium/webdriver/extensions/system_bars.py renamed to appium/webdriver/extensions/android/system_bars.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
from selenium import webdriver
16-
from ..mobilecommand import MobileCommand as Command
16+
from appium.webdriver.mobilecommand import MobileCommand as Command
1717

1818

1919
class SystemBars(webdriver.Remote):

appium/webdriver/extensions/hw_actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def toggle_touch_id_enrollment(self):
7272

7373
def finger_print(self, finger_id):
7474
"""
75-
Authenticate users by using their finger print scans on supported emulators.
75+
Authenticate users by using their finger print scans on supported Android emulators.
7676
7777
:param finger_id: Finger prints stored in Android Keystore system (from 1 to 10)
7878
"""

appium/webdriver/mobilecommand.py

Lines changed: 59 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -14,74 +14,86 @@
1414

1515

1616
class MobileCommand(object):
17-
CONTEXTS = 'getContexts',
18-
GET_CURRENT_CONTEXT = 'getCurrentContext',
19-
SWITCH_TO_CONTEXT = 'switchToContext'
20-
TOUCH_ACTION = 'touchAction'
21-
MULTI_ACTION = 'multiAction'
22-
OPEN_NOTIFICATIONS = 'openNotifications'
23-
GET_NETWORK_CONNECTION = 'getNetworkConnection'
24-
SET_NETWORK_CONNECTION = 'setNetworkConnection'
17+
# Common
18+
GET_LOCATION = 'getLocation'
19+
SET_LOCATION = 'setLocation'
20+
2521
GET_AVAILABLE_IME_ENGINES = 'getAvailableIMEEngines'
2622
IS_IME_ACTIVE = 'isIMEActive'
2723
ACTIVATE_IME_ENGINE = 'activateIMEEngine'
2824
DEACTIVATE_IME_ENGINE = 'deactivateIMEEngine'
2925
GET_ACTIVE_IME_ENGINE = 'getActiveEngine'
30-
TOGGLE_LOCATION_SERVICES = 'toggleLocationServices'
31-
TOGGLE_WIFI = 'toggleWiFi'
26+
27+
CLEAR = 'clear'
3228
LOCATION_IN_VIEW = 'locationInView'
3329

34-
# Appium Commands
35-
GET_APP_STRINGS = 'getAppStrings'
36-
PRESS_KEYCODE = 'pressKeyCode'
37-
KEY_EVENT = 'keyEvent' # Needed for Selendroid
38-
LONG_PRESS_KEYCODE = 'longPressKeyCode'
39-
GET_CURRENT_ACTIVITY = 'getCurrentActivity'
40-
GET_CURRENT_PACKAGE = 'getCurrentPackage'
30+
CONTEXTS = 'getContexts'
31+
GET_CURRENT_CONTEXT = 'getCurrentContext'
32+
SWITCH_TO_CONTEXT = 'switchToContext'
33+
34+
TOUCH_ACTION = 'touchAction'
35+
MULTI_ACTION = 'multiAction'
36+
4137
SET_IMMEDIATE_VALUE = 'setImmediateValue'
42-
PULL_FILE = 'pullFile'
43-
PULL_FOLDER = 'pullFolder'
44-
PUSH_FILE = 'pushFile'
38+
REPLACE_KEYS = 'replaceKeys'
39+
40+
LAUNCH_APP = 'launchApp'
41+
CLOSE_APP = 'closeApp'
42+
RESET = 'reset'
4543
BACKGROUND = 'background'
46-
IS_APP_INSTALLED = 'isAppInstalled'
44+
GET_APP_STRINGS = 'getAppStrings'
45+
46+
IS_LOCKED = 'isLocked'
47+
LOCK = 'lock'
48+
UNLOCK = 'unlock'
49+
GET_DEVICE_TIME_GET = 'getDeviceTimeGet'
50+
GET_DEVICE_TIME_POST = 'getDeviceTimePost'
4751
INSTALL_APP = 'installApp'
4852
REMOVE_APP = 'removeApp'
53+
IS_APP_INSTALLED = 'isAppInstalled'
4954
TERMINATE_APP = 'terminateApp'
5055
ACTIVATE_APP = 'activateApp'
5156
QUERY_APP_STATE = 'queryAppState'
52-
LAUNCH_APP = 'launchApp'
53-
CLOSE_APP = 'closeApp'
54-
END_TEST_COVERAGE = 'endTestCoverage'
55-
LOCK = 'lock'
56-
UNLOCK = 'unlock'
57-
IS_LOCKED = 'isLocked'
5857
SHAKE = 'shake'
59-
TOUCH_ID = 'touchId'
60-
TOGGLE_TOUCH_ID_ENROLLMENT = 'toggleTouchIdEnrollment'
61-
RESET = 'reset'
6258
HIDE_KEYBOARD = 'hideKeyboard'
63-
IS_KEYBOARD_SHOWN = 'isKeyboardShown'
64-
REPLACE_KEYS = 'replaceKeys'
65-
START_ACTIVITY = 'startActivity'
59+
PRESS_KEYCODE = 'pressKeyCode'
60+
LONG_PRESS_KEYCODE = 'longPressKeyCode'
61+
KEY_EVENT = 'keyEvent' # Needed for Selendroid
62+
PUSH_FILE = 'pushFile'
63+
PULL_FILE = 'pullFile'
64+
PULL_FOLDER = 'pullFolder'
65+
GET_CLIPBOARD = 'getClipboard'
66+
SET_CLIPBOARD = 'setClipboard'
67+
FINGER_PRINT = 'fingerPrint'
6668
GET_SETTINGS = 'getSettings'
6769
UPDATE_SETTINGS = 'updateSettings'
68-
SET_LOCATION = 'setLocation'
69-
GET_LOCATION = 'getLocation'
70-
GET_DEVICE_TIME_GET = 'getDeviceTimeGet'
71-
GET_DEVICE_TIME_POST = 'getDeviceTimePost'
72-
CLEAR = 'clear'
7370
START_RECORDING_SCREEN = 'startRecordingScreen'
7471
STOP_RECORDING_SCREEN = 'stopRecordingScreen'
75-
SET_CLIPBOARD = 'setClipboard'
76-
GET_CLIPBOARD = 'getClipboard'
7772
COMPARE_IMAGES = 'compareImages'
78-
FINGER_PRINT = 'fingerPrint'
73+
IS_KEYBOARD_SHOWN = 'isKeyboardShown'
74+
75+
# Android
76+
OPEN_NOTIFICATIONS = 'openNotifications'
77+
START_ACTIVITY = 'startActivity'
78+
GET_CURRENT_ACTIVITY = 'getCurrentActivity'
79+
GET_CURRENT_PACKAGE = 'getCurrentPackage'
80+
GET_SYSTEM_BARS = 'getSystemBars'
81+
TOGGLE_WIFI = 'toggleWiFi'
82+
TOGGLE_LOCATION_SERVICES = 'toggleLocationServices'
83+
END_TEST_COVERAGE = 'endTestCoverage'
84+
GET_PERFORMANCE_DATA_TYPES = 'getPerformanceDataTypes'
85+
GET_PERFORMANCE_DATA = 'getPerformanceData'
86+
GET_NETWORK_CONNECTION = 'getNetworkConnection'
87+
SET_NETWORK_CONNECTION = 'setNetworkConnection'
88+
89+
# Android Emulator
7990
SEND_SMS = 'sendSms'
80-
SET_POWER_CAPACITY = 'setPowerCapacity'
81-
SET_POWER_AC = 'setPowerAc'
82-
SET_GSM_SIGNAL = 'setGsmSignal'
8391
MAKE_GSM_CALL = 'makeGsmCall'
84-
GET_SYSTEM_BARS = 'getSystemBars'
92+
SET_GSM_SIGNAL = 'setGsmSignal'
8593
SET_GSM_VOICE = 'setGsmVoice'
86-
GET_PERFORMANCE_DATA = 'getPerformanceData'
87-
GET_PERFORMANCE_DATA_TYPES = 'getPerformanceDataTypes'
94+
SET_POWER_CAPACITY = 'setPowerCapacity'
95+
SET_POWER_AC = 'setPowerAc'
96+
97+
# iOS
98+
TOUCH_ID = 'touchId'
99+
TOGGLE_TOUCH_ID_ENROLLMENT = 'toggleTouchIdEnrollment'

0 commit comments

Comments
 (0)