From 4d69bdb177ab428410203f8befc628ef4eda4952 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Wed, 27 Apr 2022 16:06:57 +0200 Subject: [PATCH 001/461] chore(roll): roll Playwright to 1.22.0-alpha-apr-27-2022 (#1273) --- README.md | 2 +- playwright/_impl/_locator.py | 12 ++++ playwright/async_api/_generated.py | 100 +++++++++++++++++++++++------ playwright/sync_api/_generated.py | 100 +++++++++++++++++++++++------ setup.py | 2 +- tests/async/test_element_handle.py | 12 ++-- tests/async/test_locators.py | 30 +++++++++ tests/sync/test_element_handle.py | 2 +- tests/sync/test_locators.py | 28 ++++++++ 9 files changed, 242 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index 0aceff725..477449ed2 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Playwright is a Python library to automate [Chromium](https://www.chromium.org/H | | Linux | macOS | Windows | | :--- | :---: | :---: | :---: | -| Chromium 101.0.4951.15 | ✅ | ✅ | ✅ | +| Chromium 101.0.4951.41 | ✅ | ✅ | ✅ | | WebKit 15.4 | ✅ | ✅ | ✅ | | Firefox 98.0.2 | ✅ | ✅ | ✅ | diff --git a/playwright/_impl/_locator.py b/playwright/_impl/_locator.py index 308c88d64..23f2c16e1 100644 --- a/playwright/_impl/_locator.py +++ b/playwright/_impl/_locator.py @@ -236,6 +236,18 @@ def last(self) -> "Locator": def nth(self, index: int) -> "Locator": return Locator(self._frame, f"{self._selector} >> nth={index}") + def that( + self, + has_text: Union[str, Pattern] = None, + has: "Locator" = None, + ) -> "Locator": + return Locator( + self._frame, + self._selector, + has_text=has_text, + has=has, + ) + async def focus(self, timeout: float = None) -> None: params = locals_to_params(locals()) return await self._frame.focus(self._selector, strict=True, **params) diff --git a/playwright/async_api/_generated.py b/playwright/async_api/_generated.py index 9eab125e9..485c0a8f7 100644 --- a/playwright/async_api/_generated.py +++ b/playwright/async_api/_generated.py @@ -2126,6 +2126,10 @@ async def select_text( This method waits for [actionability](https://playwright.dev/python/docs/actionability) checks, then focuses the element and selects all its text content. + If the element is inside the `