Skip to content

Commit

Permalink
[py] remove outdated touch actions implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Dec 27, 2021
1 parent 8b984a0 commit 816ad6e
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 292 deletions.
1 change: 0 additions & 1 deletion py/docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Webdriver.common
selenium.webdriver.common.log
selenium.webdriver.common.print_page_options
selenium.webdriver.common.proxy
selenium.webdriver.common.touch_actions
selenium.webdriver.common.utils
selenium.webdriver.common.service
selenium.webdriver.common.html5.application_cache
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion py/selenium/webdriver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from .remote.webdriver import WebDriver as Remote # noqa
from .common.desired_capabilities import DesiredCapabilities # noqa
from .common.action_chains import ActionChains # noqa
from .common.touch_actions import TouchActions # noqa
from .common.proxy import Proxy # noqa
from .common.keys import Keys # noqa

Expand Down
192 changes: 0 additions & 192 deletions py/selenium/webdriver/common/touch_actions.py

This file was deleted.

10 changes: 0 additions & 10 deletions py/selenium/webdriver/remote/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,6 @@ class Command(object):
SET_SCREEN_ORIENTATION = "setScreenOrientation"
GET_SCREEN_ORIENTATION = "getScreenOrientation"

# Touch Actions
SINGLE_TAP = "touchSingleTap"
TOUCH_DOWN = "touchDown"
TOUCH_UP = "touchUp"
TOUCH_MOVE = "touchMove"
TOUCH_SCROLL = "touchScroll"
DOUBLE_TAP = "touchDoubleTap"
LONG_PRESS = "touchLongPress"
FLICK = "touchFlick"

# HTML 5
EXECUTE_SQL = "executeSql"

Expand Down
16 changes: 0 additions & 16 deletions py/selenium/webdriver/remote/remote_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,22 +313,6 @@ def __init__(self, remote_server_addr, keep_alive=False, resolve_ip=None, ignore
('POST', '/session/$sessionId/orientation'),
Command.GET_SCREEN_ORIENTATION:
('GET', '/session/$sessionId/orientation'),
Command.SINGLE_TAP:
('POST', '/session/$sessionId/touch/click'),
Command.TOUCH_DOWN:
('POST', '/session/$sessionId/touch/down'),
Command.TOUCH_UP:
('POST', '/session/$sessionId/touch/up'),
Command.TOUCH_MOVE:
('POST', '/session/$sessionId/touch/move'),
Command.TOUCH_SCROLL:
('POST', '/session/$sessionId/touch/scroll'),
Command.DOUBLE_TAP:
('POST', '/session/$sessionId/touch/doubleclick'),
Command.LONG_PRESS:
('POST', '/session/$sessionId/touch/longclick'),
Command.FLICK:
('POST', '/session/$sessionId/touch/flick'),
Command.EXECUTE_SQL:
('POST', '/session/$sessionId/execute_sql'),
Command.GET_LOCATION:
Expand Down
43 changes: 0 additions & 43 deletions py/test/selenium/webdriver/common/w3c_interaction_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,49 +216,6 @@ def test_pen_pointer_properties(driver, pages):
assert events[6]["twist"] == 0


@pytest.mark.xfail_firefox
@pytest.mark.xfail_remote
def test_touch_pointer_properties(driver, pages):
pages.load("pointerActionsPage.html")
pointerArea = driver.find_element(By.CSS_SELECTOR, "#pointerArea")
center = _get_inview_center(pointerArea.rect, _get_viewport_rect(driver))
touch_input = PointerInput(interaction.POINTER_TOUCH, "touch")
touch_chain = ActionBuilder(driver, mouse=touch_input)
touch_chain.pointer_action.move_to(pointerArea, x=50, y=25) \
.pointer_down(width=23, height=31, pressure=0.78, tilt_x=21, tilt_y=-8, twist=355) \
.move_to(pointerArea, x=60, y=35, width=39, height=35, pressure=0.91, tilt_x=-19, tilt_y=62, twist=345) \
.pointer_up() \
.move_to(pointerArea, x=80, y=50)
touch_chain.perform()
events = _get_events(driver)
assert len(events) == 7
event_types = [e["type"] for e in events]
assert ["pointerover", "pointerenter", "pointerdown", "pointermove",
"pointerup", "pointerout", "pointerleave"] == event_types
assert events[2]["type"] == "pointerdown"
assert events[2]["pageX"] == pytest.approx(center["x"], abs=1.0)
assert events[2]["pageY"] == pytest.approx(center["y"], abs=1.0)
assert events[2]["target"] == "pointerArea"
assert events[2]["pointerType"] == "touch"
assert round(events[2]["width"], 2) == 23
assert round(events[2]["height"], 2) == 31
assert round(events[2]["pressure"], 2) == 0.78
assert events[2]["tiltX"] == 21
assert events[2]["tiltY"] == -8
assert events[2]["twist"] == 355
assert events[3]["type"] == "pointermove"
assert events[3]["pageX"] == pytest.approx(center["x"] + 10, abs=1.0)
assert events[3]["pageY"] == pytest.approx(center["y"] + 10, abs=1.0)
assert events[3]["target"] == "pointerArea"
assert events[3]["pointerType"] == "touch"
assert round(events[3]["width"], 2) == 39
assert round(events[3]["height"], 2) == 35
assert round(events[3]["pressure"], 2) == 0.91
assert events[3]["tiltX"] == -19
assert events[3]["tiltY"] == 62
assert events[3]["twist"] == 345


def _performDragAndDropWithMouse(driver, pages):
"""Copied from org.openqa.selenium.interactions.TestBasicMouseInterface."""
pages.load("draggableLists.html")
Expand Down

1 comment on commit 816ad6e

@sjhogge
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.