Skip to content

Commit 827d79a

Browse files
authored
chore(roll): roll Playwright to 1.33.0-beta-1682447195000 (#1880)
1 parent f3817af commit 827d79a

File tree

11 files changed

+197
-74
lines changed

11 files changed

+197
-74
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Playwright is a Python library to automate [Chromium](https://www.chromium.org/H
44

55
| | Linux | macOS | Windows |
66
| :--- | :---: | :---: | :---: |
7-
| Chromium <!-- GEN:chromium-version -->113.0.5672.24<!-- GEN:stop --> ||||
7+
| Chromium <!-- GEN:chromium-version -->113.0.5672.53<!-- GEN:stop --> ||||
88
| WebKit <!-- GEN:webkit-version -->16.4<!-- GEN:stop --> ||||
9-
| Firefox <!-- GEN:firefox-version -->111.0<!-- GEN:stop --> ||||
9+
| Firefox <!-- GEN:firefox-version -->112.0<!-- GEN:stop --> ||||
1010

1111
## Documentation
1212

playwright/_impl/_network.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,10 +366,17 @@ async def fetch(
366366
headers: Dict[str, str] = None,
367367
postData: Union[Any, str, bytes] = None,
368368
maxRedirects: int = None,
369+
timeout: float = None,
369370
) -> "APIResponse":
370371
page = self.request.frame._page
371372
return await page.context.request._inner_fetch(
372-
self.request, url, method, headers, postData, maxRedirects=maxRedirects
373+
self.request,
374+
url,
375+
method,
376+
headers,
377+
postData,
378+
maxRedirects=maxRedirects,
379+
timeout=timeout,
373380
)
374381

375382
async def fallback(

playwright/_impl/_stream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def __init__(
2828
async def save_as(self, path: Union[str, Path]) -> None:
2929
file = await self._loop.run_in_executor(None, lambda: open(path, "wb"))
3030
while True:
31-
binary = await self._channel.send("read")
31+
binary = await self._channel.send("read", {"size": 1024 * 1024})
3232
if not binary:
3333
break
3434
await self._loop.run_in_executor(

playwright/async_api/_generated.py

Lines changed: 55 additions & 28 deletions
Large diffs are not rendered by default.

playwright/sync_api/_generated.py

Lines changed: 55 additions & 28 deletions
Large diffs are not rendered by default.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
InWheel = None
3131
from wheel.bdist_wheel import bdist_wheel as BDistWheelCommand
3232

33-
driver_version = "1.33.0-alpha-apr-12-2023"
33+
driver_version = "1.33.0-beta-1682447195000"
3434

3535

3636
def extractall(zip: zipfile.ZipFile, path: str) -> None:

tests/async/test_click.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -482,15 +482,15 @@ async def test_click_the_button_with_offset_with_page_scale(
482482

483483
await page.click("button", position={"x": 20, "y": 10})
484484
assert await page.evaluate("result") == "Clicked"
485-
expected = {"x": 28, "y": 18}
486-
if is_webkit:
487-
# WebKit rounds up during css -> dip -> css conversion.
488-
expected = {"x": 26, "y": 17}
489-
elif is_chromium:
490-
# Chromium rounds down during css -> dip -> css conversion.
491-
expected = {"x": 27, "y": 18}
492-
assert await page.evaluate("pageX") == expected["x"]
493-
assert await page.evaluate("pageY") == expected["y"]
485+
486+
def _assert_close_to(expected: int, actual: int) -> None:
487+
if abs(expected - actual) > 2:
488+
raise AssertionError(f"Expected: {expected}, received: {actual}")
489+
490+
# Expect 20;10 + 8px of border in each direction. Allow some delta as different
491+
# browsers round up or down differently during css -> dip -> css conversion.
492+
_assert_close_to(28, await page.evaluate("pageX"))
493+
_assert_close_to(18, await page.evaluate("pageY"))
494494
await context.close()
495495

496496

@@ -676,7 +676,15 @@ async def click():
676676

677677
async def test_wait_for_select_to_be_enabled(page, server):
678678
await page.set_content(
679-
'<select onclick="javascript:window.__CLICKED=true;" disabled><option selected>Hello</option></select>'
679+
"""
680+
<select disabled><option selected>Hello</option></select>
681+
<script>
682+
document.querySelector('select').addEventListener('mousedown', event => {
683+
window.__CLICKED=true;
684+
event.preventDefault();
685+
});
686+
</script>
687+
"""
680688
)
681689
done = []
682690

tests/async/test_navigation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -918,9 +918,9 @@ async def test_frame_goto_should_continue_after_client_redirect(page, server):
918918
url = server.PREFIX + "/frames/child-redirect.html"
919919

920920
with pytest.raises(Error) as exc_info:
921-
await page.goto(url, timeout=2500, wait_until="networkidle")
921+
await page.goto(url, timeout=5000, wait_until="networkidle")
922922

923-
assert "Timeout 2500ms exceeded." in exc_info.value.message
923+
assert "Timeout 5000ms exceeded." in exc_info.value.message
924924
assert (
925925
f'navigating to "{url}", waiting until "networkidle"' in exc_info.value.message
926926
)

tests/async/test_page_request_intercept.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,33 @@
1414

1515
import asyncio
1616

17+
import pytest
18+
1719
from playwright.async_api import Page, Route
1820
from tests.server import Server
1921

2022

23+
async def test_should_support_timeout_option_in_route_fetch(server: Server, page: Page):
24+
server.set_route(
25+
"/slow",
26+
lambda request: (
27+
request.responseHeaders.addRawHeader("Content-Length", "4096"),
28+
request.responseHeaders.addRawHeader("Content-Type", "text/html"),
29+
request.write(b""),
30+
),
31+
)
32+
33+
async def handle(route: Route):
34+
with pytest.raises(Exception) as error:
35+
await route.fetch(timeout=1000)
36+
assert "Request timed out after 1000ms" in error.value.message
37+
38+
await page.route("**/*", lambda route: handle(route))
39+
with pytest.raises(Exception) as error:
40+
await page.goto(server.PREFIX + "/slow", timeout=2000)
41+
assert "Timeout 2000ms exceeded" in error.value.message
42+
43+
2144
async def test_should_not_follow_redirects_when_max_redirects_is_set_to_0_in_route_fetch(
2245
server: Server, page: Page
2346
):

tests/async/test_worker.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ async def test_workers_should_clear_upon_cross_process_navigation(server, page):
137137
assert len(page.workers) == 0
138138

139139

140+
@pytest.mark.skip_browser(
141+
"firefox"
142+
) # https://github.com/microsoft/playwright/issues/21760
140143
async def test_workers_should_report_network_activity(page, server):
141144
async with page.expect_worker() as worker_info:
142145
await page.goto(server.PREFIX + "/worker/worker.html")
@@ -155,6 +158,9 @@ async def test_workers_should_report_network_activity(page, server):
155158
assert response.ok
156159

157160

161+
@pytest.mark.skip_browser(
162+
"firefox"
163+
) # https://github.com/microsoft/playwright/issues/21760
158164
async def test_workers_should_report_network_activity_on_worker_creation(page, server):
159165
# Chromium needs waitForDebugger enabled for this one.
160166
await page.goto(server.EMPTY_PAGE)

0 commit comments

Comments
 (0)