7979from playwright._impl._network import WebSocket as WebSocketImpl
8080from playwright._impl._page import Page as PageImpl
8181from playwright._impl._page import Worker as WorkerImpl
82- from playwright._impl._page_error import PageError as PageErrorImpl
8382from playwright._impl._playwright import Playwright as PlaywrightImpl
8483from playwright._impl._selectors import Selectors as SelectorsImpl
8584from playwright._impl._tracing import Tracing as TracingImpl
8685from playwright._impl._video import Video as VideoImpl
86+ from playwright._impl._web_error import WebError as WebErrorImpl
8787
8888
8989class Request(AsyncBase):
@@ -1302,6 +1302,9 @@ async def insert_text(self, text: str) -> None:
13021302 async def type(self, text: str, *, delay: typing.Optional[float] = None) -> None:
13031303 """Keyboard.type
13041304
1305+ **NOTE** In most cases, you should use `locator.fill()` instead. You only need to press keys one by one if
1306+ there is special keyboard handling on the page - in this case use `locator.press_sequentially()`.
1307+
13051308 Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.
13061309
13071310 To press a special key, like `Control` or `ArrowDown`, use `keyboard.press()`.
@@ -1337,6 +1340,8 @@ async def type(self, text: str, *, delay: typing.Optional[float] = None) -> None
13371340 async def press(self, key: str, *, delay: typing.Optional[float] = None) -> None:
13381341 """Keyboard.press
13391342
1343+ **NOTE** In most cases, you should use `locator.press()` instead.
1344+
13401345 `key` can specify the intended
13411346 [keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character
13421347 to generate the text for. A superset of the `key` values can be found
@@ -2335,7 +2340,7 @@ async def fill(
23352340 [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be filled
23362341 instead.
23372342
2338- To send fine-grained keyboard events, use `keyboard.type ()`.
2343+ To send fine-grained keyboard events, use `locator.press_sequentially ()`.
23392344
23402345 Parameters
23412346 ----------
@@ -4633,7 +4638,7 @@ async def fill(
46334638 [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be filled
46344639 instead.
46354640
4636- To send fine-grained keyboard events, use `frame.type ()`.
4641+ To send fine-grained keyboard events, use `locator.press_sequentially ()`.
46374642
46384643 Parameters
46394644 ----------
@@ -10278,7 +10283,7 @@ async def fill(
1027810283 [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be filled
1027910284 instead.
1028010285
10281- To send fine-grained keyboard events, use `page.type ()`.
10286+ To send fine-grained keyboard events, use `locator.press_sequentially ()`.
1028210287
1028310288 Parameters
1028410289 ----------
@@ -12484,10 +12489,10 @@ async def set_checked(
1248412489mapping.register(PageImpl, Page)
1248512490
1248612491
12487- class PageError (AsyncBase):
12492+ class WebError (AsyncBase):
1248812493 @property
1248912494 def page(self) -> typing.Optional["Page"]:
12490- """PageError .page
12495+ """WebError .page
1249112496
1249212497 The page that produced this unhandled exception, if any.
1249312498
@@ -12499,7 +12504,7 @@ def page(self) -> typing.Optional["Page"]:
1249912504
1250012505 @property
1250112506 def error(self) -> "Error":
12502- """PageError .error
12507+ """WebError .error
1250312508
1250412509 Unhandled error that was thrown.
1250512510
@@ -12510,7 +12515,7 @@ def error(self) -> "Error":
1251012515 return mapping.from_impl(self._impl_obj.error)
1251112516
1251212517
12513- mapping.register(PageErrorImpl, PageError )
12518+ mapping.register(WebErrorImpl, WebError )
1251412519
1251512520
1251612521class BrowserContext(AsyncContextManager):
@@ -12639,12 +12644,12 @@ def on(
1263912644 @typing.overload
1264012645 def on(
1264112646 self,
12642- event: Literal["pageerror "],
12643- f: typing.Callable[["PageError "], "typing.Union[typing.Awaitable[None], None]"],
12647+ event: Literal["weberror "],
12648+ f: typing.Callable[["WebError "], "typing.Union[typing.Awaitable[None], None]"],
1264412649 ) -> None:
1264512650 """
12646- Emitted when unhandled exceptions occur on any pages created through this context. To only listen for `pageError`
12647- events from a particular page, use `page.on('page_error')`."""
12651+ Emitted when exception is unhandled in any of the pages in this context. To listen for errors from a particular
12652+ page, use `page.on('page_error')` instead ."""
1264812653
1264912654 @typing.overload
1265012655 def on(
@@ -12838,12 +12843,12 @@ def once(
1283812843 @typing.overload
1283912844 def once(
1284012845 self,
12841- event: Literal["pageerror "],
12842- f: typing.Callable[["PageError "], "typing.Union[typing.Awaitable[None], None]"],
12846+ event: Literal["weberror "],
12847+ f: typing.Callable[["WebError "], "typing.Union[typing.Awaitable[None], None]"],
1284312848 ) -> None:
1284412849 """
12845- Emitted when unhandled exceptions occur on any pages created through this context. To only listen for `pageError`
12846- events from a particular page, use `page.on('page_error')`."""
12850+ Emitted when exception is unhandled in any of the pages in this context. To listen for errors from a particular
12851+ page, use `page.on('page_error')` instead ."""
1284712852
1284812853 @typing.overload
1284912854 def once(
0 commit comments