bug 1499360: webdriver: add interactability test for zero-sized element; r=whimboo
authorAndreas Tolfsen <ato@sny.no>
Mon, 22 Oct 2018 14:21:31 +0000
changeset 490687 6afa28099f1ec6f3533128f3f8ac596c622a09a6
parent 490686 d51f52d435daa3f87b398a7ca69879da8306b54a
child 490688 9234d32ec23c45c8ba1ebce723d57adcf784fc57
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewerswhimboo
bugs1499360
milestone64.0a1
bug 1499360: webdriver: add interactability test for zero-sized element; r=whimboo Depends on D8881 Differential Revision: https://phabricator.services.mozilla.com/D9287
testing/web-platform/tests/webdriver/tests/element_click/interactability.py
--- a/testing/web-platform/tests/webdriver/tests/element_click/interactability.py
+++ b/testing/web-platform/tests/webdriver/tests/element_click/interactability.py
@@ -27,16 +27,25 @@ def test_element_not_interactable_out_of
         <div style="width: 500px; height: 100px;
             position: absolute; left: 0px; top: -150px; background-color: blue;">
         </div>""")
     element = session.find.css("div", all=False)
     response = element_click(session, element)
     assert_error(response, "element not interactable")
 
 
+@pytest.mark.parametrize("tag_name", ["div", "span"])
+def test_zero_sized_element(session, tag_name):
+    session.url = inline("<{0}></{0}>".format(tag_name))
+    element = session.find.css(tag_name, all=False)
+
+    response = element_click(session, element)
+    assert_error(response, "element not interactable")
+
+
 def test_element_intercepted(session):
     session.url = inline("""
         <input type=button value=Roger style="position: absolute; left: 10px; top: 10px">
         <div style="position: absolute; height: 100px; width: 100px; background: rgba(255,0,0,.5); left: 10px; top: 5px"></div>""")
 
     element = session.find.css("input", all=False)
     response = element_click(session, element)
     assert_error(response, "element click intercepted")