diff --git a/README.md b/README.md index 5d6464716..8a730e13c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # 🎭 [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) [![Chromium version](https://img.shields.io/badge/chromium-86.0.4217.0-blue.svg?logo=google-chrome)](https://www.chromium.org/Home) [![Firefox version](https://img.shields.io/badge/firefox-80.0b8-blue.svg?logo=mozilla-firefox)](https://www.mozilla.org/en-US/firefox/new/) [![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) [![Chromium version](https://img.shields.io/badge/chromium-86.0.4238.0-blue.svg?logo=google-chrome)](https://www.chromium.org/Home) [![Firefox version](https://img.shields.io/badge/firefox-80.0b8-blue.svg?logo=mozilla-firefox)](https://www.mozilla.org/en-US/firefox/new/) [![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) @@ -8,7 +8,7 @@ Playwright is a Python library to automate [Chromium](https://www.chromium.org/H | | Linux | macOS | Windows | | :--- | :---: | :---: | :---: | -| Chromium 86.0.4217.0 | ✅ | ✅ | ✅ | +| Chromium 86.0.4238.0 | ✅ | ✅ | ✅ | | WebKit 14.0 | ✅ | ✅ | ✅ | | Firefox 80.0b8 | ✅ | ✅ | ✅ | diff --git a/driver/package.json b/driver/package.json index aeb78ebc5..0f4683b1f 100644 --- a/driver/package.json +++ b/driver/package.json @@ -13,7 +13,7 @@ }, "license": "Apache-2.0", "dependencies": { - "playwright": "1.3.0-next.1599061793983" + "playwright": "1.4.0" }, "devDependencies": { "pkg": "^4.4.9" diff --git a/playwright/drivers/browsers.json b/playwright/drivers/browsers.json index cf0eb23a1..23b96f4b2 100644 --- a/playwright/drivers/browsers.json +++ b/playwright/drivers/browsers.json @@ -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 } ] diff --git a/playwright/element_handle.py b/playwright/element_handle.py index e4f8e4364..b6eee4b53 100644 --- a/playwright/element_handle.py +++ b/playwright/element_handle.py @@ -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 diff --git a/playwright/selectors.py b/playwright/selectors.py index 0154ff964..369358d54 100644 --- a/playwright/selectors.py +++ b/playwright/selectors.py @@ -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 @@ -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) - ) diff --git a/tests/async/test_queryselector.py b/tests/async/test_queryselector.py index 563196296..552517c23 100644 --- a/tests/async/test_queryselector.py +++ b/tests/async/test_queryselector.py @@ -23,12 +23,8 @@ async def test_selectors_register_should_work(selectors, page: Page, utils): }""", ) await page.setContent("
") - 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