Skip to content

Commit

Permalink
[py] allow setting pointer event attributes in move_by() and move_to_…
Browse files Browse the repository at this point in the history
…location()
  • Loading branch information
titusfortner committed May 31, 2022
1 parent 1570bb3 commit 00add35
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions py/selenium/webdriver/common/actions/pointer_actions.py
Expand Up @@ -82,12 +82,24 @@ def move_to(self, element, x=0, y=0, width=None, height=None, pressure=None,
altitude_angle=altitude_angle, azimuth_angle=azimuth_angle)
return self

def move_by(self, x, y):
self.source.create_pointer_move(origin=interaction.POINTER, duration=self._duration, x=int(x), y=int(y))
def move_by(self, x, y, width=None, height=None, pressure=None,
tangential_pressure=None, tilt_x=None, tilt_y=None, twist=None,
altitude_angle=None, azimuth_angle=None):
self.source.create_pointer_move(origin=interaction.POINTER, duration=self._duration, x=int(x), y=int(y),
width=width, height=height, pressure=pressure,
tangential_pressure=tangential_pressure,
tilt_x=tilt_x, tilt_y=tilt_y, twist=twist,
altitude_angle=altitude_angle, azimuth_angle=azimuth_angle)
return self

def move_to_location(self, x, y):
self.source.create_pointer_move(origin='viewport', duration=self._duration, x=int(x), y=int(y))
def move_to_location(self, x, y, width=None, height=None, pressure=None,
tangential_pressure=None, tilt_x=None, tilt_y=None, twist=None,
altitude_angle=None, azimuth_angle=None):
self.source.create_pointer_move(origin='viewport', duration=self._duration, x=int(x), y=int(y),
width=width, height=height, pressure=pressure,
tangential_pressure=tangential_pressure,
tilt_x=tilt_x, tilt_y=tilt_y, twist=twist,
altitude_angle=altitude_angle, azimuth_angle=azimuth_angle)
return self

def click(self, element=None):
Expand Down

0 comments on commit 00add35

Please sign in to comment.