15
15
# specific language governing permissions and limitations
16
16
# under the License.
17
17
18
-
18
+ import warnings
19
19
from typing import Optional
20
20
21
21
from selenium .webdriver .common .bidi .common import command_builder
@@ -54,6 +54,16 @@ def __init__(
54
54
self .y = y
55
55
self .active = active
56
56
57
+ def get_state (self ) -> str :
58
+ """Gets the state of the client window.
59
+
60
+ Returns:
61
+ -------
62
+ str: The state of the client window (one of the ClientWindowState constants).
63
+ """
64
+ warnings .warn ("get_state method is deprecated, use `state` property instead" , DeprecationWarning , stacklevel = 2 )
65
+ return self .state
66
+
57
67
@property
58
68
def state (self ) -> str :
59
69
"""Gets the state of the client window.
@@ -76,6 +86,20 @@ def state(self, value) -> None:
76
86
raise ValueError (f"Invalid state: { value } . Must be one of { ClientWindowState .VALID_STATES } " )
77
87
self ._state = value
78
88
89
+ def get_client_window (self ) -> str :
90
+ """Gets the client window identifier.
91
+
92
+ Returns:
93
+ -------
94
+ str: The client window identifier.
95
+ """
96
+ warnings .warn (
97
+ "get_client_window method is deprecated, use `client_window` property instead" ,
98
+ DeprecationWarning ,
99
+ stacklevel = 2 ,
100
+ )
101
+ return self .client_window
102
+
79
103
@property
80
104
def client_window (self ) -> str :
81
105
"""Gets the client window identifier.
@@ -96,6 +120,16 @@ def client_window(self, value) -> None:
96
120
raise ValueError ("clientWindow must be a string" )
97
121
self ._client_window = value
98
122
123
+ def get_width (self ) -> int :
124
+ """Gets the width of the client window.
125
+
126
+ Returns:
127
+ -------
128
+ int: The width of the client window.
129
+ """
130
+ warnings .warn ("get_width method is deprecated, use `width` property instead" , DeprecationWarning , stacklevel = 2 )
131
+ return self .width
132
+
99
133
@property
100
134
def width (self ) -> int :
101
135
"""Gets the width of the client window.
@@ -116,6 +150,18 @@ def width(self, value) -> None:
116
150
raise ValueError (f"width must be a non-negative integer, got { value } " )
117
151
self ._width = value
118
152
153
+ def get_height (self ) -> int :
154
+ """Gets the height of the client window.
155
+
156
+ Returns:
157
+ -------
158
+ int: The height of the client window.
159
+ """
160
+ warnings .warn (
161
+ "get_height method is deprecated, use `height` property instead" , DeprecationWarning , stacklevel = 2
162
+ )
163
+ return self .height
164
+
119
165
@property
120
166
def height (self ) -> int :
121
167
"""Gets the height of the client window.
@@ -136,6 +182,16 @@ def height(self, value) -> None:
136
182
raise ValueError (f"height must be a non-negative integer, got { value } " )
137
183
self ._height = value
138
184
185
+ def get_x (self ) -> int :
186
+ """Gets the x coordinate of the client window.
187
+
188
+ Returns:
189
+ -------
190
+ int: The x coordinate of the client window.
191
+ """
192
+ warnings .warn ("get_x method is deprecated, use `x` property instead" , DeprecationWarning , stacklevel = 2 )
193
+ return self .x
194
+
139
195
@property
140
196
def x (self ) -> int :
141
197
"""Gets the x coordinate of the client window.
@@ -156,6 +212,16 @@ def x(self, value) -> None:
156
212
raise ValueError (f"x must be an integer, got { type (value ).__name__ } " )
157
213
self ._x = value
158
214
215
+ def get_y (self ) -> int :
216
+ """Gets the y coordinate of the client window.
217
+
218
+ Returns:
219
+ -------
220
+ int: The y coordinate of the client window.
221
+ """
222
+ warnings .warn ("get_y method is deprecated, use `y` property instead" , DeprecationWarning , stacklevel = 2 )
223
+ return self .y
224
+
159
225
@property
160
226
def y (self ) -> int :
161
227
"""Gets the y coordinate of the client window.
@@ -178,7 +244,7 @@ def y(self, value) -> None:
178
244
179
245
@property
180
246
def active (self ):
181
- """Gets the Window Status
247
+ """Gets the Window Status.
182
248
183
249
Returns:
184
250
-------
@@ -188,7 +254,7 @@ def active(self):
188
254
189
255
@active .setter
190
256
def active (self , value ) -> None :
191
- """Sets the Window Status
257
+ """Sets the Window Status.
192
258
193
259
Returns: None
194
260
"""
@@ -229,9 +295,7 @@ def from_dict(cls, data: dict) -> "ClientWindowInfo":
229
295
230
296
231
297
class Browser :
232
- """
233
- BiDi implementation of the browser module.
234
- """
298
+ """BiDi implementation of the browser module."""
235
299
236
300
def __init__ (self , conn ):
237
301
self .conn = conn
0 commit comments