From 230468d1551ab1067565a8a40c5963280af4c488 Mon Sep 17 00:00:00 2001 From: titusfortner Date: Tue, 31 May 2022 14:17:36 -0500 Subject: [PATCH] [py] allow setting pointer event attributes in move_by() and move_to_location() --- .../common/actions/pointer_actions.py | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/py/selenium/webdriver/common/actions/pointer_actions.py b/py/selenium/webdriver/common/actions/pointer_actions.py index 36572ef148db5..ab60579c33a98 100644 --- a/py/selenium/webdriver/common/actions/pointer_actions.py +++ b/py/selenium/webdriver/common/actions/pointer_actions.py @@ -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):