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

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait
from ..mobilecommand import MobileCommand as Command
from appium.webdriver.mobilecommand import MobileCommand as Command


class Activities(webdriver.Remote):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

from selenium import webdriver
from ..mobilecommand import MobileCommand as Command
from appium.webdriver.mobilecommand import MobileCommand as Command

from appium.common.logger import logger
from appium.common.helper import extract_const_attributes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

from selenium import webdriver
from ..mobilecommand import MobileCommand as Command
from appium.webdriver.mobilecommand import MobileCommand as Command


class Network(webdriver.Remote):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

from selenium import webdriver
from ..mobilecommand import MobileCommand as Command
from appium.webdriver.mobilecommand import MobileCommand as Command


class Performance(webdriver.Remote):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

from selenium import webdriver
from ..mobilecommand import MobileCommand as Command
from appium.webdriver.mobilecommand import MobileCommand as Command


class Power(webdriver.Remote):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

from selenium import webdriver
from ..mobilecommand import MobileCommand as Command
from appium.webdriver.mobilecommand import MobileCommand as Command


class Sms(webdriver.Remote):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

from selenium import webdriver
from ..mobilecommand import MobileCommand as Command
from appium.webdriver.mobilecommand import MobileCommand as Command


class SystemBars(webdriver.Remote):
Expand Down
2 changes: 1 addition & 1 deletion appium/webdriver/extensions/hw_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def toggle_touch_id_enrollment(self):

def finger_print(self, finger_id):
"""
Authenticate users by using their finger print scans on supported emulators.
Authenticate users by using their finger print scans on supported Android emulators.

:param finger_id: Finger prints stored in Android Keystore system (from 1 to 10)
"""
Expand Down
106 changes: 59 additions & 47 deletions appium/webdriver/mobilecommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,74 +14,86 @@


class MobileCommand(object):
CONTEXTS = 'getContexts',
GET_CURRENT_CONTEXT = 'getCurrentContext',
SWITCH_TO_CONTEXT = 'switchToContext'
TOUCH_ACTION = 'touchAction'
MULTI_ACTION = 'multiAction'
OPEN_NOTIFICATIONS = 'openNotifications'
GET_NETWORK_CONNECTION = 'getNetworkConnection'
SET_NETWORK_CONNECTION = 'setNetworkConnection'
# Common
GET_LOCATION = 'getLocation'
SET_LOCATION = 'setLocation'

GET_AVAILABLE_IME_ENGINES = 'getAvailableIMEEngines'
IS_IME_ACTIVE = 'isIMEActive'
ACTIVATE_IME_ENGINE = 'activateIMEEngine'
DEACTIVATE_IME_ENGINE = 'deactivateIMEEngine'
GET_ACTIVE_IME_ENGINE = 'getActiveEngine'
TOGGLE_LOCATION_SERVICES = 'toggleLocationServices'
TOGGLE_WIFI = 'toggleWiFi'

CLEAR = 'clear'
LOCATION_IN_VIEW = 'locationInView'

# Appium Commands
GET_APP_STRINGS = 'getAppStrings'
PRESS_KEYCODE = 'pressKeyCode'
KEY_EVENT = 'keyEvent' # Needed for Selendroid
LONG_PRESS_KEYCODE = 'longPressKeyCode'
GET_CURRENT_ACTIVITY = 'getCurrentActivity'
GET_CURRENT_PACKAGE = 'getCurrentPackage'
CONTEXTS = 'getContexts'
GET_CURRENT_CONTEXT = 'getCurrentContext'
SWITCH_TO_CONTEXT = 'switchToContext'

TOUCH_ACTION = 'touchAction'
MULTI_ACTION = 'multiAction'

SET_IMMEDIATE_VALUE = 'setImmediateValue'
PULL_FILE = 'pullFile'
PULL_FOLDER = 'pullFolder'
PUSH_FILE = 'pushFile'
REPLACE_KEYS = 'replaceKeys'

LAUNCH_APP = 'launchApp'
CLOSE_APP = 'closeApp'
RESET = 'reset'
BACKGROUND = 'background'
IS_APP_INSTALLED = 'isAppInstalled'
GET_APP_STRINGS = 'getAppStrings'

IS_LOCKED = 'isLocked'
LOCK = 'lock'
UNLOCK = 'unlock'
GET_DEVICE_TIME_GET = 'getDeviceTimeGet'
GET_DEVICE_TIME_POST = 'getDeviceTimePost'
INSTALL_APP = 'installApp'
REMOVE_APP = 'removeApp'
IS_APP_INSTALLED = 'isAppInstalled'
TERMINATE_APP = 'terminateApp'
ACTIVATE_APP = 'activateApp'
QUERY_APP_STATE = 'queryAppState'
LAUNCH_APP = 'launchApp'
CLOSE_APP = 'closeApp'
END_TEST_COVERAGE = 'endTestCoverage'
LOCK = 'lock'
UNLOCK = 'unlock'
IS_LOCKED = 'isLocked'
SHAKE = 'shake'
TOUCH_ID = 'touchId'
TOGGLE_TOUCH_ID_ENROLLMENT = 'toggleTouchIdEnrollment'
RESET = 'reset'
HIDE_KEYBOARD = 'hideKeyboard'
IS_KEYBOARD_SHOWN = 'isKeyboardShown'
REPLACE_KEYS = 'replaceKeys'
START_ACTIVITY = 'startActivity'
PRESS_KEYCODE = 'pressKeyCode'
LONG_PRESS_KEYCODE = 'longPressKeyCode'
KEY_EVENT = 'keyEvent' # Needed for Selendroid
PUSH_FILE = 'pushFile'
PULL_FILE = 'pullFile'
PULL_FOLDER = 'pullFolder'
GET_CLIPBOARD = 'getClipboard'
SET_CLIPBOARD = 'setClipboard'
FINGER_PRINT = 'fingerPrint'
GET_SETTINGS = 'getSettings'
UPDATE_SETTINGS = 'updateSettings'
SET_LOCATION = 'setLocation'
GET_LOCATION = 'getLocation'
GET_DEVICE_TIME_GET = 'getDeviceTimeGet'
GET_DEVICE_TIME_POST = 'getDeviceTimePost'
CLEAR = 'clear'
START_RECORDING_SCREEN = 'startRecordingScreen'
STOP_RECORDING_SCREEN = 'stopRecordingScreen'
SET_CLIPBOARD = 'setClipboard'
GET_CLIPBOARD = 'getClipboard'
COMPARE_IMAGES = 'compareImages'
FINGER_PRINT = 'fingerPrint'
IS_KEYBOARD_SHOWN = 'isKeyboardShown'

