Skip to content

Commit c55f262

Browse files
authored
chore: roll Playwright to 1.4.2 (#200)
1 parent 541588c commit c55f262

10 files changed

+1377
-382
lines changed

Diff for: api.json

+642-133
Large diffs are not rendered by default.

Diff for: driver/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"license": "Apache-2.0",
1515
"dependencies": {
16-
"playwright": "1.4.0"
16+
"playwright": "1.4.2"
1717
},
1818
"devDependencies": {
1919
"pkg": "^4.4.9"

Diff for: playwright/async_api.py

+289-98
Large diffs are not rendered by default.

Diff for: playwright/element_handle.py

+18-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ async def boundingBox(self) -> Optional[FloatRect]:
180180
async def screenshot(
181181
self,
182182
timeout: int = None,
183-
type: Literal["png", "jpeg"] = None,
183+
type: Literal["jpeg", "png"] = None,
184184
path: Union[str, Path] = None,
185185
quality: int = None,
186186
omitBackground: bool = None,
@@ -246,6 +246,23 @@ async def evalOnSelectorAll(
246246
)
247247
)
248248

249+
async def waitForElementState(
250+
self,
251+
state: Literal["disabled", "enabled", "hidden", "stable", "visible"],
252+
timeout: int = None,
253+
) -> None:
254+
await self._channel.send("waitForElementState", locals_to_params(locals()))
255+
256+
async def waitForSelector(
257+
self,
258+
selector: str,
259+
state: Literal["attached", "detached", "hidden", "visible"] = None,
260+
timeout: int = None,
261+
) -> Optional["ElementHandle"]:
262+
return from_nullable_channel(
263+
await self._channel.send("waitForSelector", locals_to_params(locals()))
264+
)
265+
249266

250267
ValuesToSelect = Union[
251268
str,

Diff for: playwright/frame.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ def _on_frame_navigated(self, event: FrameNavigatedEvent) -> None:
9898
if "error" not in event and hasattr(self, "_page") and self._page:
9999
self._page.emit("framenavigated", self)
100100

101+
def page(self) -> "Page":
102+
return self._page
103+
101104
async def goto(
102105
self,
103106
url: str,
@@ -234,7 +237,7 @@ async def waitForSelector(
234237
self,
235238
selector: str,
236239
timeout: int = None,
237-
state: Literal["attached", "detached", "visible", "hidden"] = None,
240+
state: Literal["attached", "detached", "hidden", "visible"] = None,
238241
) -> Optional[ElementHandle]:
239242
return from_nullable_channel(
240243
await self._channel.send("waitForSelector", locals_to_params(locals()))

Diff for: playwright/helper.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
URLMatch = Union[str, Pattern, Callable[[str], bool]]
4646
RouteHandler = Callable[["Route", "Request"], Any]
4747

48-
ColorScheme = Literal["light", "dark", "no-preference"]
49-
DocumentLoadState = Literal["load", "domcontentloaded", "networkidle"]
48+
ColorScheme = Literal["dark", "light", "no-preference"]
49+
DocumentLoadState = Literal["domcontentloaded", "load", "networkidle"]
5050
KeyboardModifier = Literal["Alt", "Control", "Meta", "Shift"]
51-
MouseButton = Literal["left", "right", "middle"]
51+
MouseButton = Literal["left", "middle", "right"]
5252

5353

5454
class MousePosition(TypedDict):
@@ -69,9 +69,9 @@ class SelectOption(TypedDict):
6969

7070

7171
class ConsoleMessageLocation(TypedDict):
72-
url: Optional[str]
73-
lineNumber: Optional[int]
74-
columnNumber: Optional[int]
72+
url: str
73+
lineNumber: int
74+
columnNumber: int
7575

7676

7777
class ErrorPayload(TypedDict, total=False):

Diff for: playwright/page.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ async def waitForSelector(
313313
self,
314314
selector: str,
315315
timeout: int = None,
316-
state: Literal["attached", "detached", "visible", "hidden"] = None,
316+
state: Literal["attached", "detached", "hidden", "visible"] = None,
317317
) -> Optional[ElementHandle]:
318318
return await self._main_frame.waitForSelector(**locals_to_params(locals()))
319319

@@ -503,7 +503,7 @@ async def goForward(
503503
)
504504

505505
async def emulateMedia(
506-
self, media: Literal["screen", "print"] = None, colorScheme: ColorScheme = None,
506+
self, media: Literal["print", "screen"] = None, colorScheme: ColorScheme = None,
507507
) -> None:
508508
await self._channel.send("emulateMedia", locals_to_params(locals()))
509509

@@ -553,7 +553,7 @@ async def unroute(
553553
async def screenshot(
554554
self,
555555
timeout: int = None,
556-
type: Literal["png", "jpeg"] = None,
556+
type: Literal["jpeg", "png"] = None,
557557
path: Union[str, Path] = None,
558558
quality: int = None,
559559
omitBackground: bool = None,

0 commit comments

Comments
 (0)