bug 1499057: webdriver: fix element comparison assertions; r=whimboo
authorAndreas Tolfsen <ato@sny.no>
Thu, 18 Oct 2018 18:33:09 +0000
changeset 500443 b5b389d5788ed89f7e666c4de6e80e6a3cb99a19
parent 500442 9782e0b1657da7b2742e693222f8ac912920b521
child 500444 55724db90e3e23b09e946681067567c489023249
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo
bugs1499057
milestone64.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 1499057: webdriver: fix element comparison assertions; r=whimboo The Python "is" operator tests object identity, but the tests should rely on the webdriver.Element equality implementation, __eq__. Differential Revision: https://phabricator.services.mozilla.com/D9127
testing/web-platform/tests/webdriver/tests/element_send_keys/interactability.py
--- a/testing/web-platform/tests/webdriver/tests/element_send_keys/interactability.py
+++ b/testing/web-platform/tests/webdriver/tests/element_send_keys/interactability.py
@@ -16,60 +16,60 @@ def test_body_is_interactable(session):
           <input>
         </body>
     """)
 
     element = session.find.css("body", all=False)
     result = session.find.css("input", all=False)
 
     # By default body is the active element
-    assert session.active_element is element
+    assert session.active_element == element
 
     response = element_send_keys(session, element, "foo")
     assert_success(response)
-    assert session.active_element is element
+    assert session.active_element == element
     assert result.property("value") == "foo"
 
 
 def test_document_element_is_interactable(session):
     session.url = inline("""
         <html onkeypress="document.querySelector('input').value += event.key">
           <input>
         </html>
     """)
 
     body = session.find.css("body", all=False)
     element = session.find.css(":root", all=False)
     result = session.find.css("input", all=False)
 
     # By default body is the active element
-    assert session.active_element is body
+    assert session.active_element == body
 
     response = element_send_keys(session, element, "foo")
     assert_success(response)
-    assert session.active_element is element
+    assert session.active_element == element
     assert result.property("value") == "foo"
 
 
 def test_iframe_is_interactable(session):
     session.url = inline(iframe("""
         <body onkeypress="document.querySelector('input').value += event.key">
           <input>
         </body>
     """))
 
     body = session.find.css("body", all=False)
     frame = session.find.css("iframe", all=False)
 
     # By default the body has the focus
-    assert session.active_element is body
+    assert session.active_element == body
 
     response = element_send_keys(session, frame, "foo")
     assert_success(response)
-    assert session.active_element is frame
+    assert session.active_element == frame
 
     # Any key events are immediately routed to the nested
     # browsing context's active document.
     session.switch_frame(frame)
     result = session.find.css("input", all=False)
     assert result.property("value") == "foo"