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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ Installation is a simple by the helps of `pip`, Py-TestUI can be installed using
this `pip` command.

```bash
pip3 install python-testui==1.2.4
pip3 install python-testui==1.2.5
```

Or if you prefer `requirements.txt`, you can add the following dependency to
the file.

```txt
python-testui==1.2.4
python-testui==1.2.5
```

# Appium driver
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name="python-testui",
version="1.2.4",
version="1.2.5",
description="Browser and Mobile automation framework",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
20 changes: 8 additions & 12 deletions testui/support/appium_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def __init__(self):
self.process = None
self.file_name = None
self.__appium_log_file = "appium-stdout.log"
self.__chromedriverArgs = ["relaxed security"]
self.__desired_capabilities = {}
# TODO: Investigate if should be used in functionality or should be
# removed.
Expand Down Expand Up @@ -304,13 +303,6 @@ def __set_android_caps(self):
"""Set Android capabilities"""
if self.__automation_name is None:
self.__automation_name = "UiAutomator2"
self.__desired_capabilities["appium:chromeOptions"] = {"w3c": False}
# TODO: It is not being passed to executable. Tried this
# https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md
self.__desired_capabilities[
"chromedriverArgs"
] = self.__chromedriverArgs

self.__desired_capabilities["appium:chromeDriverPort"] = (
self.appium_port - 4723 + 8100
)
Expand Down Expand Up @@ -419,7 +411,6 @@ def start_driver(desired_caps, url, debug, port, udid, log_file):
logger.log("starting appium driver...")

process = None
options = None
if "android" in desired_caps["platformName"].lower():
url, desired_caps, process, file = __local_run(
url, desired_caps, port, udid, log_file
Expand Down Expand Up @@ -589,9 +580,14 @@ def __local_run(url, desired_caps, use_port, udid, log_file):
# Check Appium Version
result = subprocess.run(["appium", "-v"], stdout=subprocess.PIPE).stdout
url = f"http://localhost:{str(port)}/wd/hub"
if result.decode('utf-8').startswith("2."):
# for Appium version > 2.0.0
url = f"http://localhost:{str(port)}"
result_text = result.decode('utf-8').strip()
try:
major = int(result_text.split('.')[0])
except (ValueError, IndexError):
major = 0
if major >= 2:
# for Appium version >= 2.0.0
url = f"http://localhost:{port}"
return url, desired_caps, process, file_path

return url, desired_caps, None, None
Expand Down