Skip to content

Implement New Action Keyword Drag And Drop #371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions AppiumLibrary/keywords/_touch.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,24 @@ def click_element_at_coordinates(self, coordinate_X, coordinate_Y):
action = TouchAction(driver)
action.press(x=coordinate_X, y=coordinate_Y).release().perform()

def drag_and_drop(self):
"""TO BE IMPLEMENTED
Refer to : appium.webdriver.extensions.action_helpers"""
def drag_and_drop(self, locator: str, target: str):
"""Drags the element identified by ``locator`` into the ``target`` element.

The ``locator`` argument is the locator of the dragged element
and the ``target`` is the locator of the target. See the
`Locating elements` section for details about the locator syntax.

Args:
- ``origin`` - the element to drag
- ``destination`` - the element to drag to

Usage:
| `Drag And Drop` | id=div#element | id=div.target |
"""
element = self._element_find(locator, True, True)
target = self._element_find(target, True, True)
driver = self._current_application()
driver.drag_and_drop(element, target)

def flick(self):
"""TO BE IMPLEMENTED
Expand Down