@@ -4277,6 +4277,9 @@ async def set_content(
4277
4277
) -> None:
4278
4278
"""Frame.set_content
4279
4279
4280
+ This method internally calls [document.write()](https://developer.mozilla.org/en-US/docs/Web/API/Document/write),
4281
+ inheriting all its specific characteristics and behaviors.
4282
+
4280
4283
Parameters
4281
4284
----------
4282
4285
html : str
@@ -9156,6 +9159,9 @@ async def set_content(
9156
9159
) -> None:
9157
9160
"""Page.set_content
9158
9161
9162
+ This method internally calls [document.write()](https://developer.mozilla.org/en-US/docs/Web/API/Document/write),
9163
+ inheriting all its specific characteristics and behaviors.
9164
+
9159
9165
Parameters
9160
9166
----------
9161
9167
html : str
@@ -9854,7 +9860,7 @@ async def route_from_har(
9854
9860
"""Page.route_from_har
9855
9861
9856
9862
If specified the network requests that are made in the page will be served from the HAR file. Read more about
9857
- [Replaying from HAR](https://playwright.dev/python/docs/network #replaying-from-har).
9863
+ [Replaying from HAR](https://playwright.dev/python/docs/mock #replaying-from-har).
9858
9864
9859
9865
Playwright will not serve requests intercepted by Service Worker from the HAR file. See
9860
9866
[this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when
@@ -13592,7 +13598,7 @@ async def route_from_har(
13592
13598
"""BrowserContext.route_from_har
13593
13599
13594
13600
If specified the network requests that are made in the context will be served from the HAR file. Read more about
13595
- [Replaying from HAR](https://playwright.dev/python/docs/network #replaying-from-har).
13601
+ [Replaying from HAR](https://playwright.dev/python/docs/mock #replaying-from-har).
13596
13602
13597
13603
Playwright will not serve requests intercepted by Service Worker from the HAR file. See
13598
13604
[this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when
@@ -14088,7 +14094,7 @@ async def new_context(
14088
14094
is_mobile : Union[bool, None]
14089
14095
Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device,
14090
14096
so you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more
14091
- about [mobile emulation](../emulation.md#isMobile ).
14097
+ about [mobile emulation](../emulation.md#ismobile ).
14092
14098
has_touch : Union[bool, None]
14093
14099
Specifies if viewport supports touch events. Defaults to false. Learn more about
14094
14100
[mobile emulation](../emulation.md#devices).
@@ -14302,7 +14308,7 @@ async def new_page(
14302
14308
is_mobile : Union[bool, None]
14303
14309
Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device,
14304
14310
so you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more
14305
- about [mobile emulation](../emulation.md#isMobile ).
14311
+ about [mobile emulation](../emulation.md#ismobile ).
14306
14312
has_touch : Union[bool, None]
14307
14313
Specifies if viewport supports touch events. Defaults to false. Learn more about
14308
14314
[mobile emulation](../emulation.md#devices).
@@ -14847,7 +14853,7 @@ async def launch_persistent_context(
14847
14853
is_mobile : Union[bool, None]
14848
14854
Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device,
14849
14855
so you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more
14850
- about [mobile emulation](../emulation.md#isMobile ).
14856
+ about [mobile emulation](../emulation.md#ismobile ).
14851
14857
has_touch : Union[bool, None]
14852
14858
Specifies if viewport supports touch events. Defaults to false. Learn more about
14853
14859
[mobile emulation](../emulation.md#devices).
@@ -15033,7 +15039,8 @@ async def connect(
15033
15039
*,
15034
15040
timeout: typing.Optional[float] = None,
15035
15041
slow_mo: typing.Optional[float] = None,
15036
- headers: typing.Optional[typing.Dict[str, str]] = None
15042
+ headers: typing.Optional[typing.Dict[str, str]] = None,
15043
+ expose_network: typing.Optional[str] = None
15037
15044
) -> "Browser":
15038
15045
"""BrowserType.connect
15039
15046
@@ -15052,6 +15059,20 @@ async def connect(
15052
15059
on. Defaults to 0.
15053
15060
headers : Union[Dict[str, str], None]
15054
15061
Additional HTTP headers to be sent with web socket connect request. Optional.
15062
+ expose_network : Union[str, None]
15063
+ This option exposes network available on the connecting client to the browser being connected to. Consists of a
15064
+ list of rules separated by comma.
15065
+
15066
+ Available rules:
15067
+ 1. Hostname pattern, for example: `example.com`, `*.org:99`, `x.*.y.com`, `*foo.org`.
15068
+ 1. IP literal, for example: `127.0.0.1`, `0.0.0.0:99`, `[::1]`, `[0:0::1]:99`.
15069
+ 1. `<loopback>` that matches local loopback interfaces: `localhost`, `*.localhost`, `127.0.0.1`, `[::1]`.
15070
+
15071
+ Some common examples:
15072
+ 1. `"*"` to expose all network.
15073
+ 1. `"<loopback>"` to expose localhost network.
15074
+ 1. `"*.test.internal-domain,*.staging.internal-domain,<loopback>"` to expose test/staging deployments and
15075
+ localhost.
15055
15076
15056
15077
Returns
15057
15078
-------
@@ -15064,6 +15085,7 @@ async def connect(
15064
15085
timeout=timeout,
15065
15086
slow_mo=slow_mo,
15066
15087
headers=mapping.to_impl(headers),
15088
+ expose_network=expose_network,
15067
15089
)
15068
15090
)
15069
15091
@@ -16833,7 +16855,8 @@ async def blur(self, *, timeout: typing.Optional[float] = None) -> None:
16833
16855
async def all(self) -> typing.List["Locator"]:
16834
16856
"""Locator.all
16835
16857
16836
- When locator points to a list of elements, returns array of locators, pointing to respective elements.
16858
+ When the locator points to a list of elements, this returns an array of locators, pointing to their respective
16859
+ elements.
16837
16860
16838
16861
**NOTE** `locator.all()` does not wait for elements to match the locator, and instead immediately returns
16839
16862
whatever is present in the page. When the list of elements changes dynamically, `locator.all()` will
@@ -17803,6 +17826,9 @@ async def type(
17803
17826
) -> None:
17804
17827
"""Locator.type
17805
17828
17829
+ **NOTE** In most cases, you should use `locator.fill()` instead. You only need to type characters if there
17830
+ is special keyboard handling on the page.
17831
+
17806
17832
Focuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the
17807
17833
text.
17808
17834
@@ -19908,16 +19934,16 @@ async def to_have_text(
19908
19934
from playwright.sync_api import expect
19909
19935
19910
19936
# ✓ Has the right items in the right order
19911
- await expect(page.locator(\"ul > li\")).to_have_text([\"Text 1\", \"Text 2\", \"Text 3\"])
19937
+ expect(page.locator(\"ul > li\")).to_have_text([\"Text 1\", \"Text 2\", \"Text 3\"])
19912
19938
19913
19939
# ✖ Wrong order
19914
- await expect(page.locator(\"ul > li\")).to_have_text([\"Text 3\", \"Text 2\", \"Text 1\"])
19940
+ expect(page.locator(\"ul > li\")).to_have_text([\"Text 3\", \"Text 2\", \"Text 1\"])
19915
19941
19916
19942
# ✖ Last item does not match
19917
- await expect(page.locator(\"ul > li\")).to_have_text([\"Text 1\", \"Text 2\", \"Text\"])
19943
+ expect(page.locator(\"ul > li\")).to_have_text([\"Text 1\", \"Text 2\", \"Text\"])
19918
19944
19919
19945
# ✖ Locator points to the outer list element, not to the list items
19920
- await expect(page.locator(\"ul\")).to_have_text([\"Text 1\", \"Text 2\", \"Text 3\"])
19946
+ expect(page.locator(\"ul\")).to_have_text([\"Text 1\", \"Text 2\", \"Text 3\"])
19921
19947
```
19922
19948
19923
19949
Parameters
0 commit comments