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
3 changes: 3 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[settings]
multi_line_output = 3
known_third_party = dateutil,httpretty,pytest,selenium,setuptools,urllib3
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@
hooks:
- id: autopep8
args: ["--global-config", ".config-pep8", "-i"]
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.20
hooks:
- id: isort
args: ["-rc", "."]
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ download and unarchive the source tarball (Appium-Python-Client-X.X.tar.gz).
```
$ python -m autopep8 -r --global-config .config-pep8 -i .
```
- `isort` helps to order imports automatically
```
$ python -m isort -rc .
```
- You can customise `CHANGELOG.rst` with commit messages following [.gitchangelog.rc](.gitchangelog.rc)
- It generates readable changelog
- Setup
Expand Down
3 changes: 2 additions & 1 deletion appium/saucetestcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@

from __future__ import print_function

import unittest
import os
import sys
import unittest

from appium import webdriver
from sauceclient import SauceClient

Expand Down
1 change: 1 addition & 0 deletions appium/webdriver/appium_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import subprocess
import sys
import time

import urllib3

DEFAULT_HOST = '127.0.0.1'
Expand Down
2 changes: 1 addition & 1 deletion appium/webdriver/errorhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from selenium.webdriver.remote import errorhandler
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.remote import errorhandler

from appium.common.exceptions import NoSuchContextException

Expand Down
1 change: 1 addition & 0 deletions appium/webdriver/extensions/android/activities.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait

from appium.webdriver.mobilecommand import MobileCommand as Command


Expand Down
4 changes: 2 additions & 2 deletions appium/webdriver/extensions/android/gsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
# limitations under the License.

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

from appium.common.logger import logger
from appium.common.helper import extract_const_attributes
from appium.common.logger import logger
from appium.webdriver.mobilecommand import MobileCommand as Command


class GsmCallActions(object):
Expand Down
1 change: 1 addition & 0 deletions appium/webdriver/extensions/android/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

from selenium import webdriver

from appium.webdriver.mobilecommand import MobileCommand as Command


Expand Down
1 change: 1 addition & 0 deletions appium/webdriver/extensions/android/performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

from selenium import webdriver

from appium.webdriver.mobilecommand import MobileCommand as Command


Expand Down
1 change: 1 addition & 0 deletions appium/webdriver/extensions/android/power.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

from selenium import webdriver

from appium.webdriver.mobilecommand import MobileCommand as Command


Expand Down
1 change: 1 addition & 0 deletions appium/webdriver/extensions/android/sms.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

from selenium import webdriver

from appium.webdriver.mobilecommand import MobileCommand as Command


Expand Down
1 change: 1 addition & 0 deletions appium/webdriver/extensions/android/system_bars.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

from selenium import webdriver

from appium.webdriver.mobilecommand import MobileCommand as Command


Expand Down
1 change: 1 addition & 0 deletions appium/webdriver/extensions/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

from selenium import webdriver

from ..mobilecommand import MobileCommand as Command


Expand Down
3 changes: 2 additions & 1 deletion appium/webdriver/extensions/clipboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
import base64

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

from appium.common.helper import appium_bytes
from appium.webdriver.clipboard_content_type import ClipboardContentType

from ..mobilecommand import MobileCommand as Command


class Clipboard(webdriver.Remote):

Expand Down
1 change: 1 addition & 0 deletions appium/webdriver/extensions/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

from selenium import webdriver

from ..mobilecommand import MobileCommand as Command


Expand Down
1 change: 1 addition & 0 deletions appium/webdriver/extensions/device_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

from selenium import webdriver

from ..mobilecommand import MobileCommand as Command


Expand Down
1 change: 1 addition & 0 deletions appium/webdriver/extensions/hw_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

from selenium import webdriver

from ..mobilecommand import MobileCommand as Command


Expand Down
1 change: 1 addition & 0 deletions appium/webdriver/extensions/images_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

from selenium import webdriver

from ..mobilecommand import MobileCommand as Command


Expand Down
1 change: 1 addition & 0 deletions appium/webdriver/extensions/ime.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

from selenium import webdriver

from ..mobilecommand import MobileCommand as Command


Expand Down
1 change: 1 addition & 0 deletions appium/webdriver/extensions/keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

from selenium import webdriver

from ..mobilecommand import MobileCommand as Command


Expand Down
1 change: 1 addition & 0 deletions appium/webdriver/extensions/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

from selenium import webdriver

from ..mobilecommand import MobileCommand as Command


Expand Down
1 change: 1 addition & 0 deletions appium/webdriver/extensions/remote_fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

from selenium import webdriver
from selenium.common.exceptions import InvalidArgumentException

from ..mobilecommand import MobileCommand as Command


Expand Down
1 change: 1 addition & 0 deletions appium/webdriver/extensions/screen_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

