Skip to content

Commit 47a5d35

Browse files
Skn0ttclaude
andauthored
chore: roll to 1.58.0 (#3026)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent d3f5438 commit 47a5d35

File tree

10 files changed

+68
-55
lines changed

10 files changed

+68
-55
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: playwright-roll
3+
description: Roll Playwright Python to a new version
4+
---
5+
6+
Help the user roll to a new version of Playwright.
7+
../../../ROLLING.md contains general instructions and scripts.
8+
9+
Start with updating the version and generating the API to see the state of things.
10+
11+
Afterwards, work through the list of changes that need to be backported.
12+
You can find a list of pull requests that might need to be taking into account in the issue titled "Backport changes".
13+
Work through them one-by-one and check off the items that you have handled.
14+
Not all of them will be relevant, some might have partially been reverted, etc. - so feel free to check with the upstream release branch.
15+
16+
Rolling includes:
17+
- updating client implementation to match changes in the upstream JS implementation (see ../playwright/packages/playwright-core/src/client)
18+
- adding a couple of new tests to verify new/changed functionality
19+
20+
## Tips & Tricks
21+
- Project checkouts are in the parent directory (`../`).
22+
- when updating checkboxes, store the issue content into /tmp and edit it there, then update the issue based on the file
23+
- use the "gh" cli to interact with GitHub

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 -->143.0.7499.4<!-- GEN:stop --> ||||
7+
| Chromium <!-- GEN:chromium-version -->145.0.7632.6<!-- GEN:stop --> ||||
88
| WebKit <!-- GEN:webkit-version -->26.0<!-- GEN:stop --> ||||
9-
| Firefox <!-- GEN:firefox-version -->144.0.2<!-- GEN:stop --> ||||
9+
| Firefox <!-- GEN:firefox-version -->146.0.1<!-- GEN:stop --> ||||
1010

1111
## Documentation
1212

playwright/_impl/_browser_type.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ async def launch(
8282
timeout: float = None,
8383
env: Env = None,
8484
headless: bool = None,
85-
devtools: bool = None,
8685
proxy: ProxySettings = None,
8786
downloadsPath: Union[str, Path] = None,
8887
slowMo: float = None,
@@ -118,7 +117,6 @@ async def launch_persistent_context(
118117
timeout: float = None,
119118
env: Env = None,
120119
headless: bool = None,
121-
devtools: bool = None,
122120
proxy: ProxySettings = None,
123121
downloadsPath: Union[str, Path] = None,
124122
slowMo: float = None,
@@ -200,6 +198,7 @@ async def connect_over_cdp(
200198
timeout: float = None,
201199
slowMo: float = None,
202200
headers: Dict[str, str] = None,
201+
isLocal: bool = None,
203202
) -> Browser:
204203
params = locals_to_params(locals())
205204
if params.get("headers"):

playwright/_impl/_console_message.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def type(self) -> Union[
5757
Literal["startGroup"],
5858
Literal["startGroupCollapsed"],
5959
Literal["table"],
60+
Literal["time"],
6061
Literal["timeEnd"],
6162
Literal["trace"],
6263
Literal["warning"],

playwright/async_api/_generated.py

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -946,9 +946,12 @@ async def handle(route, request):
946946
`route.continue_()` will immediately send the request to the network, other matching handlers won't be
947947
invoked. Use `route.fallback()` If you want next matching handler in the chain to be invoked.
948948

949-
**NOTE** The `Cookie` header cannot be overridden using this method. If a value is provided, it will be ignored,
950-
and the cookie will be loaded from the browser's cookie store. To set custom cookies, use
951-
`browser_context.add_cookies()`.
949+
**NOTE** Some request headers are **forbidden** and cannot be overridden (for example, `Cookie`, `Host`,
950+
`Content-Length` and others, see
951+
[this MDN page](https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_request_header) for full list). If an
952+
override is provided for a forbidden header, it will be ignored and the original request header will be used.
953+
954+
To set custom cookies, use `browser_context.add_cookies()`.
952955

953956
Parameters
954957
----------
@@ -7039,6 +7042,7 @@ def type(
70397042
Literal["startGroup"],
70407043
Literal["startGroupCollapsed"],
70417044
Literal["table"],
7045+
Literal["time"],
70427046
Literal["timeEnd"],
70437047
Literal["trace"],
70447048
Literal["warning"],
@@ -7047,7 +7051,7 @@ def type(
70477051

70487052
Returns
70497053
-------
7050-
Union["assert", "clear", "count", "debug", "dir", "dirxml", "endGroup", "error", "info", "log", "profile", "profileEnd", "startGroup", "startGroupCollapsed", "table", "timeEnd", "trace", "warning"]
7054+
Union["assert", "clear", "count", "debug", "dir", "dirxml", "endGroup", "error", "info", "log", "profile", "profileEnd", "startGroup", "startGroupCollapsed", "table", "time", "timeEnd", "trace", "warning"]
70517055
"""
70527056
return mapping.from_maybe_impl(self._impl_obj.type)
70537057

@@ -14440,7 +14444,6 @@ async def launch(
1444014444
timeout: typing.Optional[float] = None,
1444114445
env: typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] = None,
1444214446
headless: typing.Optional[bool] = None,
14443-
devtools: typing.Optional[bool] = None,
1444414447
proxy: typing.Optional[ProxySettings] = None,
1444514448
downloads_path: typing.Optional[typing.Union[pathlib.Path, str]] = None,
1444614449
slow_mo: typing.Optional[float] = None,
@@ -14514,12 +14517,7 @@ async def launch(
1451414517
headless : Union[bool, None]
1451514518
Whether to run browser in headless mode. More details for
1451614519
[Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and
14517-
[Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true` unless the
14518-
`devtools` option is `true`.
14519-
devtools : Union[bool, None]
14520-
**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the
14521-
`headless` option will be set `false`.
14522-
Deprecated: Use [debugging tools](../debug.md) instead.
14520+
[Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true`.
1452314521
proxy : Union[{server: str, bypass: Union[str, None], username: Union[str, None], password: Union[str, None]}, None]
1452414522
Network proxy settings.
1452514523
downloads_path : Union[pathlib.Path, str, None]
@@ -14557,7 +14555,6 @@ async def launch(
1455714555
timeout=timeout,
1455814556
env=mapping.to_impl(env),
1455914557
headless=headless,
14560-
devtools=devtools,
1456114558
proxy=proxy,
1456214559
downloadsPath=downloads_path,
1456314560
slowMo=slow_mo,
@@ -14583,7 +14580,6 @@ async def launch_persistent_context(
1458314580
timeout: typing.Optional[float] = None,
1458414581
env: typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] = None,
1458514582
headless: typing.Optional[bool] = None,
14586-
devtools: typing.Optional[bool] = None,
1458714583
proxy: typing.Optional[ProxySettings] = None,
1458814584
downloads_path: typing.Optional[typing.Union[pathlib.Path, str]] = None,
1458914585
slow_mo: typing.Optional[float] = None,
@@ -14691,12 +14687,7 @@ async def launch_persistent_context(
1469114687
headless : Union[bool, None]
1469214688
Whether to run browser in headless mode. More details for
1469314689
[Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and
14694-
[Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true` unless the
14695-
`devtools` option is `true`.
14696-
devtools : Union[bool, None]
14697-
**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the
14698-
`headless` option will be set `false`.
14699-
Deprecated: Use [debugging tools](../debug.md) instead.
14690+
[Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true`.
1470014691
proxy : Union[{server: str, bypass: Union[str, None], username: Union[str, None], password: Union[str, None]}, None]
1470114692
Network proxy settings.
1470214693
downloads_path : Union[pathlib.Path, str, None]
@@ -14858,7 +14849,6 @@ async def launch_persistent_context(
1485814849
timeout=timeout,
1485914850
env=mapping.to_impl(env),
1486014851
headless=headless,
14861-
devtools=devtools,
1486214852
proxy=proxy,
1486314853
downloadsPath=downloads_path,
1486414854
slowMo=slow_mo,
@@ -14908,6 +14898,7 @@ async def connect_over_cdp(
1490814898
timeout: typing.Optional[float] = None,
1490914899
slow_mo: typing.Optional[float] = None,
1491014900
headers: typing.Optional[typing.Dict[str, str]] = None,
14901+
is_local: typing.Optional[bool] = None,
1491114902
) -> "Browser":
1491214903
"""BrowserType.connect_over_cdp
1491314904

@@ -14942,6 +14933,9 @@ async def connect_over_cdp(
1494214933
on. Defaults to 0.
1494314934
headers : Union[Dict[str, str], None]
1494414935
Additional HTTP headers to be sent with connect request. Optional.
14936+
is_local : Union[bool, None]
14937+
Tells Playwright that it runs on the same host as the CDP server. It will enable certain optimizations that rely
14938+
upon the file system being the same between Playwright and the Browser.
1494514939

1494614940
Returns
1494714941
-------
@@ -14954,6 +14948,7 @@ async def connect_over_cdp(
1495414948
timeout=timeout,
1495514949
slowMo=slow_mo,
1495614950
headers=mapping.to_impl(headers),
14951+
isLocal=is_local,
1495714952
)
1495814953
)
1495914954

@@ -15397,8 +15392,7 @@ def description(self) -> typing.Optional[str]:
1539715392
"""Locator.description
1539815393

1539915394
Returns locator description previously set with `locator.describe()`. Returns `null` if no custom
15400-
description has been set. Prefer `Locator.toString()` for a human-readable representation, as it uses the
15401-
description when available.
15395+
description has been set.
1540215396

1540315397
**Usage**
1540415398

@@ -19176,7 +19170,7 @@ async def to_contain_text(
1917619170
from playwright.async_api import expect
1917719171

1917819172
# ✓ Contains the right items in the right order
19179-
await expect(page.locator(\"ul > li\")).to_contain_text([\"Text 1\", \"Text 3\", \"Text 4\"])
19173+
await expect(page.locator(\"ul > li\")).to_contain_text([\"Text 1\", \"Text 3\"])
1918019174

1918119175
# ✖ Wrong order
1918219176
await expect(page.locator(\"ul > li\")).to_contain_text([\"Text 3\", \"Text 2\"])

playwright/sync_api/_generated.py

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -960,9 +960,12 @@ def handle(route, request):
960960
`route.continue_()` will immediately send the request to the network, other matching handlers won't be
961961
invoked. Use `route.fallback()` If you want next matching handler in the chain to be invoked.
962962

963-
**NOTE** The `Cookie` header cannot be overridden using this method. If a value is provided, it will be ignored,
964-
and the cookie will be loaded from the browser's cookie store. To set custom cookies, use
965-
`browser_context.add_cookies()`.
963+
**NOTE** Some request headers are **forbidden** and cannot be overridden (for example, `Cookie`, `Host`,
964+
`Content-Length` and others, see
965+
[this MDN page](https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_request_header) for full list). If an
966+
override is provided for a forbidden header, it will be ignored and the original request header will be used.
967+
968+
To set custom cookies, use `browser_context.add_cookies()`.
966969

967970
Parameters
968971
----------
@@ -7129,6 +7132,7 @@ def type(
71297132
Literal["startGroup"],
71307133
Literal["startGroupCollapsed"],
71317134
Literal["table"],
7135+
Literal["time"],
71327136
Literal["timeEnd"],
71337137
Literal["trace"],
71347138
Literal["warning"],
@@ -7137,7 +7141,7 @@ def type(
71377141

71387142
Returns
71397143
-------
7140-
Union["assert", "clear", "count", "debug", "dir", "dirxml", "endGroup", "error", "info", "log", "profile", "profileEnd", "startGroup", "startGroupCollapsed", "table", "timeEnd", "trace", "warning"]
7144+
Union["assert", "clear", "count", "debug", "dir", "dirxml", "endGroup", "error", "info", "log", "profile", "profileEnd", "startGroup", "startGroupCollapsed", "table", "time", "timeEnd", "trace", "warning"]
71417145
"""
71427146
return mapping.from_maybe_impl(self._impl_obj.type)
71437147

@@ -14459,7 +14463,6 @@ def launch(
1445914463
timeout: typing.Optional[float] = None,
1446014464
env: typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] = None,
1446114465
headless: typing.Optional[bool] = None,
14462-
devtools: typing.Optional[bool] = None,
1446314466
proxy: typing.Optional[ProxySettings] = None,
1446414467
downloads_path: typing.Optional[typing.Union[pathlib.Path, str]] = None,
1446514468
slow_mo: typing.Optional[float] = None,
@@ -14533,12 +14536,7 @@ def launch(
1453314536
headless : Union[bool, None]
1453414537
Whether to run browser in headless mode. More details for
1453514538
[Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and
14536-
[Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true` unless the
14537-
`devtools` option is `true`.
14538-
devtools : Union[bool, None]
14539-
**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the
14540-
`headless` option will be set `false`.
14541-
Deprecated: Use [debugging tools](../debug.md) instead.
14539+
[Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true`.
1454214540
proxy : Union[{server: str, bypass: Union[str, None], username: Union[str, None], password: Union[str, None]}, None]
1454314541
Network proxy settings.
1454414542
downloads_path : Union[pathlib.Path, str, None]
@@ -14577,7 +14575,6 @@ def launch(
1457714575
timeout=timeout,
1457814576
env=mapping.to_impl(env),
1457914577
headless=headless,
14580-
devtools=devtools,
1458114578
proxy=proxy,
1458214579
downloadsPath=downloads_path,
1458314580
slowMo=slow_mo,
@@ -14604,7 +14601,6 @@ def launch_persistent_context(
1460414601
timeout: typing.Optional[float] = None,
1460514602
env: typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] = None,
1460614603
headless: typing.Optional[bool] = None,
14607-
devtools: typing.Optional[bool] = None,
1460814604
proxy: typing.Optional[ProxySettings] = None,
1460914605
downloads_path: typing.Optional[typing.Union[pathlib.Path, str]] = None,
1461014606
slow_mo: typing.Optional[float] = None,
@@ -14712,12 +14708,7 @@ def launch_persistent_context(
1471214708
headless : Union[bool, None]
1471314709
Whether to run browser in headless mode. More details for
1471414710
[Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and
14715-
[Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true` unless the
14716-
`devtools` option is `true`.
14717-
devtools : Union[bool, None]
14718-
**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the
14719-
`headless` option will be set `false`.
14720-
Deprecated: Use [debugging tools](../debug.md) instead.
14711+
[Firefox](https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/). Defaults to `true`.
1472114712
proxy : Union[{server: str, bypass: Union[str, None], username: Union[str, None], password: Union[str, None]}, None]
1472214713
Network proxy settings.
1472314714
downloads_path : Union[pathlib.Path, str, None]
@@ -14880,7 +14871,6 @@ def launch_persistent_context(
1488014871
timeout=timeout,
1488114872
env=mapping.to_impl(env),
1488214873
headless=headless,
14883-
devtools=devtools,
1488414874
proxy=proxy,
1488514875
downloadsPath=downloads_path,
1488614876
slowMo=slow_mo,
@@ -14931,6 +14921,7 @@ def connect_over_cdp(
1493114921
timeout: typing.Optional[float] = None,
1493214922
slow_mo: typing.Optional[float] = None,
1493314923
headers: typing.Optional[typing.Dict[str, str]] = None,
14924+
is_local: typing.Optional[bool] = None,
1493414925
) -> "Browser":
1493514926
"""BrowserType.connect_over_cdp
1493614927

@@ -14965,6 +14956,9 @@ def connect_over_cdp(
1496514956
on. Defaults to 0.
1496614957
headers : Union[Dict[str, str], None]
1496714958
Additional HTTP headers to be sent with connect request. Optional.
14959+
is_local : Union[bool, None]
14960+
Tells Playwright that it runs on the same host as the CDP server. It will enable certain optimizations that rely
14961+
upon the file system being the same between Playwright and the Browser.
1496814962

1496914963
Returns
1497014964
-------
@@ -14978,6 +14972,7 @@ def connect_over_cdp(
1497814972
timeout=timeout,
1497914973
slowMo=slow_mo,
1498014974
headers=mapping.to_impl(headers),
14975+
isLocal=is_local,
1498114976
)
1498214977
)
1498314978
)
@@ -15423,8 +15418,7 @@ def description(self) -> typing.Optional[str]:
1542315418
"""Locator.description
1542415419

1542515420
Returns locator description previously set with `locator.describe()`. Returns `null` if no custom
15426-
description has been set. Prefer `Locator.toString()` for a human-readable representation, as it uses the
15427-
description when available.
15421+
description has been set.
1542815422

1542915423
**Usage**
1543015424

@@ -19289,7 +19283,7 @@ def to_contain_text(
1928919283
from playwright.sync_api import expect
1929019284

1929119285
# ✓ Contains the right items in the right order
19292-
expect(page.locator(\"ul > li\")).to_contain_text([\"Text 1\", \"Text 3\", \"Text 4\"])
19286+
expect(page.locator(\"ul > li\")).to_contain_text([\"Text 1\", \"Text 3\"])
1929319287

1929419288
# ✖ Wrong order
1929519289
expect(page.locator(\"ul > li\")).to_contain_text([\"Text 3\", \"Text 2\"])

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import zipfile
2222
from typing import Dict
2323

24-
driver_version = "1.57.0-beta-1764944708000"
24+
driver_version = "1.58.0"
2525

2626
base_wheel_bundles = [
2727
{

tests/async/test_expect_misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ async def test_to_be_in_viewport_should_have_good_stack(
5858
page: Page, server: Server
5959
) -> None:
6060
with pytest.raises(AssertionError) as exc_info:
61-
await expect(page.locator("body")).not_to_be_in_viewport(timeout=100)
61+
await expect(page.locator("body")).not_to_be_in_viewport(timeout=1000)
6262
assert 'unexpected value "viewport ratio' in str(exc_info.value)
6363

6464

tests/async/test_worker.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ async def test_workers_should_report_network_activity_on_worker_creation(
189189

190190

191191
async def test_workers_should_format_number_using_context_locale(
192-
browser: Browser, server: Server
192+
browser: Browser, server: Server, browser_name: str
193193
) -> None:
194194
context = await browser.new_context(locale="ru-RU")
195195
page = await context.new_page()
@@ -199,7 +199,9 @@ async def test_workers_should_format_number_using_context_locale(
199199
"() => new Worker(URL.createObjectURL(new Blob(['console.log(1)'], {type: 'application/javascript'})))"
200200
)
201201
worker = await worker_info.value
202-
assert await worker.evaluate("() => (10000.20).toLocaleString()") == "10\u00a0000,2"
202+
# https://github.com/microsoft/playwright/issues/38919
203+
expected = "10,000.2" if browser_name == "firefox" else "10\u00a0000,2"
204+
assert await worker.evaluate("() => (10000.20).toLocaleString()") == expected
203205
await context.close()
204206

205207

tests/sync/test_expect_misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def test_to_be_in_viewport_should_respect_ratio_option(
5656

5757
def test_to_be_in_viewport_should_have_good_stack(page: Page, server: Server) -> None:
5858
with pytest.raises(AssertionError) as exc_info:
59-
expect(page.locator("body")).not_to_be_in_viewport(timeout=100)
59+
expect(page.locator("body")).not_to_be_in_viewport(timeout=1000)
6060
assert 'unexpected value "viewport ratio' in str(exc_info.value)
6161

6262

0 commit comments

Comments
 (0)