Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
fc6bb5b
bump selenium
KazuCocoa Dec 14, 2020
3d91f06
Fix lint, CI and tests
KazuCocoa Dec 15, 2020
3f956f4
Merge branch 'master' into selenium-4
KazuCocoa Dec 19, 2020
b7fe6dc
Update changelog for v2.0.0.a0
KazuCocoa Dec 19, 2020
5a8a7df
Bump v2.0.0.a0
KazuCocoa Dec 19, 2020
34dd19b
Merge branch 'master' into selenium-4
KazuCocoa Mar 21, 2021
246d349
fix format with black
KazuCocoa Mar 22, 2021
b35577e
bump base selenium version to 4.0.0.b2
KazuCocoa Mar 22, 2021
4b74be2
fix: remove w3c argument in MobileWebElement (#598)
KazuCocoa Apr 2, 2021
69c4561
Bump 2.0.0.b2
KazuCocoa Apr 2, 2021
c444d57
Update changelog for 2.0.0.b2
KazuCocoa Apr 2, 2021
f8cf51f
update pipfile
KazuCocoa Apr 5, 2021
1c8ecf1
bump selenium 4.0.0.b3
KazuCocoa Apr 18, 2021
232cda1
Merge branch 'master' into selenium-4
KazuCocoa Apr 24, 2021
799e155
update selenium in pipfile
KazuCocoa Apr 24, 2021
9d5d4c3
tweak some lines
KazuCocoa Apr 24, 2021
1e470db
Bump 2.0.0.b3
KazuCocoa May 5, 2021
8b4c65c
Update changelog for 2.0.0.b3
KazuCocoa May 5, 2021
0f1ca6a
Merge branch 'master' into selenium-4
KazuCocoa Jun 6, 2021
f2844d7
use python selenium client v4.0.0.b4
KazuCocoa Jun 14, 2021
30f0d9e
Bump 2.0.0.b4
KazuCocoa Jun 14, 2021
147a0d8
Update changelog for 2.0.0.b4
KazuCocoa Jun 14, 2021
9e6091b
add test to check log path
KazuCocoa Aug 29, 2021
b83b1d0
bump selenium version in tox
KazuCocoa Aug 29, 2021
53e8622
override log
KazuCocoa Aug 29, 2021
bc48a13
add types-python-dateutil in 4 branch
KazuCocoa Aug 29, 2021
d3055ec
feat: Add command with `setattr` (#615)
KazuCocoa Jul 14, 2021
4652d86
feat: add satellites in set_location (#620)
KazuCocoa Jul 21, 2021
097f7a7
chore(deps): update tox requirement from ~=3.23 to ~=3.24 (#619)
dependabot[bot] Jul 15, 2021
b5871a9
chore(deps): update pylint requirement from ~=2.8 to ~=2.10 (#628)
dependabot[bot] Aug 29, 2021
611684d
Bump 2.0.0.b5
KazuCocoa Aug 29, 2021
b922edb
Update changelog for 2.0.0.b5
KazuCocoa Aug 29, 2021
21dd533
feat: do not raise an error in case method is already defined (#632)
KazuCocoa Aug 30, 2021
b174ce9
try rc1
KazuCocoa Sep 8, 2021
9235187
Merge branch 'master' into selenium-4
KazuCocoa Sep 8, 2021
bd13a43
Bump 2.0.0.rc1
KazuCocoa Sep 8, 2021
caf50bd
Update changelog for 2.0.0.rc1
KazuCocoa Sep 8, 2021
5d95625
try rc2
KazuCocoa Sep 30, 2021
80ed2eb
Bump 2.0.0.rc2
KazuCocoa Oct 1, 2021
3254b01
Update changelog for 2.0.0.rc2
KazuCocoa Oct 1, 2021
db32d1b
use 4.0.0.rc3
KazuCocoa Oct 10, 2021
145c9b7
Bump 2.0.0.rc3
KazuCocoa Oct 10, 2021
0dc09f3
Update changelog for 2.0.0.rc3
KazuCocoa Oct 10, 2021
a1e756e
bump selenium version
KazuCocoa Oct 13, 2021
033f839
remove w3c=True from MobileWebElement argument
KazuCocoa Oct 13, 2021
7fcf9b1
remove w3c flag
KazuCocoa Oct 13, 2021
ef328e8
fix tests
KazuCocoa Oct 13, 2021
5066423
tweak tests
KazuCocoa Oct 14, 2021
9c0f60b
Bump 2.0.0.rc4
KazuCocoa Oct 14, 2021
c7b48fb
Update changelog for 2.0.0.rc4
KazuCocoa Oct 14, 2021
400c7e1
Merge branch 'master' into selenium-4
KazuCocoa Oct 14, 2021
c359727
cleanup readme
KazuCocoa Oct 15, 2021
dbb9288
fix readme
KazuCocoa Oct 15, 2021
acbffa5
tweak indentations
KazuCocoa Oct 15, 2021
195c822
let me comment out trio once
KazuCocoa Oct 15, 2021
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
116 changes: 116 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,122 @@ Changelog
=========


(unreleased)
------------

New
~~~
- Feat: do not raise an error in case method is already defined (#632)
[Kazuaki Matsuo]
- Feat: add satellites in set_location (#620) [Kazuaki Matsuo]

* feat: add satellites in set_location

* fix review
- Feat: Add command with `setattr` (#615) [Kazuaki Matsuo]

* chore: add placeholder

* move to extention way

* revert pytest

* add todo

* call method_name instead of wrapper

* remove types

* rename a method

* add examples

* add types-python-dateutil as error message

* add example more

* tweak naming

* Explicit Dict
- Add types-python-dateutil in 4 branch. [Kazuaki Matsuo]
- Add test to check log path. [Kazuaki Matsuo]

Fix
~~~
- Fix tests. [Kazuaki Matsuo]
- Remove w3c argument in MobileWebElement (#598) [Kazuaki Matsuo]

* Bump 2.0.0.b1

* Update changelog for 2.0.0.b1

* remove w3c
- Fix format with black. [Kazuaki Matsuo]
- Fix lint, CI and tests. [Kazuaki Matsuo]

Other
~~~~~
- Bump 2.0.0.rc4. [Kazuaki Matsuo]
- Tweak tests. [Kazuaki Matsuo]
- Remove w3c flag. [Kazuaki Matsuo]
- Remove w3c=True from MobileWebElement argument. [Kazuaki Matsuo]
- Bump selenium version. [Kazuaki Matsuo]
- Update changelog for 2.0.0.rc3. [Kazuaki Matsuo]
- Bump 2.0.0.rc3. [Kazuaki Matsuo]
- Use 4.0.0.rc3. [Kazuaki Matsuo]
- Update changelog for 2.0.0.rc2. [Kazuaki Matsuo]
- Bump 2.0.0.rc2. [Kazuaki Matsuo]
- Try rc2. [Kazuaki Matsuo]
- Update changelog for 2.0.0.rc1. [Kazuaki Matsuo]
- Bump 2.0.0.rc1. [Kazuaki Matsuo]
- Try rc1. [Kazuaki Matsuo]
- Update changelog for 2.0.0.b5. [Kazuaki Matsuo]
- Bump 2.0.0.b5. [Kazuaki Matsuo]
- Chore(deps): update pylint requirement from ~=2.8 to ~=2.10 (#628)
[dependabot[bot]]

Updates the requirements on [pylint](https://github.com/PyCQA/pylint) to permit the latest version.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/main/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/pylint-2.8.0...v2.10.2)

---
updated-dependencies:
- dependency-name: pylint
dependency-type: direct:production
...
- Chore(deps): update tox requirement from ~=3.23 to ~=3.24 (#619)
[dependabot[bot]]

Updates the requirements on [tox](https://github.com/tox-dev/tox) to permit the latest version.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/master/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/3.23.0...3.24.0)

---
updated-dependencies:
- dependency-name: tox
dependency-type: direct:production
...
- Override log. [Kazuaki Matsuo]
- Bump selenium version in tox. [Kazuaki Matsuo]
- Update changelog for 2.0.0.b4. [Kazuaki Matsuo]
- Bump 2.0.0.b4. [Kazuaki Matsuo]
- Use python selenium client v4.0.0.b4. [Kazuaki Matsuo]
- Update changelog for 2.0.0.b3. [Kazuaki Matsuo]
- Bump 2.0.0.b3. [Kazuaki Matsuo]
- Tweak some lines. [Kazuaki Matsuo]
- Update selenium in pipfile. [Kazuaki Matsuo]
- Bump selenium 4.0.0.b3. [Kazuaki Matsuo]
- Update pipfile. [Kazuaki Matsuo]
- Update changelog for 2.0.0.b2. [Kazuaki Matsuo]
- Bump 2.0.0.b2. [Kazuaki Matsuo]
- Bump base selenium version to 4.0.0.b2. [Kazuaki Matsuo]
- Bump v2.0.0.a0. [Kazuaki Matsuo]
- Update changelog for v2.0.0.a0. [Kazuaki Matsuo]
- Bump selenium. [Kazuaki Matsuo]


v1.3.0 (2021-09-27)
-------------------

Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ verify_ssl = true
pre-commit = "~=2.15"

[packages]
selenium = "~=3.141"
selenium = "~=4.0.0"

black = "==20.8b1"

Expand Down
40 changes: 26 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

An extension library for adding [Selenium 3.0 draft](https://dvcs.w3.org/hg/webdriver/raw-file/tip/webdriver-spec.html) and [Mobile JSON Wire Protocol Specification draft](https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md)
functionality to the Python language bindings, for use with the mobile testing
framework [Appium](https://appium.io).
An extension library for adding [WebDriver Protocol](https://www.w3.org/TR/webdriver/) and Appium commands to the Selenium Python language binding for use with the mobile testing framework [Appium](https://appium.io).

## Notice

Since **v1.0.0**, only Python 3 is supported
Since **v1.0.0**, only Python 3.7+ is supported.

### developing version
[selenium-4](https://github.com/appium/python-client/tree/selenium-4) branch is a developing branch to switch base selenium client version from v3 to v4. The branch is available as pre-release versioning like `2.0.0.a0` via pypi.

Main differences since current v1 is the v2 can connect to invalid SSL environment like self-certificated server. Please take a look at the branch's README for more details.
Since **v2.0.0**, the base selenium client version is v4.
The version only works in W3C WebDriver protocol format.
If you would like to use the old protocol (MJSONWP), please use v1 Appium Python client.

## Getting the Appium Python client

Expand Down Expand Up @@ -52,12 +49,8 @@ download and unarchive the source tarball (Appium-Python-Client-X.X.tar.gz).

## Usage

The Appium Python Client is fully compliant with the Selenium 3.0 specification
draft, with some helpers to make mobile testing in Python easier. The majority of
the usage remains as it has been for Selenium 2 (WebDriver), and as the [official
Selenium Python bindings](https://pypi.org/project/selenium/) begins to
implement the new specification that implementation will be used underneath, so
test code can be written that is utilizable with both bindings.
The Appium Python Client is fully compliant with the WebDriver Protocol
including several helpers to make mobile testing in Python easier.

To use the new functionality now, and to use the superset of functions, instead of
including the Selenium `webdriver` module in your test code, use that from
Expand Down Expand Up @@ -133,6 +126,25 @@ desired_caps = dict(
self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps, direct_connection=True)
```

## Relax SSL validation

`strict_ssl` option allows you to send commands to an invalid certificate host like a self-signed one.

```python
import unittest
from appium import webdriver

desired_caps = dict(
platformName='iOS',
platformVersion='13.4',
automationName='xcuitest',
deviceName='iPhone Simulator',
app=PATH('../../apps/UICatalog.app.zip')
)

self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps, strict_ssl=False)
```

## Documentation

- https://appium.github.io/python-client-sphinx/ is detailed documentation
Expand Down
2 changes: 1 addition & 1 deletion appium/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = '1.3.0'
version = '2.0.0.rc4'
20 changes: 19 additions & 1 deletion appium/webdriver/appium_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
# limitations under the License.

import uuid
from typing import TYPE_CHECKING, Any, Dict
from typing import TYPE_CHECKING, Any, Dict, Union

import urllib3
from selenium.webdriver.remote.remote_connection import RemoteConnection

from appium.common.helper import library_version
Expand All @@ -24,6 +25,23 @@


class AppiumConnection(RemoteConnection):
def _get_connection_manager(self) -> Union[urllib3.PoolManager, urllib3.ProxyManager]:
# https://github.com/SeleniumHQ/selenium/blob/0e0194b0e52a34e7df4b841f1ed74506beea5c3e/py/selenium/webdriver/remote/remote_connection.py#L134
pool_manager_init_args = {'timeout': self._timeout}
# pylint: disable=E1101
if self._ca_certs:
pool_manager_init_args['cert_reqs'] = 'CERT_REQUIRED'
pool_manager_init_args['ca_certs'] = self._ca_certs
else:
# This line is necessary to disable certificate verification
pool_manager_init_args['cert_reqs'] = 'CERT_NONE'

return (
urllib3.PoolManager(**pool_manager_init_args)
if self._proxy_url is None
else urllib3.ProxyManager(self._proxy_url, **pool_manager_init_args)
)

@classmethod
def get_remote_connection_headers(cls, parsed_url: 'ParseResult', keep_alive: bool = True) -> Dict[str, Any]:
"""Override get_remote_connection_headers in RemoteConnection"""
Expand Down
2 changes: 1 addition & 1 deletion appium/webdriver/extensions/action_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def scroll(self: T, origin_el: WebElement, destination_el: WebElement, duration:
"""

# XCUITest x W3C spec has no duration by default in server side
if self.w3c and duration is None:
if duration is None:
duration = 600

action = TouchAction(self)
Expand Down
4 changes: 4 additions & 0 deletions appium/webdriver/mobilecommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,7 @@ class MobileCommand:
# iOS
TOUCH_ID = 'touchId'
TOGGLE_TOUCH_ID_ENROLLMENT = 'toggleTouchIdEnrollment'

# To override selenium commands
GET_LOG = 'getLog'
GET_AVAILABLE_LOG_TYPES = 'getAvailableLogTypes'
Loading