Skip to content

Commit 1fe6d27

Browse files
authored
[py][bidi]: add timestamp to HistoryUpdatedParams class (SeleniumHQ#15892)
add `timestamp` to `HistoryUpdatedParams` class
1 parent a11b6d6 commit 1fe6d27

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

py/selenium/webdriver/common/bidi/browsing_context.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,11 @@ class HistoryUpdatedParams:
335335
def __init__(
336336
self,
337337
context: str,
338+
timestamp: int,
338339
url: str,
339340
):
340341
self.context = context
342+
self.timestamp = timestamp
341343
self.url = url
342344

343345
@classmethod
@@ -356,12 +358,17 @@ def from_json(cls, json: dict) -> "HistoryUpdatedParams":
356358
if context is None or not isinstance(context, str):
357359
raise ValueError("context is required and must be a string")
358360

361+
timestamp = json.get("timestamp")
362+
if timestamp is None or not isinstance(timestamp, int) or timestamp < 0:
363+
raise ValueError("timestamp is required and must be a non-negative integer")
364+
359365
url = json.get("url")
360366
if url is None or not isinstance(url, str):
361367
raise ValueError("url is required and must be a string")
362368

363369
return cls(
364370
context=context,
371+
timestamp=timestamp,
365372
url=url,
366373
)
367374

0 commit comments

Comments
 (0)