Skip to content

Commit 00add35

Browse files
committed
[py] allow setting pointer event attributes in move_by() and move_to_location()
1 parent 1570bb3 commit 00add35

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

py/selenium/webdriver/common/actions/pointer_actions.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,24 @@ def move_to(self, element, x=0, y=0, width=None, height=None, pressure=None,
8282
altitude_angle=altitude_angle, azimuth_angle=azimuth_angle)
8383
return self
8484

85-
def move_by(self, x, y):
86-
self.source.create_pointer_move(origin=interaction.POINTER, duration=self._duration, x=int(x), y=int(y))
85+
def move_by(self, x, y, width=None, height=None, pressure=None,
86+
tangential_pressure=None, tilt_x=None, tilt_y=None, twist=None,
87+
altitude_angle=None, azimuth_angle=None):
88+
self.source.create_pointer_move(origin=interaction.POINTER, duration=self._duration, x=int(x), y=int(y),
89+
width=width, height=height, pressure=pressure,
90+
tangential_pressure=tangential_pressure,
91+
tilt_x=tilt_x, tilt_y=tilt_y, twist=twist,
92+
altitude_angle=altitude_angle, azimuth_angle=azimuth_angle)
8793
return self
8894

89-
def move_to_location(self, x, y):
90-
self.source.create_pointer_move(origin='viewport', duration=self._duration, x=int(x), y=int(y))
95+
def move_to_location(self, x, y, width=None, height=None, pressure=None,
96+
tangential_pressure=None, tilt_x=None, tilt_y=None, twist=None,
97+
altitude_angle=None, azimuth_angle=None):
98+
self.source.create_pointer_move(origin='viewport', duration=self._duration, x=int(x), y=int(y),
99+
width=width, height=height, pressure=pressure,
100+
tangential_pressure=tangential_pressure,
101+
tilt_x=tilt_x, tilt_y=tilt_y, twist=twist,
102+
altitude_angle=altitude_angle, azimuth_angle=azimuth_angle)
91103
return self
92104

93105
def click(self, element=None):

0 commit comments

Comments
 (0)