Bug 1391691 - Add wdclient documentation for window manipulation. r?automatedtester draft
authorAndreas Tolfsen <ato@sny.no>
Fri, 18 Aug 2017 18:33:52 +0100
changeset 649135 26928da53ea896adcf7f62f58240bb1027c2f8b1
parent 649134 a3285532c82c76aa7b1925bd48087430d027482e
child 649136 2bb1c5cbfbfe65603e6cf5386f9911be06257fc8
push id74962
push userbmo:ato@sny.no
push dateFri, 18 Aug 2017 17:50:50 +0000
reviewersautomatedtester
bugs1391691
milestone57.0a1
Bug 1391691 - Add wdclient documentation for window manipulation. r?automatedtester MozReview-Commit-ID: 758QOhUfJzs
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
@@ -240,35 +240,39 @@ class Window(object):
     @property
     @command
     def rect(self):
         return self.session.send_session_command("GET", "window/rect")
 
     @property
     @command
     def size(self):
+        """Gets the window size as a tuple of `(width, height)`."""
         rect = self.rect
         return (rect["width"], rect["height"])
 
     @size.setter
     @command
-    def size(self, data):
-        width, height = data
+    def size(self, new_size):
+        """Set window size by passing a tuple of `(width, height)`."""
+        width, height = new_size
         body = {"width": width, "height": height}
         self.session.send_session_command("POST", "window/rect", body)
 
     @property
     @command
     def position(self):
+        """Gets the window position as a tuple of `(x, y)`."""
         rect = self.rect
         return (rect["x"], rect["y"])
 
     @position.setter
     @command
-    def position(self, data):
+    def position(self, new_position):
+        """Set window position by passing a tuple of `(x, y)`."""
         data = x, y
         body = {"x": x, "y": y}
         self.session.send_session_command("POST", "window/rect", body)
 
     @property
     @command
     def state(self):
         return self.rect["state"]