From 42cfb6504b5d4f7e83daddfbf23bea73c9156ce0 Mon Sep 17 00:00:00 2001 From: Alvaro Laserna Date: Fri, 21 Mar 2025 16:02:30 +0200 Subject: [PATCH] fix capabilities to use w3c standard --- README.md | 4 ++-- setup.py | 2 +- testui/support/appium_driver.py | 34 ++++++++++++++++----------------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 18c4b2a..d007804 100644 --- a/README.md +++ b/README.md @@ -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.3 +pip3 install python-testui==1.2.4 ``` Or if you prefer `requirements.txt`, you can add the following dependency to the file. ```txt -python-testui==1.2.3 +python-testui==1.2.4 ``` # Appium driver diff --git a/setup.py b/setup.py index 23a12be..96b9079 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( name="python-testui", - version="1.2.3", + version="1.2.4", description="Browser and Mobile automation framework", long_description=long_description, long_description_content_type="text/markdown", diff --git a/testui/support/appium_driver.py b/testui/support/appium_driver.py index 42461f6..28cf70d 100644 --- a/testui/support/appium_driver.py +++ b/testui/support/appium_driver.py @@ -287,45 +287,45 @@ def set_platform(self, platform): def __set_common_caps(self): """Set common capabilities""" - self.__desired_capabilities["adbExecTimeout"] = 30000 + self.__desired_capabilities["appium:adbExecTimeout"] = 30000 self.__desired_capabilities["platformName"] = self.__platform_name - self.__desired_capabilities["automationName"] = self.__automation_name - self.__desired_capabilities["deviceName"] = self.device_name + self.__desired_capabilities["appium:automationName"] = self.__automation_name + self.__desired_capabilities["appium:deviceName"] = self.device_name if self.__full_reset: - self.__desired_capabilities["enforceAppInstall"] = True + self.__desired_capabilities["appium:enforceAppInstall"] = True else: - self.__desired_capabilities["noReset"] = True + self.__desired_capabilities["appium:noReset"] = True if self.__version is not None: - self.__desired_capabilities["platformVersion"] = self.__version + self.__desired_capabilities["appium:platformVersion"] = self.__version if self.udid is not None: - self.__desired_capabilities["udid"] = self.udid + self.__desired_capabilities["appium:udid"] = self.udid def __set_android_caps(self): """Set Android capabilities""" if self.__automation_name is None: self.__automation_name = "UiAutomator2" - self.__desired_capabilities["chromeOptions"] = {"w3c": False} + 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["chromeDriverPort"] = ( + self.__desired_capabilities["appium:chromeDriverPort"] = ( self.appium_port - 4723 + 8100 ) - self.__desired_capabilities["systemPort"] = ( + self.__desired_capabilities["appium:systemPort"] = ( self.appium_port - 4723 + 8200 ) if self.__app_path is None and self.__app_package is None: self.__desired_capabilities["browserName"] = "chrome" self.browser = True if self.__app_package is not None: - self.__desired_capabilities["appPackage"] = self.__app_package - self.__desired_capabilities["appActivity"] = self.__app_activity + self.__desired_capabilities["appium:appPackage"] = self.__app_package + self.__desired_capabilities["appium:appActivity"] = self.__app_activity if self.__app_path is not None: - self.__desired_capabilities["app"] = self.__app_path - self.__desired_capabilities["androidInstallPath"] = self.__app_path + self.__desired_capabilities["appium:app"] = self.__app_path + self.__desired_capabilities["appium:androidInstallPath"] = self.__app_path def __set_ios_caps(self): """Sets the iOS capabilities""" @@ -339,11 +339,11 @@ def __set_ios_caps(self): self.__desired_capabilities["browserName"] = "safari" self.browser = True if self.__app_path is not None: - self.__desired_capabilities["app"] = self.__app_path + self.__desired_capabilities["appium:app"] = self.__app_path if self.__bundle_id is not None: - self.__desired_capabilities["bundleId"] = self.__bundle_id + self.__desired_capabilities["appium:bundleId"] = self.__bundle_id if self.__version is None: - self.__desired_capabilities["platformVersion"] = "15.5" + self.__desired_capabilities["appium:platformVersion"] = "15.5" def __set_selenium_caps(self): """Sets the selenium capabilities"""