bug 1546319: webdriver: sanitise get_element_property/get.py; r=automatedtester
authorAndreas Tolfsen <ato@sny.no>
Tue, 23 Apr 2019 13:38:35 +0000
changeset 470499 f811995954013dae14ed21659a24a33ce1dbe174
parent 470498 1d5a3139806514bfd7c0c5b5d2983f55639a6bf4
child 470500 728a88d6113294c05c8b8af2eb635faa3200b937
push id35906
push useraciure@mozilla.com
push dateTue, 23 Apr 2019 22:14:56 +0000
treeherdermozilla-central@0ce3633f8b80 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersautomatedtester
bugs1546319
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1546319: webdriver: sanitise get_element_property/get.py; r=automatedtester Nothing remarkable in this patch. Differential Revision: https://phabricator.services.mozilla.com/D28462
testing/web-platform/tests/webdriver/tests/get_element_property/get.py
--- a/testing/web-platform/tests/webdriver/tests/get_element_property/get.py
+++ b/testing/web-platform/tests/webdriver/tests/get_element_property/get.py
@@ -1,52 +1,48 @@
 from tests.support.asserts import assert_error, assert_success
 from tests.support.inline import inline
 
-_input = inline("<input id=i1>")
-
 
 def get_element_property(session, element_id, prop):
     return session.transport.send(
         "GET", "session/{session_id}/element/{element_id}/property/{prop}".format(
             session_id=session.session_id,
             element_id=element_id,
             prop=prop))
 
 
 def test_no_browsing_context(session, closed_window):
     response = get_element_property(session, "foo", "id")
     assert_error(response, "no such window")
 
 
 def test_element_not_found(session):
-    # 13.3 Step 3
-    result = get_element_property(session, "foo", "id")
-    assert_error(result, "no such element")
+    response = get_element_property(session, "foo", "id")
+    assert_error(response, "no such element")
 
 
 def test_element_stale(session):
-    session.url = _input
+    session.url = inline("<input id=foobar>")
     element = session.find.css("input", all=False)
     session.refresh()
 
-    result = get_element_property(session, element.id, "id")
-    assert_error(result, "stale element reference")
+    response = get_element_property(session, element.id, "id")
+    assert_error(response, "stale element reference")
 
 
 def test_property_non_existent(session):
-    session.url = _input
+    session.url = inline("<input>")
     element = session.find.css("input", all=False)
 
-    result = get_element_property(session, element.id, "foo")
-    assert_success(result, None)
-
-    assert session.execute_script("return arguments[0].foo", args=[element]) is None
+    response = get_element_property(session, element.id, "foo")
+    assert_success(response, None)
+    assert session.execute_script("return arguments[0].foo", args=(element,)) is None
 
 
-def test_element(session):
+def test_mutated_element(session):
     session.url = inline("<input type=checkbox>")
     element = session.find.css("input", all=False)
     element.click()
     assert session.execute_script("return arguments[0].hasAttribute('checked')", args=(element,)) is False
 
-    result = get_element_property(session, element.id, "checked")
-    assert_success(result, True)
+    response = get_element_property(session, element.id, "checked")
+    assert_success(response, True)