Skip to content

Commit c551357

Browse files
authored
[py] Fix test for w3c touch pointer properties (#15580)
1 parent 9f49428 commit c551357

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

py/test/selenium/webdriver/common/w3c_interaction_tests.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,19 @@ def test_pen_pointer_properties(driver, pages):
227227
@pytest.mark.xfail_safari
228228
def test_touch_pointer_properties(driver, pages):
229229
pages.load("pointerActionsPage.html")
230+
231+
touch_input = PointerInput(interaction.POINTER_TOUCH, "touch")
232+
233+
# Make sure the pointer starts in a known location
234+
reset_actions = ActionBuilder(driver, mouse=touch_input)
235+
reset_actions.pointer_action.move_to_location(x=0, y=0)
236+
reset_actions.perform()
237+
# Clear the events state
238+
driver.execute_script("allEvents.events = [];")
239+
230240
pointerArea = driver.find_element(By.CSS_SELECTOR, "#pointerArea")
241+
231242
center = _get_inview_center(pointerArea.rect, _get_viewport_rect(driver))
232-
touch_input = PointerInput(interaction.POINTER_TOUCH, "touch")
233243
touch_chain = ActionBuilder(driver, mouse=touch_input)
234244
touch_chain.pointer_action.move_to(pointerArea).pointer_down(
235245
width=23, height=31, pressure=0.78, tilt_x=21, tilt_y=-8, twist=355

0 commit comments

Comments
 (0)