@@ -4277,6 +4277,9 @@ async def set_content(
42774277 ) -> None:
42784278 """Frame.set_content
42794279
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+
42804283 Parameters
42814284 ----------
42824285 html : str
@@ -9156,6 +9159,9 @@ async def set_content(
91569159 ) -> None:
91579160 """Page.set_content
91589161
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+
91599165 Parameters
91609166 ----------
91619167 html : str
@@ -9854,7 +9860,7 @@ async def route_from_har(
98549860 """Page.route_from_har
98559861
98569862 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).
98589864
98599865 Playwright will not serve requests intercepted by Service Worker from the HAR file. See
98609866 [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when
@@ -13592,7 +13598,7 @@ async def route_from_har(
1359213598 """BrowserContext.route_from_har
1359313599
1359413600 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).
1359613602
1359713603 Playwright will not serve requests intercepted by Service Worker from the HAR file. See
1359813604 [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when
@@ -14088,7 +14094,7 @@ async def new_context(
1408814094 is_mobile : Union[bool, None]
1408914095 Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device,
1409014096 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 ).
1409214098 has_touch : Union[bool, None]
1409314099 Specifies if viewport supports touch events. Defaults to false. Learn more about
1409414100 [mobile emulation](../emulation.md#devices).
@@ -14302,7 +14308,7 @@ async def new_page(
1430214308 is_mobile : Union[bool, None]
1430314309 Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device,
1430414310 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 ).
1430614312 has_touch : Union[bool, None]
1430714313 Specifies if viewport supports touch events. Defaults to false. Learn more about
1430814314 [mobile emulation](../emulation.md#devices).
@@ -14847,7 +14853,7 @@ async def launch_persistent_context(
1484714853 is_mobile : Union[bool, None]
1484814854 Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device,
1484914855 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 ).
1485114857 has_touch : Union[bool, None]
1485214858 Specifies if viewport supports touch events. Defaults to false. Learn more about
1485314859 [mobile emulation](../emulation.md#devices).
@@ -15033,7 +15039,8 @@ async def connect(
1503315039 *,
1503415040 timeout: typing.Optional[float] = None,
1503515041 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
1503715044 ) -> "Browser":
1503815045 """BrowserType.connect
1503915046
@@ -15052,6 +15059,20 @@ async def connect(
1505215059 on. Defaults to 0.
1505315060 headers : Union[Dict[str, str], None]
1505415061 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.
1505515076
1505615077 Returns
1505715078 -------
@@ -15064,6 +15085,7 @@ async def connect(
1506415085 timeout=timeout,
1506515086 slow_mo=slow_mo,
1506615087 headers=mapping.to_impl(headers),
15088+ expose_network=expose_network,
1506715089 )
1506815090 )
1506915091
@@ -16833,7 +16855,8 @@ async def blur(self, *, timeout: typing.Optional[float] = None) -> None:
1683316855 async def all(self) -> typing.List["Locator"]:
1683416856 """Locator.all
1683516857
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.
1683716860
1683816861 **NOTE** `locator.all()` does not wait for elements to match the locator, and instead immediately returns
1683916862 whatever is present in the page. When the list of elements changes dynamically, `locator.all()` will
@@ -17803,6 +17826,9 @@ async def type(
1780317826 ) -> None:
1780417827 """Locator.type
1780517828
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+
1780617832 Focuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the
1780717833 text.
1780817834
@@ -19908,16 +19934,16 @@ async def to_have_text(
1990819934 from playwright.sync_api import expect
1990919935
1991019936 # ✓ 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\"])
1991219938
1991319939 # ✖ 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\"])
1991519941
1991619942 # ✖ 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\"])
1991819944
1991919945 # ✖ 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\"])
1992119947 ```
1992219948
1992319949 Parameters
0 commit comments