Skip to content

Commit a63f0ef

Browse files
committed
chore: add missing methods and use a set for it
1 parent 4d367d9 commit a63f0ef

File tree

6 files changed

+27
-1
lines changed

6 files changed

+27
-1
lines changed

playwright/async_api.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,15 @@ class ElementHandle(JSHandle):
810810
def __init__(self, obj: ElementHandleImpl):
811811
super().__init__(obj)
812812

813+
def toString(self) -> str:
814+
"""ElementHandle.toString
815+
816+
Returns
817+
-------
818+
str
819+
"""
820+
return mapping.from_maybe_impl(self._impl_obj.toString())
821+
813822
def asElement(self) -> typing.Union["ElementHandle", NoneType]:
814823
"""ElementHandle.asElement
815824

playwright/element_handle.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ def __init__(
5151
) -> None:
5252
super().__init__(parent, type, guid, initializer)
5353

54+
def toString(self) -> str:
55+
return self._preview
56+
5457
def asElement(self) -> Optional["ElementHandle"]:
5558
return self
5659

playwright/sync_api.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,15 @@ class ElementHandle(JSHandle):
830830
def __init__(self, obj: ElementHandleImpl):
831831
super().__init__(obj)
832832

833+
def toString(self) -> str:
834+
"""ElementHandle.toString
835+
836+
Returns
837+
-------
838+
str
839+
"""
840+
return mapping.from_maybe_impl(self._impl_obj.toString())
841+
833842
def asElement(self) -> typing.Union["ElementHandle", NoneType]:
834843
"""ElementHandle.asElement
835844

scripts/documentation_provider.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ def rewrite_param_name(self, fqname: str, method_name: str, name: str) -> str:
371371
return name
372372

373373
def print_remainder(self) -> None:
374+
remainders = set()
374375
for [class_name, value] in self.api.items():
375376
class_name = re.sub(r"Chromium(.*)", r"\1", class_name)
376377
class_name = re.sub(r"WebKit(.*)", r"\1", class_name)
@@ -380,7 +381,9 @@ def print_remainder(self) -> None:
380381
continue
381382
entry = f"{class_name}.{method_name}"
382383
if entry not in self.printed_entries:
383-
print(f"Method not implemented: {entry}", file=stderr)
384+
remainders.add(f"Method not implemented: {entry}")
385+
for remainder in remainders:
386+
print(remainder, file=stderr)
384387

385388

386389
if __name__ == "__main__":

scripts/generate_async_api.py

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python
12
# Copyright (c) Microsoft Corporation.
23
#
34
# Licensed under the Apache License, Version 2.0 (the "License");

scripts/generate_sync_api.py

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python
12
# Copyright (c) Microsoft Corporation.
23
#
34
# Licensed under the Apache License, Version 2.0 (the "License");

0 commit comments

Comments
 (0)