Bug 1434872 - [wdclient] Store original capabilities as used for the driver.
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
--- 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)