Skip to content

Commit

Permalink
chore: roll Playwright to 1.4.2 (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelfeldman committed Sep 28, 2020
1 parent 541588c commit c55f262
Show file tree
Hide file tree
Showing 10 changed files with 1,377 additions and 382 deletions.
775 changes: 642 additions & 133 deletions api.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion driver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"license": "Apache-2.0",
"dependencies": {
"playwright": "1.4.0"
"playwright": "1.4.2"
},
"devDependencies": {
"pkg": "^4.4.9"
Expand Down
387 changes: 289 additions & 98 deletions playwright/async_api.py

Large diffs are not rendered by default.

19 changes: 18 additions & 1 deletion playwright/element_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ async def boundingBox(self) -> Optional[FloatRect]:
async def screenshot(
self,
timeout: int = None,
type: Literal["png", "jpeg"] = None,
type: Literal["jpeg", "png"] = None,
path: Union[str, Path] = None,
quality: int = None,
omitBackground: bool = None,
Expand Down Expand Up @@ -246,6 +246,23 @@ async def evalOnSelectorAll(
)
)

async def waitForElementState(
self,
state: Literal["disabled", "enabled", "hidden", "stable", "visible"],
timeout: int = None,
) -> None:
await self._channel.send("waitForElementState", locals_to_params(locals()))

async def waitForSelector(
self,
selector: str,
state: Literal["attached", "detached", "hidden", "visible"] = None,
timeout: int = None,
) -> Optional["ElementHandle"]:
return from_nullable_channel(
await self._channel.send("waitForSelector", locals_to_params(locals()))
)


ValuesToSelect = Union[
str,
Expand Down
5 changes: 4 additions & 1 deletion playwright/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ def _on_frame_navigated(self, event: FrameNavigatedEvent) -> None:
if "error" not in event and hasattr(self, "_page") and self._page:
self._page.emit("framenavigated", self)

def page(self) -> "Page":
return self._page

async def goto(
self,
url: str,
Expand Down Expand Up @@ -234,7 +237,7 @@ async def waitForSelector(
self,
selector: str,
timeout: int = None,
state: Literal["attached", "detached", "visible", "hidden"] = None,
state: Literal["attached", "detached", "hidden", "visible"] = None,
) -> Optional[ElementHandle]:
return from_nullable_channel(
await self._channel.send("waitForSelector", locals_to_params(locals()))
Expand Down
12 changes: 6 additions & 6 deletions playwright/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
URLMatch = Union[str, Pattern, Callable[[str], bool]]
RouteHandler = Callable[["Route", "Request"], Any]

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


class MousePosition(TypedDict):
Expand All @@ -69,9 +69,9 @@ class SelectOption(TypedDict):


class ConsoleMessageLocation(TypedDict):
url: Optional[str]
lineNumber: Optional[int]
columnNumber: Optional[int]
url: str
lineNumber: int
columnNumber: int


class ErrorPayload(TypedDict, total=False):
Expand Down
6 changes: 3 additions & 3 deletions playwright/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ async def waitForSelector(
self,
selector: str,
timeout: int = None,
state: Literal["attached", "detached", "visible", "hidden"] = None,
state: Literal["attached", "detached", "hidden", "visible"] = None,
) -> Optional[ElementHandle]:
return await self._main_frame.waitForSelector(**locals_to_params(locals()))

Expand Down Expand Up @@ -503,7 +503,7 @@ async def goForward(
)

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

Expand Down Expand Up @@ -553,7 +553,7 @@ async def unroute(
async def screenshot(
self,
timeout: int = None,
type: Literal["png", "jpeg"] = None,
type: Literal["jpeg", "png"] = None,
path: Union[str, Path] = None,
quality: int = None,
omitBackground: bool = None,
Expand Down

0 comments on commit c55f262

Please sign in to comment.