Bug 1434872 - [wdclient] Store original capabilities as used for the driver. r=ato
authorHenrik Skupin <mail@hskupin.info>
Mon, 07 May 2018 13:08:08 +0200
changeset 417593 14c67a3e28d5f400b85d47763b13b949a8b04502
parent 417592 f22e8468bc8503d101ce54b94d31ddde3c0be098
child 417594 c69d500931d2834837054f448dad327e60c40b84
push id33974
push userncsoregi@mozilla.com
push dateThu, 10 May 2018 09:47:43 +0000
treeherdermozilla-central@b52b2eb81d1e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1434872
milestone62.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 1434872 - [wdclient] Store original capabilities as used for the driver. r=ato 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)