Sitelet https://github.com/appium/python-client/pull/961
Skip to content

feat: add pause in drag_and_drop - #961

Merged
KazuCocoa merged 4 commits into
masterfrom
add-pause
Feb 24, 2024
Merged

KazuCocoa merged 4 commits into
masterfrom
add-pause

Conversation

@KazuCocoa

@KazuCocoa KazuCocoa commented Feb 22, 2024 •

Copy link
Copy Markdown
Member

closes #955

Comment thread appium/webdriver/extensions/action_helpers.py Outdated

def drag_and_drop(self, origin_el: WebElement, destination_el: WebElement) -> 'WebDriver':
def drag_and_drop(
self, origin_el: WebElement, destination_el: WebElement, pause: Union[float, None] = None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer Optional[float]

actions = ActionChains(self)
# 'mouse' pointer action
actions.w3c_actions.pointer_action.click_and_hold(origin_el)
if pause:

@mykola-mokhnach mykola-mokhnach Feb 22, 2024 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if pause is not None and pause > 0

# 'mouse' pointer action
actions.w3c_actions.pointer_action.click_and_hold(origin_el)
if pause:
actions.w3c_actions.pointer_action.pause(pause)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume we need to convert the value to integer milliseconds according to w3c spec

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KazuCocoa
KazuCocoa merged commit 686d486 into master Feb 24, 2024
@KazuCocoa
KazuCocoa deleted the add-pause branch February 24, 2024 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ActionHelpers extenstion 'Drag and Drop' implementation problem

2 participants