From b92cb7c39367a9be4a859ad4bd639e0927317e65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alain=20Miranda=20L=C3=B3pez?= Date: Thu, 29 Feb 2024 13:35:54 +0100 Subject: [PATCH] updated swipe duration from none to int (#381) * updated swipe duration from none to int * updated none on tests swipe android * changelog & removed int cast --- CHANGELOG.rst | 1 + toolium/test/utils/test_driver_utils.py | 8 ++++---- toolium/utils/driver_utils.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 42178c42..0ed8dd2d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -7,6 +7,7 @@ v3.1.4 *Release date: In development* - Add `ignore_empty` optional parameter to POEditor configuration to ignore empty translations +- Fix on swipe method. Duration from None to 0. v3.1.3 ------ diff --git a/toolium/test/utils/test_driver_utils.py b/toolium/test/utils/test_driver_utils.py index dc46010e..9c89feb9 100644 --- a/toolium/test/utils/test_driver_utils.py +++ b/toolium/test/utils/test_driver_utils.py @@ -488,7 +488,7 @@ def test_swipe_android_native(driver_wrapper, utils): element = get_mock_element(x=250, y=40, height=40, width=300) utils.swipe(element, 50, 100) - driver_wrapper.driver.swipe.assert_called_once_with(400, 60, 450, 160, None) + driver_wrapper.driver.swipe.assert_called_once_with(400, 60, 450, 160, 0) def test_swipe_android_web(driver_wrapper, utils): @@ -505,7 +505,7 @@ def test_swipe_android_web(driver_wrapper, utils): element = get_mock_element(x=250, y=40, height=40, width=300) utils.swipe(element, 50, 100) - driver_wrapper.driver.swipe.assert_called_once_with(200, 30, 250, 130, None) + driver_wrapper.driver.swipe.assert_called_once_with(200, 30, 250, 130, 0) def test_swipe_android_hybrid(driver_wrapper, utils): @@ -522,7 +522,7 @@ def test_swipe_android_hybrid(driver_wrapper, utils): element = get_mock_element(x=250, y=40, height=40, width=300) utils.swipe(element, 50, 100) - driver_wrapper.driver.swipe.assert_called_once_with(200, 30, 250, 130, None) + driver_wrapper.driver.swipe.assert_called_once_with(200, 30, 250, 130, 0) def test_swipe_ios_web(driver_wrapper, utils): @@ -538,7 +538,7 @@ def test_swipe_ios_web(driver_wrapper, utils): element = get_mock_element(x=250, y=40, height=40, width=300) utils.swipe(element, 50, 100) - driver_wrapper.driver.swipe.assert_called_once_with(200, 94, 50, 100, None) + driver_wrapper.driver.swipe.assert_called_once_with(200, 94, 50, 100, 0) def test_swipe_web(driver_wrapper, utils): diff --git a/toolium/utils/driver_utils.py b/toolium/utils/driver_utils.py index 524679ea..9e76a77a 100644 --- a/toolium/utils/driver_utils.py +++ b/toolium/utils/driver_utils.py @@ -324,7 +324,7 @@ def get_native_coords(self, coords): self.logger.debug('Converted web coords %s into native coords %s', coords, native_coords) return native_coords - def swipe(self, element, x, y, duration=None): + def swipe(self, element, x, y, duration=0): """Swipe over an element :param element: either a WebElement, PageElement or element locator as a tuple (locator_type, locator_value)