Skip to content

Commit 28ee782

Browse files
committed
Remove redundant scroll_to in click method
Webdriver by default scrolls to element before click. See spec: https://www.w3.org/TR/webdriver2/\#element-click
1 parent 76ce2df commit 28ee782

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

docs/CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ Version history
33

44
We follow `Semantic Versions <https://semver.org/>`_.
55

6+
0.7.5
7+
*******************************************************************************
8+
- Remove redundant call of ``scroll_to`` in ``PomcornElement.click()``.
9+
This is redundant, as webdriver by default scrolls to element before click (`docs <https://www.w3.org/TR/webdriver2/#element-click>`_).
10+
611
0.7.4
712
*******************************************************************************
813
- Improve ``Page.click_on_page()`` method to click the page coordinates instead

pomcorn/element.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,21 +285,17 @@ def select(self, value: str, only_visible: bool = True):
285285
def click(
286286
self,
287287
only_visible: bool = True,
288-
scroll_to: bool = True,
289288
wait_until_clickable: bool = True,
290289
):
291290
"""Click on element.
292291
293292
Args:
294293
only_visible: Flag for viewing visible elements. If this is `True`
295294
(default), then this method will only get visible elements.
296-
scroll_to: Whether to scroll to element before clicking or not.
297295
wait_until_clickable: Wait until the element is clickable before
298296
clicking, or not (default `True`).
299297
300298
"""
301-
if scroll_to:
302-
self.scroll_to(only_visible=only_visible)
303299
if wait_until_clickable:
304300
self.wait_until_clickable()
305301
self.get_element(only_visible=only_visible).click()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pomcorn"
3-
version = "0.7.4"
3+
version = "0.7.5"
44
description = "Base implementation of Page Object Model"
55
authors = [
66
"Saritasa <[email protected]>",

0 commit comments

Comments
 (0)