Skip to content
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

[py] Allow overriding the default 250 msecs duration of pointer movement #9336

Merged
merged 2 commits into from
Apr 8, 2021

Conversation

space88man
Copy link
Contributor

@space88man space88man commented Mar 25, 2021

Description

Set the duration of a pointer movement by adding
a kwarg duration= to ActionChains constructor that will percolate down to PointerInput.create_pointer_move
via ActionBuilder and PointerActions. Addresses #7281.

Motivation and Context

There is a default duration of 250 msecs (DEFAULT_MOVE_DURATION) set in PointerInput. However
PointerActions, a consumer of the method PointerInput.create_pointer_move, does not override this duration.
Thus every pointer move incurs 250 msecs.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@CLAassistant
Copy link

CLAassistant commented Mar 25, 2021

CLA assistant check
All committers have signed the CLA.

@space88man space88man changed the title [Python] Allow overriding the default 250 msecs duration of pointer movement [py] Allow overriding the default 250 msecs duration of pointer movement Mar 25, 2021
@space88man
Copy link
Contributor Author

space88man commented Mar 25, 2021

More context; users of PointerInput have to maintain their own code fork with DEFAULT_MOVE_DURATION = 0 in pointer_input.py or monkey patch

# the current workaround
# monkey patching for DEFAULT_MOVE_DURATION = 250
# the default duration for a pointer move is 250 msecs
# this is not overridden by pointer_actions.py
# to shorten the duration we have to monkey patch the method
orig_mthd = PointerInput.create_pointer_move

def new_mthd(self, duration=0, x=None, y=None, origin=None):
    orig_mthd(self, duration=duration, x=x, y=y, origin=origin)

PointerInput.create_pointer_move = new_mthd

@diemol diemol added the C-py label Mar 29, 2021
@AutomatedTester
Copy link
Member

thanks for the patch!

@AutomatedTester AutomatedTester merged commit 3c82c86 into SeleniumHQ:trunk Apr 8, 2021
@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 8, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants