Unreviewed. Update W3C WebDriver imported tests.
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Dec 2017 11:34:41 +0000 (11:34 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Dec 2017 11:34:41 +0000 (11:34 +0000)
* imported/w3c/importer.json:
* imported/w3c/tools/webdriver/webdriver/client.py:
* imported/w3c/tools/webdriver/webdriver/error.py:
* imported/w3c/webdriver/tests/element_retrieval/get_active_element.py:
* imported/w3c/webdriver/tests/interaction/element_clear.py:
* imported/w3c/webdriver/tests/sessions/status.py:
* imported/w3c/webdriver/tests/support/wait.py:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225476 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebDriverTests/ChangeLog
WebDriverTests/imported/w3c/importer.json
WebDriverTests/imported/w3c/tools/webdriver/webdriver/client.py
WebDriverTests/imported/w3c/tools/webdriver/webdriver/error.py
WebDriverTests/imported/w3c/webdriver/tests/element_retrieval/get_active_element.py
WebDriverTests/imported/w3c/webdriver/tests/interaction/element_clear.py
WebDriverTests/imported/w3c/webdriver/tests/sessions/status.py
WebDriverTests/imported/w3c/webdriver/tests/support/wait.py

index 1ad9d8e..a1b543f 100644 (file)
@@ -1,3 +1,15 @@
+2017-12-04  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        Unreviewed. Update W3C WebDriver imported tests.
+
+        * imported/w3c/importer.json:
+        * imported/w3c/tools/webdriver/webdriver/client.py:
+        * imported/w3c/tools/webdriver/webdriver/error.py:
+        * imported/w3c/webdriver/tests/element_retrieval/get_active_element.py:
+        * imported/w3c/webdriver/tests/interaction/element_clear.py:
+        * imported/w3c/webdriver/tests/sessions/status.py:
+        * imported/w3c/webdriver/tests/support/wait.py:
+
 2017-12-01  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         WebDriver: auto-install pytest instead of importing it from wpt tools directory
index 2715602..af46c58 100644 (file)
@@ -1,6 +1,6 @@
 {
     "repository": "https://github.com/w3c/web-platform-tests.git",
-    "revision": "2b50389ee72d89dd0be12bc6ca54a6e95c98d163",
+    "revision": "267d6b27ffd416577702653c0987b30239daae3f",
     "paths_to_import": [
         "tools/webdriver",
         "tools/wptrunner",
index 4defb75..ec7d6de 100644 (file)
@@ -42,7 +42,7 @@ class Timeouts(object):
     def _set(self, key, secs):
         body = {key: secs * 1000}
         timeouts = self.session.send_session_command("POST", "timeouts", body)
-        return timeouts[key]
+        return None
 
     @property
     def script(self):
index 2fb748d..ecfe891 100644 (file)
@@ -8,17 +8,20 @@ class WebDriverException(Exception):
 
     def __init__(self, message, stacktrace=None):
         super(WebDriverException, self)
+        self.message = message
         self.stacktrace = stacktrace
 
     def __repr__(self):
         return "<%s http_status=%s>" % (self.__class__.__name__, self.http_status)
 
     def __str__(self):
-        return ("%s (%s)\n"
-            "\n"
+        message = "%s (%s): %s\n" % (self.status_code, self.http_status, self.message)
+        if self.stacktrace:
+            message += ("\n"
             "Remote-end stacktrace:\n"
             "\n"
-            "%s" % (self.status_code, self.http_status, self.stacktrace))
+            "%s" % self.stacktrace)
+        return message
 
 
 class ElementClickInterceptedException(WebDriverException):
index 5c2b52a..af3e125 100644 (file)
@@ -69,7 +69,7 @@ def test_handle_prompt_dismiss(new_session, add_browser_capabilites):
     response = get_active_element(session)
     assert_is_active_element(session, response)
     assert_dialog_handled(session, "dismiss #2")
-    assert read_global(session, "dismiss2") is None
+    assert read_global(session, "dismiss2") is False
 
     create_dialog(session)("prompt", text="dismiss #3", result_var="dismiss3")
 
index 0712290..f9755f7 100644 (file)
@@ -147,9 +147,9 @@ def test_clear_content_editable_resettable_element(session, element):
     url = element[1] + """<input id=focusCheck type=checkbox>
                     <input id=blurCheck type=checkbox>
                     <script>
-                    var id = %s
-                    document.getElementById("id").addEventListener("focus", checkFocus);
-                    document.getElementById("id").addEventListener("blur", checkBlur);
+                    var id = "%s";
+                    document.getElementById(id).addEventListener("focus", checkFocus);
+                    document.getElementById(id).addEventListener("blur", checkBlur);
                     document.getElementById("empty").addEventListener("focus", checkFocus);
                     document.getElementById("empty").addEventListener("blur", checkBlur);
 
@@ -163,15 +163,15 @@ def test_clear_content_editable_resettable_element(session, element):
     session.url = inline(url)
     # Step 1
     empty_element = session.find.css("#empty", all=False)
-    test_clear_element_helper(session, empty_element, False)
+    clear_element_test_helper(session, empty_element, False)
     session.execute_script("document.getElementById(\"focusCheck\").checked = false;")
     session.execute_script("document.getElementById(\"blurCheck\").checked = false;")
     # Step 2 - 4
     test_element = session.find.css("#" + element[0], all=False)
-    test_clear_element_helper(session, test_element, True)
+    clear_element_test_helper(session, test_element, True)
 
 
-def test_clear_element_helper(session, element, value):
+def clear_element_test_helper(session, element, value):
     response = clear(session, element)
     assert_success(response)
     response = session.execute_script("return document.getElementById(\"focusCheck\").checked;")
index e4b3e93..892ce92 100644 (file)
@@ -21,13 +21,13 @@ def test_get_status_no_session(http):
         assert isinstance(value["message"], basestring)
 
 
-def test_status_with_session_running_on_endpoint_node(new_session):
+def test_status_with_session_running_on_endpoint_node(new_session, add_browser_capabilites):
     # For an endpoint node, the maximum number of active
     # sessions is 1: https://www.w3.org/TR/webdriver/#dfn-maximum-active-sessions
     # A session is open, so we expect `ready` to be False
     # 8.3 step 1.
 
-    _, session = new_session("{}")  # we don't care what we're using
+    _, session = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({})}})
     value = session.send_command("GET", "status")
 
     assert value["ready"] == False
index ab85e38..6f439ec 100644 (file)
@@ -35,5 +35,4 @@ def wait(session, condition, message,
             continue
         return success
 
-    print "Last exception encountered was {}".format(last_exc)
     raise TimeoutException("Timed out after %d seconds: %s" % (timeout, message))