Skip to content

Commit 857e70e

Browse files
committed
Remove int() conversions
1 parent 0e67ed3 commit 857e70e

File tree

4 files changed

+2
-9
lines changed

4 files changed

+2
-9
lines changed

src/SeleniumLibrary/keywords/element.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ def page_should_contain_element(
175175
return self.assert_page_contains(
176176
locator, message=message, loglevel=loglevel
177177
)
178-
limit = int(limit)
179178
count = len(self.find_elements(locator))
180179
if count == limit:
181180
self.info(f"Current page contains {count} element(s).")
@@ -758,7 +757,7 @@ def drag_and_drop_by_offset(self, locator: str, xoffset: int, yoffset: int):
758757
"""
759758
element = self.find_element(locator)
760759
action = ActionChains(self.driver)
761-
action.drag_and_drop_by_offset(element, int(xoffset), int(yoffset))
760+
action.drag_and_drop_by_offset(element, xoffset, yoffset)
762761
action.perform()
763762

764763
@keyword

src/SeleniumLibrary/keywords/tableelement.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ def get_table_cell(
4141
See `Page Should Contain` for an explanation about the ``loglevel``
4242
argument.
4343
"""
44-
row = int(row)
45-
column = int(column)
4644
if row == 0 or column == 0:
4745
raise ValueError(
4846
"Both row and column must be non-zero, "
@@ -242,7 +240,6 @@ def _find_by_column(self, table_locator, col, content):
242240
return self._find(table_locator, locator, content)
243241

244242
def _index_to_position(self, index):
245-
index = int(index)
246243
if index == 0:
247244
raise ValueError("Row and column indexes must be non-zero.")
248245
if index > 0:

src/SeleniumLibrary/keywords/waiting.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ def wait_until_page_contains_element(
248248
timeout,
249249
error,
250250
)
251-
limit = int(limit)
252251
self._wait_until(
253252
lambda: len(self.find_elements(locator)) == limit,
254253
f'Page should have contained "{limit}" {locator} element(s) within <TIMEOUT>.',
@@ -287,7 +286,6 @@ def wait_until_page_does_not_contain_element(
287286
timeout,
288287
error,
289288
)
290-
limit = int(limit)
291289
self._wait_until(
292290
lambda: len(self.find_elements(locator)) != limit,
293291
f'Page should have not contained "{limit}" {locator} element(s) within <TIMEOUT>.',

src/SeleniumLibrary/keywords/window.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ def set_window_size(self, width: int, height: int, inner: bool = False):
233233
| `Set Window Size` | 800 | 600 | |
234234
| `Set Window Size` | 800 | 600 | True |
235235
"""
236-
width, height = int(width), int(height)
237236
if is_falsy(inner):
238237
return self.driver.set_window_size(width, height)
239238
self.driver.set_window_size(width, height)
@@ -281,7 +280,7 @@ def set_window_position(self, x: int, y: int):
281280
Example:
282281
| `Set Window Position` | 100 | 200 |
283282
"""
284-
self.driver.set_window_position(int(x), int(y))
283+
self.driver.set_window_position(x, y)
285284

286285
def _log_list(self, items, what="item"):
287286
msg = [f"Altogether {len(items)} {what}{plural_or_not(items)}."]

0 commit comments

Comments
 (0)