Bug 1434872 - [wdclient] Store original capabilities as used for the driver. r=ato, a=test-only
authorHenrik Skupin <mail@hskupin.info>
Mon, 07 May 2018 13:08:08 +0200
changeset 473688 3054da2c5d2ab8c08ca4cd6a4752f1590d22fb80
parent 473687 a108f187e35b1496183c3b146d8b689bb18c59f0
child 473689 d60907dc30693a09471d9c3f1ad8f721f9c00f17
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato, test-only
bugs1434872
milestone61.0
Bug 1434872 - [wdclient] Store original capabilities as used for the driver. r=ato, a=test-only To allow Session.start() to be called multiple times the originally requested capabilities for the driver have to be stored. Currently those are overwritten with the ones as returned by the driver. That means that custom entries which are getting extracted by the driver (eg preferences) to setup the browser profile, are lost and tests themselves cannot internally end a session and start it again. MozReview-Commit-ID: Fi0cf6MaOc6
testing/web-platform/tests/tools/webdriver/webdriver/client.py
--- a/testing/web-platform/tests/tools/webdriver/webdriver/client.py
+++ b/testing/web-platform/tests/tools/webdriver/webdriver/client.py
@@ -347,17 +347,18 @@ class Session(object):
                  host,
                  port,
                  url_prefix="/",
                  capabilities=None,
                  timeout=None,
                  extension=None):
         self.transport = transport.HTTPWireProtocol(
             host, port, url_prefix, timeout=timeout)
-        self.capabilities = capabilities
+        self.requested_capabilities = capabilities
+        self.capabilities = None
         self.session_id = None
         self.timeouts = None
         self.window = None
         self.find = None
         self._element_cache = {}
         self.extension = None
         self.extension_cls = extension
 
@@ -385,18 +386,18 @@ class Session(object):
         self.end()
 
     def start(self):
         if self.session_id is not None:
             return
 
         body = {}
 
-        if self.capabilities is not None:
-            body["capabilities"] = self.capabilities
+        if self.requested_capabilities is not None:
+            body["capabilities"] = self.requested_capabilities
 
         value = self.send_command("POST", "session", body=body)
         self.session_id = value["sessionId"]
         self.capabilities = value["capabilities"]
 
         if self.extension_cls:
             self.extension = self.extension_cls(self)