Bug 1391691 - Add wdclient documentation for window manipulation. r=automatedtester
MozReview-Commit-ID: 758QOhUfJzs
--- 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"]