Skip to content

feat(roll): roll Playwright 1.4.0 #186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# 🎭 [Playwright](https://github.com/microsoft/playwright) for Python

[![PyPI version](https://badge.fury.io/py/playwright.svg)](https://pypi.python.org/pypi/playwright/) [![PyPI pyversions](https://img.shields.io/pypi/pyversions/playwright.svg)](https://pypi.python.org/pypi/playwright/) [![Join Slack](https://img.shields.io/badge/join-slack-infomational)](https://join.slack.com/t/playwright/shared_invite/enQtOTEyMTUxMzgxMjIwLThjMDUxZmIyNTRiMTJjNjIyMzdmZDA3MTQxZWUwZTFjZjQwNGYxZGM5MzRmNzZlMWI5ZWUyOTkzMjE5Njg1NDg) <!-- GEN:chromium-version-badge -->[![Chromium version](https://img.shields.io/badge/chromium-86.0.4217.0-blue.svg?logo=google-chrome)](https://www.chromium.org/Home)<!-- GEN:stop --> <!-- GEN:firefox-version-badge -->[![Firefox version](https://img.shields.io/badge/firefox-80.0b8-blue.svg?logo=mozilla-firefox)](https://www.mozilla.org/en-US/firefox/new/)<!-- GEN:stop --> [![WebKit version](https://img.shields.io/badge/webkit-14.0-blue.svg?logo=safari)](https://webkit.org/)
[![PyPI version](https://badge.fury.io/py/playwright.svg)](https://pypi.python.org/pypi/playwright/) [![PyPI pyversions](https://img.shields.io/pypi/pyversions/playwright.svg)](https://pypi.python.org/pypi/playwright/) [![Join Slack](https://img.shields.io/badge/join-slack-infomational)](https://join.slack.com/t/playwright/shared_invite/enQtOTEyMTUxMzgxMjIwLThjMDUxZmIyNTRiMTJjNjIyMzdmZDA3MTQxZWUwZTFjZjQwNGYxZGM5MzRmNzZlMWI5ZWUyOTkzMjE5Njg1NDg) <!-- GEN:chromium-version-badge -->[![Chromium version](https://img.shields.io/badge/chromium-86.0.4238.0-blue.svg?logo=google-chrome)](https://www.chromium.org/Home)<!-- GEN:stop --> <!-- GEN:firefox-version-badge -->[![Firefox version](https://img.shields.io/badge/firefox-80.0b8-blue.svg?logo=mozilla-firefox)](https://www.mozilla.org/en-US/firefox/new/)<!-- GEN:stop --> [![WebKit version](https://img.shields.io/badge/webkit-14.0-blue.svg?logo=safari)](https://webkit.org/)

##### [Docs](#documentation) | [API reference](https://playwright.dev/#?path=docs/api.md) | [Docstrings](https://github.com/microsoft/playwright-python/blob/master/playwright/sync_api.py)

Playwright is a Python library to automate [Chromium](https://www.chromium.org/Home), [Firefox](https://www.mozilla.org/en-US/firefox/new/) and [WebKit](https://webkit.org/) with a single API. Playwright is built to enable cross-browser web automation that is **ever-green**, **capable**, **reliable** and **fast**.

| | Linux | macOS | Windows |
| :--- | :---: | :---: | :---: |
| Chromium <!-- GEN:chromium-version -->86.0.4217.0<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| Chromium <!-- GEN:chromium-version -->86.0.4238.0<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| WebKit 14.0 | ✅ | ✅ | ✅ |
| Firefox <!-- GEN:firefox-version -->80.0b8<!-- GEN:stop --> | ✅ | ✅ | ✅ |

Expand Down
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.3.0-next.1599061793983"
"playwright": "1.4.0"
},
"devDependencies": {
"pkg": "^4.4.9"
Expand Down
6 changes: 3 additions & 3 deletions playwright/drivers/browsers.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
"browsers": [
{
"name": "chromium",
"revision": "792639",
"revision": "799411",
"download": true
},
{
"name": "firefox",
"revision": "1167",
"revision": "1171",
"download": true
},
{
"name": "webkit",
"revision": "1334",
"revision": "1343",
"download": true
}
]
Expand Down
3 changes: 3 additions & 0 deletions playwright/element_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ def __init__(
) -> None:
super().__init__(parent, type, guid, initializer)

async def _createSelectorForTest(self, name: str) -> Optional[str]:
return await self._channel.send("createSelectorForTest", dict(name=name))

def toString(self) -> str:
return self._preview

Expand Down
8 changes: 1 addition & 7 deletions playwright/selectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
# limitations under the License.

from pathlib import Path
from typing import Dict, Optional, Union
from typing import Dict, Union

from playwright.connection import ChannelOwner
from playwright.element_handle import ElementHandle
from playwright.helper import Error


Expand All @@ -42,8 +41,3 @@ async def register(
if contentScript:
params["contentScript"] = True
await self._channel.send("register", params)

async def _createSelector(self, name: str, handle: ElementHandle) -> Optional[str]:
return await self._channel.send(
"createSelector", dict(name=name, handle=handle._channel)
)
8 changes: 2 additions & 6 deletions tests/async/test_queryselector.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,8 @@ async def test_selectors_register_should_work(selectors, page: Page, utils):
}""",
)
await page.setContent("<div><span></span></div><div></div>")
assert (
await selectors._impl_obj._createSelector(
"tag", cast(Any, await page.querySelector("div"))._impl_obj
)
== "DIV"
)
element_handle_impl = cast(Any, (await page.querySelector("div")))._impl_obj
assert await element_handle_impl._createSelectorForTest("tag") == "DIV"
assert await page.evalOnSelector("tag=DIV", "e => e.nodeName") == "DIV"
assert await page.evalOnSelector("tag=SPAN", "e => e.nodeName") == "SPAN"
assert await page.evalOnSelectorAll("tag=DIV", "es => es.length") == 2
Expand Down