Skip to content

Commit

Permalink
updated swipe duration from none to int (#381)
Browse files Browse the repository at this point in the history
* updated swipe duration from none to int

* updated none on tests swipe android

* changelog & removed int cast
  • Loading branch information
AlainMiranda authored Feb 29, 2024
1 parent 5720890 commit b92cb7c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
------
Expand Down
8 changes: 4 additions & 4 deletions toolium/test/utils/test_driver_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand All @@ -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):
Expand All @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion toolium/utils/driver_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b92cb7c

Please sign in to comment.