Bug 1433390 - Move all assert helps into support.asserts.
For a better management of assertion helpers those should be
added to the central assertion helper module.
MozReview-Commit-ID: DYMfOFl9Fjd
--- a/testing/web-platform/tests/webdriver/tests/actions/mouse.py
+++ b/testing/web-platform/tests/webdriver/tests/actions/mouse.py
@@ -1,12 +1,13 @@
import pytest
-from tests.actions.support.mouse import assert_move_to_coordinates, get_center
+from tests.actions.support.mouse import get_center
from tests.actions.support.refine import get_events, filter_dict
+from tests.support.asserts import assert_move_to_coordinates
from tests.support.inline import inline
from tests.support.wait import wait
def link_doc(dest):
content = "<a href=\"{}\" id=\"link\">destination</a>".format(dest)
return inline(content)
--- a/testing/web-platform/tests/webdriver/tests/actions/mouse_dblclick.py
+++ b/testing/web-platform/tests/webdriver/tests/actions/mouse_dblclick.py
@@ -1,12 +1,13 @@
import pytest
-from tests.actions.support.mouse import assert_move_to_coordinates, get_center
+from tests.actions.support.mouse import get_center
from tests.actions.support.refine import get_events, filter_dict
+from tests.support.asserts import assert_move_to_coordinates
_DBLCLICK_INTERVAL = 640
# Using local fixtures because we want to start a new session between
# each test, otherwise the clicks in each test interfere with each other.
@pytest.fixture(autouse=True)
--- a/testing/web-platform/tests/webdriver/tests/actions/support/mouse.py
+++ b/testing/web-platform/tests/webdriver/tests/actions/support/mouse.py
@@ -1,13 +1,5 @@
-def assert_move_to_coordinates(point, target, events):
- for e in events:
- if e["type"] != "mousemove":
- assert e["pageX"] == point["x"]
- assert e["pageY"] == point["y"]
- assert e["target"] == target
-
-
def get_center(rect):
return {
"x": rect["width"] / 2 + rect["x"],
"y": rect["height"] / 2 + rect["y"],
}
--- a/testing/web-platform/tests/webdriver/tests/support/asserts.py
+++ b/testing/web-platform/tests/webdriver/tests/support/asserts.py
@@ -143,8 +143,16 @@ def assert_element_has_focus(target_elem
session = target_element.session
active_element = session.execute_script("return document.activeElement")
active_tag = active_element.property("localName")
target_tag = target_element.property("localName")
assert active_element == target_element, (
"Focussed element is <%s>, not <%s>" % (active_tag, target_tag))
+
+
+def assert_move_to_coordinates(point, target, events):
+ for e in events:
+ if e["type"] != "mousemove":
+ assert e["pageX"] == point["x"]
+ assert e["pageY"] == point["y"]
+ assert e["target"] == target