Bug 1453084 - Add webdriver.Session string representation. r?whimboo draft
authorAndreas Tolfsen <ato@sny.no>
Tue, 10 Apr 2018 19:53:10 +0100
changeset 779870 8f30cfe09c0f220f526cdc53e453ff02298e28bd
parent 779856 0a2dae2d8cf9f628c55668514c54a23da446d5de
child 779871 4cf4a1da1969aa3ea66eb87d60a6737f08b16497
push id105899
push userbmo:ato@sny.no
push dateTue, 10 Apr 2018 18:56:01 +0000
reviewerswhimboo
bugs1453084
milestone61.0a1
Bug 1453084 - Add webdriver.Session string representation. r?whimboo MozReview-Commit-ID: 5yBgvQJjn4u
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
@@ -362,16 +362,19 @@ class Session(object):
         self.extension_cls = extension
 
         self.timeouts = Timeouts(self)
         self.window = Window(self)
         self.find = Find(self)
         self.alert = UserPrompt(self)
         self.actions = Actions(self)
 
+    def __repr__(self):
+        return "<%s %s>" % (self.__class__.__name__, self.session_id or "(disconnected)")
+
     def __eq__(self, other):
         return (self.session_id is not None and isinstance(other, Session) and
                 self.session_id == other.session_id)
 
     def __enter__(self):
         self.start()
         return self