Bug 1405018 - Add test for stale frame element. r=maja_zf, a=test-only
authorAndreas Tolfsen <ato@sny.no>
Mon, 02 Oct 2017 19:11:15 +0100
changeset 432429 39d11cbd38eb
parent 432428 5d8a54db7749
child 432430 10279b6ebdf8
push id7953
push userryanvm@gmail.com
push dateThu, 12 Oct 2017 14:05:58 +0000
treeherdermozilla-beta@f4ba99b41183 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf, test-only
bugs1405018
milestone57.0
Bug 1405018 - Add test for stale frame element. r=maja_zf, a=test-only The <p> element inside the <iframe> should be considered stale when interacting with it after the current browsing context is switched back to the top level browsing context. MozReview-Commit-ID: 1zrnBowSpxt
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/webdriver/tests/switch_to_parent_frame.py
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -407370,16 +407370,22 @@
      {}
     ]
    ],
    "webdriver/tests/status.py": [
     [
      "/webdriver/tests/status.py",
      {}
     ]
+   ],
+   "webdriver/tests/switch_to_parent_frame.py": [
+    [
+     "/webdriver/tests/switch_to_parent_frame.py",
+     {}
+    ]
    ]
   }
  },
  "paths": {
   "./.codecov.yml": [
    "e2322808739a5977e90896b4755cfc20f4ab2046",
    "support"
   ],
@@ -628607,27 +628613,31 @@
    "5d865921c91cb1f050f1a15ddcacab0747a0b660",
    "support"
   ],
   "webdriver/tests/support/http_request.py": [
    "cb40c781fea2280b98135522def5e6a116d7b946",
    "support"
   ],
   "webdriver/tests/support/inline.py": [
-   "d05c1b209ab1b8c22ab542d0418340896bc844fb",
+   "ffabd6a12d6e7928176fa00702214e0c8e0a25d7",
    "support"
   ],
   "webdriver/tests/support/merge_dictionaries.py": [
    "84a6d3c6f8f4afded0f21264bbaeebec38a7f827",
    "support"
   ],
   "webdriver/tests/support/wait.py": [
    "a4b0c9c340ea7055139d9fcab3246ee836d6a441",
    "support"
   ],
+  "webdriver/tests/switch_to_parent_frame.py": [
+   "487a0588e9c017640017b775c06c21f919d16fa9",
+   "wdspec"
+  ],
   "webgl/OWNERS": [
    "f8e0703fe2cc88edd21ef2c94fcb2e1a8889f5ae",
    "support"
   ],
   "webgl/bufferSubData.html": [
    "526612470551a0eb157b310c587d50080087808d",
    "testharness"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/webdriver/tests/switch_to_parent_frame.py
@@ -0,0 +1,18 @@
+import pytest
+from webdriver import StaleElementReferenceException
+
+from tests.support.inline import inline, iframe
+
+
+def switch_to_parent_frame(session):
+    return session.transport.send("POST", "session/%s/frame/parent" % session.session_id)
+
+
+def test_stale_element_from_iframe(session):
+    session.url = inline(iframe("<p>foo"))
+    frame_element = session.find.css("iframe", all=False)
+    session.switch_frame(frame_element)
+    stale_element = session.find.css("p", all=False)
+    switch_to_parent_frame(session)
+    with pytest.raises(StaleElementReferenceException):
+        stale_element.text