From 34da26d24e8b39f6774630e1e720843c26115051 Mon Sep 17 00:00:00 2001 From: Maja Frydrychowicz Date: Mon, 27 Feb 2017 08:32:24 -0500 Subject: [PATCH] Bug 1337133 - Add a wdspec test for mouse actions; r=ato+446296 Proof of concept to be replaced with more tests in a follow-up. MozReview-Commit-ID: 8FHJOgpO1wr --HG-- extra : rebase_source : a4785c01941e6d8a62aca1e91808576894e95e61 --- testing/web-platform/meta/MANIFEST.json | 102 +++++++++++++----- .../meta/webdriver/actions/mouse.py.ini | 5 + .../tests/webdriver/actions/mouse.py | 31 +++++- 3 files changed, 107 insertions(+), 31 deletions(-) create mode 100644 testing/web-platform/meta/webdriver/actions/mouse.py.ini diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json index e542ef445c40..08abef620b5b 100644 --- a/testing/web-platform/meta/MANIFEST.json +++ b/testing/web-platform/meta/MANIFEST.json @@ -12854,11 +12854,6 @@ {} ] ], - "./test_keys_wdspec.html": [ - [ - {} - ] - ], "./update-built-tests.sh": [ [ {} @@ -62234,12 +62229,27 @@ {} ] ], - "webdriver/support/__init__.py": [ + "webdriver/actions/__init__.py": [ [ {} ] ], - "webdriver/support/keys.py": [ + "webdriver/actions/support/__init__.py": [ + [ + {} + ] + ], + "webdriver/actions/support/keys.py": [ + [ + {} + ] + ], + "webdriver/actions/support/refine.py": [ + [ + {} + ] + ], + "webdriver/actions/support/test_actions_wdspec.html": [ [ {} ] @@ -129329,9 +129339,27 @@ ] }, "wdspec": { - "webdriver/actions.py": [ + "webdriver/actions/conftest.py": [ [ - "/webdriver/actions.py", + "/webdriver/actions/conftest.py", + {} + ] + ], + "webdriver/actions/key.py": [ + [ + "/webdriver/actions/key.py", + {} + ] + ], + "webdriver/actions/mouse.py": [ + [ + "/webdriver/actions/mouse.py", + {} + ] + ], + "webdriver/actions/sequence.py": [ + [ + "/webdriver/actions/sequence.py", {} ] ], @@ -129444,10 +129472,6 @@ "c51b17fbac2a2e3121dc74f7badbd2873ce92f61", "support" ], - "./test_keys_wdspec.html": [ - "13e6f15dcfe080bff5f3b3cbaf9b9f679915aca3", - "support" - ], "./update-built-tests.sh": [ "75ea35a5ce9d8e3e32e8d0c336dc12e04691d16a", "support" @@ -176941,7 +176965,7 @@ "testharness" ], "html/semantics/forms/the-select-element/common-HTMLOptionsCollection.html": [ - "de186d5f39bf85cc073ad6262fa933f89a4500d5", + "b5a01e973e4d4c97c6fa06bd9fd1e535e8c622e8", "testharness" ], "html/semantics/forms/the-select-element/select-ask-for-reset.html": [ @@ -178129,11 +178153,11 @@ "testharness" ], "html/semantics/tabular-data/the-table-element/tFoot.html": [ - "8017cabc08b5c10566ce97dee0cecd73d7ee3bce", + "ec9513f8c78bed931ac9ea51910d314b46639317", "testharness" ], "html/semantics/tabular-data/the-table-element/tHead.html": [ - "45cd1c63c80dce76c5a51644fa17f8535846cb54", + "96c3470e247189297a84310173392007bad4977d", "testharness" ], "html/semantics/tabular-data/the-table-element/table-insertRow.html": [ @@ -178197,7 +178221,7 @@ "testharness" ], "html/semantics/tabular-data/the-tr-element/insertCell.html": [ - "d3e48e89cfc8a9f3478af5c922fea6a59e88135e", + "8161e1f20e42a9fe5270cc779dca71ada097cd75", "testharness" ], "html/semantics/tabular-data/the-tr-element/rowIndex.html": [ @@ -205836,10 +205860,42 @@ "a4611303723fa7225d7667a1e4fe2495451b824f", "support" ], - "webdriver/actions.py": [ - "3a857859e17b7965cec7fb1ba2368177f316a395", + "webdriver/actions/__init__.py": [ + "da39a3ee5e6b4b0d3255bfef95601890afd80709", + "support" + ], + "webdriver/actions/conftest.py": [ + "ba57459c1eb7d792e14e756078eb725f4c07aa6e", "wdspec" ], + "webdriver/actions/key.py": [ + "808f1311409fb70a40bbb995ff7da768d58e43cb", + "wdspec" + ], + "webdriver/actions/mouse.py": [ + "640ae3074200938ad63f77627d6645efa8c5716e", + "wdspec" + ], + "webdriver/actions/sequence.py": [ + "d80f382863e52ff223db735a2a551197e570774f", + "wdspec" + ], + "webdriver/actions/support/__init__.py": [ + "da39a3ee5e6b4b0d3255bfef95601890afd80709", + "support" + ], + "webdriver/actions/support/keys.py": [ + "85bfdbd3203166c2b84616cc1936f6dd98f8de3b", + "support" + ], + "webdriver/actions/support/refine.py": [ + "0d244bffe67ef57be68aad99f1cbc7440ff80e27", + "support" + ], + "webdriver/actions/support/test_actions_wdspec.html": [ + "63b5de5ab6c7a00717663a18c3b4d79857ee2136", + "support" + ], "webdriver/conftest.py": [ "9a5d2c122d912af2d53478a3f83ac9da676ba531", "wdspec" @@ -205856,14 +205912,6 @@ "2216ea3b518ec6b1beef54ce2580b5e62c2841a0", "wdspec" ], - "webdriver/support/__init__.py": [ - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "support" - ], - "webdriver/support/keys.py": [ - "85bfdbd3203166c2b84616cc1936f6dd98f8de3b", - "support" - ], "webdriver/util/__init__.py": [ "8910ee7d68dfff68460731ea37eb0d406d07862d", "support" diff --git a/testing/web-platform/meta/webdriver/actions/mouse.py.ini b/testing/web-platform/meta/webdriver/actions/mouse.py.ini new file mode 100644 index 000000000000..bafebbf3a84a --- /dev/null +++ b/testing/web-platform/meta/webdriver/actions/mouse.py.ini @@ -0,0 +1,5 @@ +[mouse.py] + type: wdspec + disabled: + if (os == "linux") and (bits == 64) and debug: https://bugzilla.mozilla.org/show_bug.cgi?id=1318724 + expected: CRASH diff --git a/testing/web-platform/tests/webdriver/actions/mouse.py b/testing/web-platform/tests/webdriver/actions/mouse.py index 26d7d5e3beaa..a7192ef3bc89 100644 --- a/testing/web-platform/tests/webdriver/actions/mouse.py +++ b/testing/web-platform/tests/webdriver/actions/mouse.py @@ -1,8 +1,31 @@ -from support.refine import get_events +from support.refine import get_events, filter_dict -def test_nothing(session, test_actions_page, mouse_chain): +def test_click_at_coordinates(session, test_actions_page, mouse_chain): + div_point = { + "x": 82, + "y": 187, + } + button = 0 mouse_chain \ - .pointer_down(0) \ + .pointer_move(div_point["x"], div_point["y"], duration=1000) \ + .pointer_down(button) \ + .pointer_up(button) \ .perform() - assert True + events = get_events(session) + assert len(events) == 4 + for e in events: + if e["type"] != "mousemove": + assert e["pageX"] == div_point["x"] + assert e["pageY"] == div_point["y"] + assert e["target"] == "outer" + if e["type"] != "mousedown": + assert e["buttons"] == 0 + assert e["button"] == button + expected = [ + {"type": "mousedown", "buttons": 1}, + {"type": "mouseup", "buttons": 0}, + {"type": "click", "buttons": 0}, + ] + filtered_events = [filter_dict(e, expected[0]) for e in events] + assert expected == filtered_events[1:]