diff --git a/.github/workflows/functional-test.yml b/.github/workflows/functional-test.yml index fecd4b1b1..c4d81cd1c 100644 --- a/.github/workflows/functional-test.yml +++ b/.github/workflows/functional-test.yml @@ -245,8 +245,8 @@ jobs: XCODE_VERSION: 16.4 IOS_VERSION: 18.5 IPHONE_MODEL: iPhone 16 - FLUTTER_ANDROID_APP: "https://github.com/AppiumTestDistribution/appium-flutter-server/releases/latest/download/app-debug.apk" - FLUTTER_IOS_APP: "https://github.com/AppiumTestDistribution/appium-flutter-server/releases/latest/download/ios.zip" + FLUTTER_ANDROID_APP: "https://github.com/AppiumTestDistribution/appium-flutter-server/releases/download/0.0.33/app-debug.apk" + FLUTTER_IOS_APP: "https://github.com/AppiumTestDistribution/appium-flutter-server/releases/download/0.0.33/ios.zip" PREBUILT_WDA_PATH: ${{ github.workspace }}/wda/WebDriverAgentRunner-Runner.app steps: diff --git a/appium/webdriver/extensions/device_time.py b/appium/webdriver/extensions/device_time.py index 22ac3c25a..28cbce005 100644 --- a/appium/webdriver/extensions/device_time.py +++ b/appium/webdriver/extensions/device_time.py @@ -14,16 +14,11 @@ from typing import Optional -from selenium.common.exceptions import UnknownMethodException - from appium.protocols.webdriver.can_execute_commands import CanExecuteCommands from appium.protocols.webdriver.can_execute_scripts import CanExecuteScripts -from appium.protocols.webdriver.can_remember_extension_presence import CanRememberExtensionPresence - -from ..mobilecommand import MobileCommand as Command -class DeviceTime(CanExecuteCommands, CanExecuteScripts, CanRememberExtensionPresence): +class DeviceTime(CanExecuteCommands, CanExecuteScripts): @property def device_time(self) -> str: """Returns the date and time from the device. @@ -31,12 +26,7 @@ def device_time(self) -> str: Return: str: The date and time """ - ext_name = 'mobile: getDeviceTime' - try: - return self.assert_extension_exists(ext_name).execute_script(ext_name) - except UnknownMethodException: - # TODO: Remove the fallback - return self.mark_extension_absence(ext_name).execute(Command.GET_DEVICE_TIME_GET, {})['value'] + return self.execute_script('mobile: getDeviceTime') def get_device_time(self, format: Optional[str] = None) -> str: """Returns the date and time from the device. @@ -54,22 +44,9 @@ def get_device_time(self, format: Optional[str] = None) -> str: Return: str: The date and time """ - ext_name = 'mobile: getDeviceTime' if format is None: return self.device_time - try: - return self.assert_extension_exists(ext_name).execute_script(ext_name, {'format': format}) - except UnknownMethodException: - return self.mark_extension_absence(ext_name).execute(Command.GET_DEVICE_TIME_POST, {'format': format})['value'] + return self.execute_script('mobile: getDeviceTime', {'format': format}) def _add_commands(self) -> None: - self.command_executor.add_command( - Command.GET_DEVICE_TIME_GET, - 'GET', - '/session/$sessionId/appium/device/system_time', - ) - self.command_executor.add_command( - Command.GET_DEVICE_TIME_POST, - 'POST', - '/session/$sessionId/appium/device/system_time', - ) + pass diff --git a/appium/webdriver/mobilecommand.py b/appium/webdriver/mobilecommand.py index ed8dc6f80..ad65603dc 100644 --- a/appium/webdriver/mobilecommand.py +++ b/appium/webdriver/mobilecommand.py @@ -35,8 +35,6 @@ class MobileCommand: 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' diff --git a/test/functional/flutter_integration/helper/options.py b/test/functional/flutter_integration/helper/options.py index 0a44f372b..c0d86ac5d 100644 --- a/test/functional/flutter_integration/helper/options.py +++ b/test/functional/flutter_integration/helper/options.py @@ -50,6 +50,7 @@ def make_options() -> FlutterOptions: 'newCommandTimeout': 120, 'uiautomator2ServerInstallTimeout': 120000, 'adbExecTimeout': 120000, + 'androidInstallTimeout': 240000, 'app': os.environ['FLUTTER_ANDROID_APP'], 'autoGrantPermissions': True, } diff --git a/test/unit/webdriver/device/device_time_test.py b/test/unit/webdriver/device/device_time_test.py index 4d7e72110..979700949 100644 --- a/test/unit/webdriver/device/device_time_test.py +++ b/test/unit/webdriver/device/device_time_test.py @@ -21,11 +21,6 @@ class TestWebDriverDeviceTime: @httpretty.activate def test_device_time(self): driver = android_w3c_driver() - httpretty.register_uri( - httpretty.GET, - appium_command('/session/1234567890/appium/device/system_time'), - body='{"value": "2019-01-05T14:46:44+09:00"}', - ) httpretty.register_uri( httpretty.POST, appium_command('/session/1234567890/execute/sync'), @@ -36,11 +31,6 @@ def test_device_time(self): @httpretty.activate def test_get_device_time(self): driver = android_w3c_driver() - httpretty.register_uri( - httpretty.GET, - appium_command('/session/1234567890/appium/device/system_time'), - body='{"value": "2019-01-05T14:46:44+09:00"}', - ) httpretty.register_uri( httpretty.POST, appium_command('/session/1234567890/execute/sync'), @@ -51,11 +41,6 @@ def test_get_device_time(self): @httpretty.activate def test_get_formatted_device_time(self): driver = android_w3c_driver() - httpretty.register_uri( - httpretty.POST, - appium_command('/session/1234567890/appium/device/system_time'), - body='{"value": "2019-01-08"}', - ) httpretty.register_uri( httpretty.POST, appium_command('/session/1234567890/execute/sync'),