from selenium import webdriver

from ..mobilecommand import MobileCommand as Command


Expand Down
3 changes: 2 additions & 1 deletion appium/webdriver/extensions/search_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
import json

from selenium import webdriver
from selenium.webdriver.remote.webelement import WebElement as SeleniumWebElement
from selenium.webdriver.remote.webelement import \
WebElement as SeleniumWebElement

from appium.webdriver.common.mobileby import MobileBy

Expand Down
1 change: 1 addition & 0 deletions appium/webdriver/extensions/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

from selenium import webdriver

from ..mobilecommand import MobileCommand as Command


Expand Down
7 changes: 3 additions & 4 deletions appium/webdriver/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
from selenium.webdriver.remote.command import Command as RemoteCommand
from selenium.webdriver.remote.remote_connection import RemoteConnection


from appium.common.logger import logger
from appium.webdriver.common.mobileby import MobileBy

from .appium_connection import AppiumConnection
from .errorhandler import MobileErrorHandler
from .extensions.action_helpers import ActionHelpers
Expand All @@ -38,10 +39,10 @@
from .extensions.clipboard import Clipboard
from .extensions.context import Context
from .extensions.device_time import DeviceTime
from .extensions.hw_actions import HardwareActions
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.remote_fs import RemoteFS
from .extensions.screen_record import ScreenRecord
Expand All @@ -51,8 +52,6 @@
from .switch_to import MobileSwitchTo
from .webelement import WebElement as MobileWebElement

from appium.common.logger import logger

# From remote/webdriver.py
_W3C_CAPABILITY_NAMES = frozenset([
'acceptInsecureCerts',
Expand Down
10 changes: 7 additions & 3 deletions ci.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#!/bin/bash

result=$(python -m autopep8 -r --global-config .config-pep8 -d .)
if [[ $result ]] ; then
echo $result

if ! python -m autopep8 -r --global-config .config-pep8 -i . ; then
echo "Please run command 'python -m autopep8 -r --global-config .config-pep8 -i .' on your local and commit the result"
exit 1
fi

if ! python -m isort --check-only -rc . ; then
echo "Please run command 'python -m isort -rc .' on your local and commit the result"
exit 1
fi

python -m pylint --rcfile .pylintrc appium test --errors-only
python -m pytest test/unit/
2 changes: 1 addition & 1 deletion script/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
# limitations under the License.
"""Release script to publish release module to pipy."""

import io
import os
import sys
import io

VERSION_FILE_PATH = os.path.join(os.path.dirname('__file__'), 'appium', 'version.py')
CHANGELOG_PATH = os.path.join(os.path.dirname('__file__'), 'CHANGELOG.rst')
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import os

from setuptools import find_packages, setup

from appium.common.helper import library_version

setup(
Expand Down
1 change: 0 additions & 1 deletion test/functional/android/activities_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import unittest

from appium import webdriver

from helper import desired_capabilities


Expand Down
1 change: 0 additions & 1 deletion test/functional/android/applications_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

from appium import webdriver
from appium.webdriver.applicationstate import ApplicationState

from helper import desired_capabilities


Expand Down
3 changes: 2 additions & 1 deletion test/functional/android/context_switching_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import pytest
import unittest

import pytest

from appium import webdriver
from appium.common.exceptions import NoSuchContextException
from helper import desired_capabilities
Expand Down
2 changes: 1 addition & 1 deletion test/functional/android/device_time_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
# limitations under the License.

import unittest

from dateutil.parser import parse

from appium import webdriver

from helper import desired_capabilities


Expand Down
10 changes: 5 additions & 5 deletions test/functional/android/find_by_image_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import pytest
import base64
import unittest

from appium import webdriver
import pytest
from selenium.common.exceptions import NoSuchElementException, TimeoutException
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from helper import desired_capabilities
from selenium.webdriver.support.ui import WebDriverWait

import base64
from appium import webdriver
from helper import desired_capabilities


@pytest.mark.skip(reason="Need to fix broken test")
Expand Down
1 change: 0 additions & 1 deletion test/functional/android/hw_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import unittest

from appium import webdriver

from helper import desired_capabilities


Expand Down
1 change: 0 additions & 1 deletion test/functional/android/ime_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from appium import webdriver
from helper import desired_capabilities


ANDROID_LATIN = 'com.android.inputmethod.latin/.LatinIME' # Android L/M/N
GOOGLE_LATIN = 'com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME' # Android O/P

Expand Down
1 change: 0 additions & 1 deletion test/functional/android/keyboard_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import unittest

from appium import webdriver

from helper import desired_capabilities


Expand Down
1 change: 0 additions & 1 deletion test/functional/android/location_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import unittest

from appium import webdriver

from helper import desired_capabilities


Expand Down
Loading