# Android
OPEN_NOTIFICATIONS = 'openNotifications'
START_ACTIVITY = 'startActivity'
GET_CURRENT_ACTIVITY = 'getCurrentActivity'
GET_CURRENT_PACKAGE = 'getCurrentPackage'
GET_SYSTEM_BARS = 'getSystemBars'
TOGGLE_WIFI = 'toggleWiFi'
TOGGLE_LOCATION_SERVICES = 'toggleLocationServices'
END_TEST_COVERAGE = 'endTestCoverage'
GET_PERFORMANCE_DATA_TYPES = 'getPerformanceDataTypes'
GET_PERFORMANCE_DATA = 'getPerformanceData'
GET_NETWORK_CONNECTION = 'getNetworkConnection'
SET_NETWORK_CONNECTION = 'setNetworkConnection'

# Android Emulator
SEND_SMS = 'sendSms'
SET_POWER_CAPACITY = 'setPowerCapacity'
SET_POWER_AC = 'setPowerAc'
SET_GSM_SIGNAL = 'setGsmSignal'
MAKE_GSM_CALL = 'makeGsmCall'
GET_SYSTEM_BARS = 'getSystemBars'
SET_GSM_SIGNAL = 'setGsmSignal'
SET_GSM_VOICE = 'setGsmVoice'
GET_PERFORMANCE_DATA = 'getPerformanceData'
GET_PERFORMANCE_DATA_TYPES = 'getPerformanceDataTypes'
SET_POWER_CAPACITY = 'setPowerCapacity'
SET_POWER_AC = 'setPowerAc'

# iOS
TOUCH_ID = 'touchId'
TOGGLE_TOUCH_ID_ENROLLMENT = 'toggleTouchIdEnrollment'
14 changes: 7 additions & 7 deletions appium/webdriver/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,26 @@
from .appium_connection import AppiumConnection
from .errorhandler import MobileErrorHandler
from .extensions.action_helpers import ActionHelpers
from .extensions.activities import Activities
from .extensions.android.activities import Activities
from .extensions.android.gsm import Gsm
from .extensions.android.network import Network
from .extensions.android.performance import Performance
from .extensions.android.power import Power
from .extensions.android.sms import Sms
from .extensions.android.system_bars import SystemBars
from .extensions.applications import Applications
from .extensions.clipboard import Clipboard
from .extensions.context import Context
from .extensions.device_time import DeviceTime
from .extensions.gsm import Gsm
from .extensions.images_comparison import ImagesComparison
from .extensions.ime import IME
from .extensions.keyboard import Keyboard
from .extensions.hw_actions import HardwareActions
from .extensions.location import Location
from .extensions.network import Network
from .extensions.performance import Performance
from .extensions.power import Power
from .extensions.remote_fs import RemoteFS
from .extensions.screen_record import ScreenRecord
from .extensions.search_context import AppiumSearchContext
from .extensions.settings import Settings
from .extensions.sms import Sms
from .extensions.system_bars import SystemBars
from .mobilecommand import MobileCommand as Command
from .switch_to import MobileSwitchTo
from .webelement import WebElement as MobileWebElement
Expand Down
11 changes: 2 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
import io
import os

from distutils.core import setup
from setuptools import setup
from setuptools import find_packages, setup
from appium.common.helper import library_version

setup(
Expand All @@ -34,13 +33,7 @@
author='Isaac Murchie',
author_email='isaac@saucelabs.com',
url='http://appium.io/',
packages=[
'appium',
'appium.common',
'appium.webdriver',
'appium.webdriver.common',
'appium.webdriver.extensions'
],
packages=find_packages(include=['appium*']),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

license='Apache 2.0',
classifiers=[
'Development Status :: 4 - Beta',
Expand Down
2 changes: 1 addition & 1 deletion test/unit/webdriver/device/gsm_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import httpretty

from appium.webdriver.webdriver import WebDriver
from appium.webdriver.extensions.gsm import (
from appium.webdriver.extensions.android.gsm import (
GsmCallActions,
GsmSignalStrength,
GsmVoiceState
Expand Down
2 changes: 1 addition & 1 deletion test/unit/webdriver/device/power_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import httpretty

from appium.webdriver.webdriver import WebDriver
from appium.webdriver.extensions.power import Power
from appium.webdriver.extensions.android.power import Power


class TestWebDriverPower(object):
Expand Down