From 2bd77c7d3db6323f2e4867e96e9dce3832bee6c8 Mon Sep 17 00:00:00 2001
From: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Date: Fri, 24 Sep 2021 13:22:07 +0530
Subject: [PATCH 001/567] chore: bump dev deps (#918)
---
.pre-commit-config.yaml | 8 ++++++--
local-requirements.txt | 12 ++++++------
pyproject.toml | 2 +-
setup.py | 2 +-
tests/async/test_click.py | 8 ++++----
tests/async/test_element_handle.py | 4 ++--
tests/async/test_frames.py | 4 ++--
tests/async/test_network.py | 2 +-
8 files changed, 23 insertions(+), 19 deletions(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index ce1f3afa4..0c2622ecc 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -9,8 +9,12 @@ repos:
- id: check-yaml
- id: check-toml
- id: requirements-txt-fixer
+ - id: check-ast
+ - id: check-builtin-literals
+ - id: check-executables-have-shebangs
+ - id: check-merge-conflict
- repo: https://github.com/psf/black
- rev: 21.8b0
+ rev: 21.9b0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
@@ -18,7 +22,7 @@ repos:
hooks:
- id: mypy
additional_dependencies: [types-pyOpenSSL==20.0.6]
- - repo: https://gitlab.com/pycqa/flake8
+ - repo: https://github.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
diff --git a/local-requirements.txt b/local-requirements.txt
index 3de72ebda..fda010b56 100644
--- a/local-requirements.txt
+++ b/local-requirements.txt
@@ -1,24 +1,24 @@
-auditwheel==4.0.0
+auditwheel==5.0.0
autobahn==21.3.1
-black==21.8b0
+black==21.9b0
flake8==3.9.2
flaky==3.7.0
mypy==0.910
objgraph==3.5.0
Pillow==8.3.2
pixelmatch==0.2.3
-pre-commit==2.14.1
+pre-commit==2.15.0
pyOpenSSL==20.0.1
-pytest==6.2.4
+pytest==6.2.5
pytest-asyncio==0.15.1
pytest-cov==2.12.1
pytest-repeat==0.9.1
pytest-sugar==0.9.4
pytest-timeout==1.4.2
-pytest-xdist==2.3.0
+pytest-xdist==2.4.0
requests==2.26.0
service_identity==21.1.0
-setuptools==57.4.0
+setuptools==58.1.0
twine==3.4.2
twisted==21.7.0
types-pyOpenSSL==20.0.6
diff --git a/pyproject.toml b/pyproject.toml
index 207fd5f80..03d96e3ac 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,3 +1,3 @@
[build-system]
-requires = ["setuptools-scm==6.0.1", "wheel==0.37.0", "auditwheel==4.0.0"]
+requires = ["setuptools-scm==6.3.2", "wheel==0.37.0", "auditwheel==5.0.0"]
build-backend = "setuptools.build_meta"
diff --git a/setup.py b/setup.py
index 24a4771b7..8f67c47f0 100644
--- a/setup.py
+++ b/setup.py
@@ -164,7 +164,7 @@ def run(self) -> None:
"write_to": "playwright/_repo_version.py",
"write_to_template": 'version = "{version}"\n',
},
- setup_requires=["setuptools_scm==6.0.1", "wheel==0.37.0"],
+ setup_requires=["setuptools-scm==6.3.2", "wheel==0.37.0"],
entry_points={
"console_scripts": [
"playwright=playwright.__main__:main",
diff --git a/tests/async/test_click.py b/tests/async/test_click.py
index a674e8453..a34753050 100644
--- a/tests/async/test_click.py
+++ b/tests/async/test_click.py
@@ -181,7 +181,7 @@ async def test_wait_with_force(page, server):
async def test_wait_for_display_none_to_be_gone(page, server):
- done = list()
+ done = []
await page.goto(server.PREFIX + "/input/button.html")
await page.eval_on_selector("button", "b => b.style.display = 'none'")
@@ -200,7 +200,7 @@ async def click():
async def test_wait_for_visibility_hidden_to_be_gone(page, server):
- done = list()
+ done = []
await page.goto(server.PREFIX + "/input/button.html")
await page.eval_on_selector("button", "b => b.style.visibility = 'hidden'")
@@ -243,7 +243,7 @@ async def test_timeout_waiting_for_visbility_hidden_to_be_gone(page, server):
async def test_waitFor_visible_when_parent_is_hidden(page, server):
- done = list()
+ done = []
await page.goto(server.PREFIX + "/input/button.html")
await page.eval_on_selector("button", "b => b.parentElement.style.display = 'none'")
@@ -626,7 +626,7 @@ async def test_wait_for_button_to_be_enabled(page, server):
await page.set_content(
''
)
- done = list()
+ done = []
async def click():
await page.click("text=Click target")
diff --git a/tests/async/test_element_handle.py b/tests/async/test_element_handle.py
index 1fbb1f415..6f016173f 100644
--- a/tests/async/test_element_handle.py
+++ b/tests/async/test_element_handle.py
@@ -381,7 +381,7 @@ async def test_scroll_should_throw_for_detached_element(page, server):
async def waiting_helper(page, after):
div = await page.query_selector("div")
- done = list()
+ done = []
async def scroll():
done.append(False)
@@ -496,7 +496,7 @@ async def test_select_text_wait_for_visible(page, server):
textarea = await page.query_selector("textarea")
await textarea.evaluate('textarea => textarea.value = "some value"')
await textarea.evaluate('e => e.style.display = "none"')
- done = list()
+ done = []
async def select_text():
done.append(False)
diff --git a/tests/async/test_frames.py b/tests/async/test_frames.py
index 633b74d87..1a39f875e 100644
--- a/tests/async/test_frames.py
+++ b/tests/async/test_frames.py
@@ -127,7 +127,7 @@ async def test_should_send_events_when_frames_are_manipulated_dynamically(
assert navigated_frames[0].url == server.EMPTY_PAGE
# validate framedetached events
- detached_frames = list()
+ detached_frames = []
page.on("framedetached", lambda frame: detached_frames.append(frame))
await utils.detach_frame(page, "frame1")
assert len(detached_frames) == 1
@@ -149,7 +149,7 @@ async def test_persist_main_frame_on_cross_process_navigation(page, server):
async def test_should_not_send_attach_detach_events_for_main_frame(page, server):
- has_events = list()
+ has_events = []
page.on("frameattached", lambda frame: has_events.append(True))
page.on("framedetached", lambda frame: has_events.append(True))
await page.goto(server.EMPTY_PAGE)
diff --git a/tests/async/test_network.py b/tests/async/test_network.py
index 2d94c2203..1574c9063 100644
--- a/tests/async/test_network.py
+++ b/tests/async/test_network.py
@@ -60,7 +60,7 @@ async def handle_request(route, request, intercepted):
intercepted.append(True)
await route.continue_()
- intercepted = list()
+ intercepted = []
await page.route(
"**/*",
lambda route, request: asyncio.create_task(
From a385b00a0e258e9fd7c618c05b2e3bc4cf1fb799 Mon Sep 17 00:00:00 2001
From: Max Schmitt
Date: Mon, 27 Sep 2021 12:53:16 +0200
Subject: [PATCH 002/567] feat(roll): roll Playwright 1.16.0-next-1632717011000
(#919)
---
README.md | 2 +-
playwright/_impl/_frame.py | 2 +-
playwright/async_api/_generated.py | 28 ++++++++++++++++++----------
playwright/sync_api/_generated.py | 28 ++++++++++++++++++----------
setup.py | 2 +-
tests/async/test_element_handle.py | 4 ++--
tests/async/test_page.py | 2 +-
tests/sync/test_element_handle.py | 4 ++--
8 files changed, 44 insertions(+), 28 deletions(-)
diff --git a/README.md b/README.md
index 7e68ef8cc..b3ce572b8 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 96.0.4641.0 | ✅ | ✅ | ✅ |
+| Chromium 96.0.4652.0 | ✅ | ✅ | ✅ |
| WebKit 15.0 | ✅ | ✅ | ✅ |
| Firefox 92.0 | ✅ | ✅ | ✅ |
diff --git a/playwright/_impl/_frame.py b/playwright/_impl/_frame.py
index f127a206b..8854f91d6 100644
--- a/playwright/_impl/_frame.py
+++ b/playwright/_impl/_frame.py
@@ -634,7 +634,7 @@ async def uncheck(
await self._channel.send("uncheck", locals_to_params(locals()))
async def wait_for_timeout(self, timeout: float) -> None:
- await self._connection._loop.create_task(asyncio.sleep(timeout / 1000))
+ await self._channel.send("waitForTimeout", locals_to_params(locals()))
async def wait_for_function(
self,
diff --git a/playwright/async_api/_generated.py b/playwright/async_api/_generated.py
index e6a347e91..9b760c1b9 100644
--- a/playwright/async_api/_generated.py
+++ b/playwright/async_api/_generated.py
@@ -3104,7 +3104,9 @@ def expect_navigation(
Parameters
----------
url : Union[Callable[[str], bool], Pattern, str, NoneType]
- A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation.
+ A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the
+ parameter is a string without wilcard characters, the method will wait for navigation to URL that is exactly equal to
+ the string.
wait_until : Union["domcontentloaded", "load", "networkidle", NoneType]
When to consider operation succeeded, defaults to `load`. Events can be either:
- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
@@ -3146,7 +3148,9 @@ async def wait_for_url(
Parameters
----------
url : Union[Callable[[str], bool], Pattern, str]
- A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation.
+ A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the
+ parameter is a string without wilcard characters, the method will wait for navigation to URL that is exactly equal to
+ the string.
wait_until : Union["domcontentloaded", "load", "networkidle", NoneType]
When to consider operation succeeded, defaults to `load`. Events can be either:
- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
@@ -7430,7 +7434,9 @@ async def wait_for_url(
Parameters
----------
url : Union[Callable[[str], bool], Pattern, str]
- A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation.
+ A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the
+ parameter is a string without wilcard characters, the method will wait for navigation to URL that is exactly equal to
+ the string.
wait_until : Union["domcontentloaded", "load", "networkidle", NoneType]
When to consider operation succeeded, defaults to `load`. Events can be either:
- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
@@ -9398,7 +9404,9 @@ def expect_navigation(
Parameters
----------
url : Union[Callable[[str], bool], Pattern, str, NoneType]
- A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation.
+ A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the
+ parameter is a string without wilcard characters, the method will wait for navigation to URL that is exactly equal to
+ the string.
wait_until : Union["domcontentloaded", "load", "networkidle", NoneType]
When to consider operation succeeded, defaults to `load`. Events can be either:
- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
@@ -10872,7 +10880,7 @@ async def new_context(
no_viewport : Union[bool, NoneType]
Does not enforce fixed viewport, allows resizing window in the headed mode.
ignore_https_errors : Union[bool, NoneType]
- Whether to ignore HTTPS errors during navigation. Defaults to `false`.
+ Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
java_script_enabled : Union[bool, NoneType]
Whether or not to enable JavaScript in the context. Defaults to `true`.
bypass_csp : Union[bool, NoneType]
@@ -10891,7 +10899,7 @@ async def new_context(
A list of permissions to grant to all pages in this context. See `browser_context.grant_permissions()` for more
details.
extra_http_headers : Union[Dict[str, str], NoneType]
- An object containing additional HTTP headers to be sent with every request. All header values must be strings.
+ An object containing additional HTTP headers to be sent with every request.
offline : Union[bool, NoneType]
Whether to emulate network being offline. Defaults to `false`.
http_credentials : Union[{username: str, password: str}, NoneType]
@@ -11046,7 +11054,7 @@ async def new_page(
no_viewport : Union[bool, NoneType]
Does not enforce fixed viewport, allows resizing window in the headed mode.
ignore_https_errors : Union[bool, NoneType]
- Whether to ignore HTTPS errors during navigation. Defaults to `false`.
+ Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
java_script_enabled : Union[bool, NoneType]
Whether or not to enable JavaScript in the context. Defaults to `true`.
bypass_csp : Union[bool, NoneType]
@@ -11065,7 +11073,7 @@ async def new_page(
A list of permissions to grant to all pages in this context. See `browser_context.grant_permissions()` for more
details.
extra_http_headers : Union[Dict[str, str], NoneType]
- An object containing additional HTTP headers to be sent with every request. All header values must be strings.
+ An object containing additional HTTP headers to be sent with every request.
offline : Union[bool, NoneType]
Whether to emulate network being offline. Defaults to `false`.
http_credentials : Union[{username: str, password: str}, NoneType]
@@ -11539,7 +11547,7 @@ async def launch_persistent_context(
no_viewport : Union[bool, NoneType]
Does not enforce fixed viewport, allows resizing window in the headed mode.
ignore_https_errors : Union[bool, NoneType]
- Whether to ignore HTTPS errors during navigation. Defaults to `false`.
+ Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
java_script_enabled : Union[bool, NoneType]
Whether or not to enable JavaScript in the context. Defaults to `true`.
bypass_csp : Union[bool, NoneType]
@@ -11558,7 +11566,7 @@ async def launch_persistent_context(
A list of permissions to grant to all pages in this context. See `browser_context.grant_permissions()` for more
details.
extra_http_headers : Union[Dict[str, str], NoneType]
- An object containing additional HTTP headers to be sent with every request. All header values must be strings.
+ An object containing additional HTTP headers to be sent with every request.
offline : Union[bool, NoneType]
Whether to emulate network being offline. Defaults to `false`.
http_credentials : Union[{username: str, password: str}, NoneType]
diff --git a/playwright/sync_api/_generated.py b/playwright/sync_api/_generated.py
index 6edc4a557..b1b141229 100644
--- a/playwright/sync_api/_generated.py
+++ b/playwright/sync_api/_generated.py
@@ -3053,7 +3053,9 @@ def expect_navigation(
Parameters
----------
url : Union[Callable[[str], bool], Pattern, str, NoneType]
- A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation.
+ A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the
+ parameter is a string without wilcard characters, the method will wait for navigation to URL that is exactly equal to
+ the string.
wait_until : Union["domcontentloaded", "load", "networkidle", NoneType]
When to consider operation succeeded, defaults to `load`. Events can be either:
- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
@@ -3095,7 +3097,9 @@ def wait_for_url(
Parameters
----------
url : Union[Callable[[str], bool], Pattern, str]
- A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation.
+ A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the
+ parameter is a string without wilcard characters, the method will wait for navigation to URL that is exactly equal to
+ the string.
wait_until : Union["domcontentloaded", "load", "networkidle", NoneType]
When to consider operation succeeded, defaults to `load`. Events can be either:
- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
@@ -7246,7 +7250,9 @@ def wait_for_url(
Parameters
----------
url : Union[Callable[[str], bool], Pattern, str]
- A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation.
+ A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the
+ parameter is a string without wilcard characters, the method will wait for navigation to URL that is exactly equal to
+ the string.
wait_until : Union["domcontentloaded", "load", "networkidle", NoneType]
When to consider operation succeeded, defaults to `load`. Events can be either:
- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
@@ -9206,7 +9212,9 @@ def expect_navigation(
Parameters
----------
url : Union[Callable[[str], bool], Pattern, str, NoneType]
- A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation.
+ A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the
+ parameter is a string without wilcard characters, the method will wait for navigation to URL that is exactly equal to
+ the string.
wait_until : Union["domcontentloaded", "load", "networkidle", NoneType]
When to consider operation succeeded, defaults to `load`. Events can be either:
- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
@@ -10619,7 +10627,7 @@ def new_context(
no_viewport : Union[bool, NoneType]
Does not enforce fixed viewport, allows resizing window in the headed mode.
ignore_https_errors : Union[bool, NoneType]
- Whether to ignore HTTPS errors during navigation. Defaults to `false`.
+ Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
java_script_enabled : Union[bool, NoneType]
Whether or not to enable JavaScript in the context. Defaults to `true`.
bypass_csp : Union[bool, NoneType]
@@ -10638,7 +10646,7 @@ def new_context(
A list of permissions to grant to all pages in this context. See `browser_context.grant_permissions()` for more
details.
extra_http_headers : Union[Dict[str, str], NoneType]
- An object containing additional HTTP headers to be sent with every request. All header values must be strings.
+ An object containing additional HTTP headers to be sent with every request.
offline : Union[bool, NoneType]
Whether to emulate network being offline. Defaults to `false`.
http_credentials : Union[{username: str, password: str}, NoneType]
@@ -10793,7 +10801,7 @@ def new_page(
no_viewport : Union[bool, NoneType]
Does not enforce fixed viewport, allows resizing window in the headed mode.
ignore_https_errors : Union[bool, NoneType]
- Whether to ignore HTTPS errors during navigation. Defaults to `false`.
+ Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
java_script_enabled : Union[bool, NoneType]
Whether or not to enable JavaScript in the context. Defaults to `true`.
bypass_csp : Union[bool, NoneType]
@@ -10812,7 +10820,7 @@ def new_page(
A list of permissions to grant to all pages in this context. See `browser_context.grant_permissions()` for more
details.
extra_http_headers : Union[Dict[str, str], NoneType]
- An object containing additional HTTP headers to be sent with every request. All header values must be strings.
+ An object containing additional HTTP headers to be sent with every request.
offline : Union[bool, NoneType]
Whether to emulate network being offline. Defaults to `false`.
http_credentials : Union[{username: str, password: str}, NoneType]
@@ -11286,7 +11294,7 @@ def launch_persistent_context(
no_viewport : Union[bool, NoneType]
Does not enforce fixed viewport, allows resizing window in the headed mode.
ignore_https_errors : Union[bool, NoneType]
- Whether to ignore HTTPS errors during navigation. Defaults to `false`.
+ Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
java_script_enabled : Union[bool, NoneType]
Whether or not to enable JavaScript in the context. Defaults to `true`.
bypass_csp : Union[bool, NoneType]
@@ -11305,7 +11313,7 @@ def launch_persistent_context(
A list of permissions to grant to all pages in this context. See `browser_context.grant_permissions()` for more
details.
extra_http_headers : Union[Dict[str, str], NoneType]
- An object containing additional HTTP headers to be sent with every request. All header values must be strings.
+ An object containing additional HTTP headers to be sent with every request.
offline : Union[bool, NoneType]
Whether to emulate network being offline. Defaults to `false`.
http_credentials : Union[{username: str, password: str}, NoneType]
diff --git a/setup.py b/setup.py
index 8f67c47f0..f10a5343b 100644
--- a/setup.py
+++ b/setup.py
@@ -28,7 +28,7 @@
InWheel = None
from wheel.bdist_wheel import bdist_wheel as BDistWheelCommand
-driver_version = "1.16.0-next-1631799458000"
+driver_version = "1.16.0-next-1632717011000"
def extractall(zip: zipfile.ZipFile, path: str) -> None:
diff --git a/tests/async/test_element_handle.py b/tests/async/test_element_handle.py
index 6f016173f..c0408762b 100644
--- a/tests/async/test_element_handle.py
+++ b/tests/async/test_element_handle.py
@@ -551,12 +551,12 @@ async def test_inner_text_should_throw(page, server):
await page.set_content("")
with pytest.raises(Error) as exc_info1:
await page.inner_text("svg")
- assert "Not an HTMLElement" in exc_info1.value.message
+ assert " Node is not an HTMLElement" in exc_info1.value.message
handle = await page.query_selector("svg")
with pytest.raises(Error) as exc_info2:
await handle.inner_text()
- assert "Not an HTMLElement" in exc_info2.value.message
+ assert " Node is not an HTMLElement" in exc_info2.value.message
async def test_text_content(page, server):
diff --git a/tests/async/test_page.py b/tests/async/test_page.py
index 6d3a2f911..26d81d94e 100644
--- a/tests/async/test_page.py
+++ b/tests/async/test_page.py
@@ -845,7 +845,7 @@ async def test_select_option_should_throw_when_element_is_not_a__select_(page, s
await page.goto(server.PREFIX + "/input/select.html")
with pytest.raises(Error) as exc_info:
await page.select_option("body", "")
- assert "Element is not a