Skip to content

Commit 8abf881

Browse files
committed
deploy: f8326f9
1 parent 52988e3 commit 8abf881

File tree

2 files changed

+410
-2
lines changed

2 files changed

+410
-2
lines changed

async_api.html

Lines changed: 199 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,54 @@ <h1 class="title">Module <code>playwright.async_api</code></h1>
534534
&#34;&#34;&#34;
535535
return mapping.from_maybe_impl(self._impl_obj.url)
536536

537+
async def waitForEvent(
538+
self,
539+
event: str,
540+
predicate: typing.Union[typing.Callable[[typing.Any], bool]] = None,
541+
timeout: int = None,
542+
) -&gt; typing.Any:
543+
&#34;&#34;&#34;WebSocket.waitForEvent
544+
545+
Waits for event to fire and passes its value into the predicate function. Resolves when the predicate returns truthy value. Will throw an error if the webSocket is closed before the event
546+
is fired.
547+
548+
Parameters
549+
----------
550+
event : str
551+
Event name, same one would pass into `webSocket.on(event)`.
552+
553+
Returns
554+
-------
555+
Any
556+
Promise which resolves to the event data value.
557+
&#34;&#34;&#34;
558+
return mapping.from_maybe_impl(
559+
await self._impl_obj.waitForEvent(
560+
event=event, predicate=self._wrap_handler(predicate), timeout=timeout
561+
)
562+
)
563+
564+
def expect_event(
565+
self,
566+
event: str,
567+
predicate: typing.Union[typing.Callable[[typing.Any], bool]] = None,
568+
timeout: int = None,
569+
) -&gt; AsyncEventContextManager:
570+
return AsyncEventContextManager(
571+
self._impl_obj.waitForEvent(event, predicate, timeout)
572+
)
573+
574+
def isClosed(self) -&gt; bool:
575+
&#34;&#34;&#34;WebSocket.isClosed
576+
577+
Indicates that the web socket has been closed.
578+
579+
Returns
580+
-------
581+
bool
582+
&#34;&#34;&#34;
583+
return mapping.from_maybe_impl(self._impl_obj.isClosed())
584+
537585

538586
mapping.register(WebSocketImpl, WebSocket)
539587

@@ -24543,7 +24591,55 @@ <h2 id="returns">Returns</h2>
2454324591
-------
2454424592
str
2454524593
&#34;&#34;&#34;
24546-
return mapping.from_maybe_impl(self._impl_obj.url)</code></pre>
24594+
return mapping.from_maybe_impl(self._impl_obj.url)
24595+
24596+
async def waitForEvent(
24597+
self,
24598+
event: str,
24599+
predicate: typing.Union[typing.Callable[[typing.Any], bool]] = None,
24600+
timeout: int = None,
24601+
) -&gt; typing.Any:
24602+
&#34;&#34;&#34;WebSocket.waitForEvent
24603+
24604+
Waits for event to fire and passes its value into the predicate function. Resolves when the predicate returns truthy value. Will throw an error if the webSocket is closed before the event
24605+
is fired.
24606+
24607+
Parameters
24608+
----------
24609+
event : str
24610+
Event name, same one would pass into `webSocket.on(event)`.
24611+
24612+
Returns
24613+
-------
24614+
Any
24615+
Promise which resolves to the event data value.
24616+
&#34;&#34;&#34;
24617+
return mapping.from_maybe_impl(
24618+
await self._impl_obj.waitForEvent(
24619+
event=event, predicate=self._wrap_handler(predicate), timeout=timeout
24620+
)
24621+
)
24622+
24623+
def expect_event(
24624+
self,
24625+
event: str,
24626+
predicate: typing.Union[typing.Callable[[typing.Any], bool]] = None,
24627+
timeout: int = None,
24628+
) -&gt; AsyncEventContextManager:
24629+
return AsyncEventContextManager(
24630+
self._impl_obj.waitForEvent(event, predicate, timeout)
24631+
)
24632+
24633+
def isClosed(self) -&gt; bool:
24634+
&#34;&#34;&#34;WebSocket.isClosed
24635+
24636+
Indicates that the web socket has been closed.
24637+
24638+
Returns
24639+
-------
24640+
bool
24641+
&#34;&#34;&#34;
24642+
return mapping.from_maybe_impl(self._impl_obj.isClosed())</code></pre>
2454724643
</details>
2454824644
<h3>Ancestors</h3>
2454924645
<ul class="hlist">
@@ -24579,6 +24675,105 @@ <h2 id="returns">Returns</h2>
2457924675
</details>
2458024676
</dd>
2458124677
</dl>
24678+
<h3>Methods</h3>
24679+
<dl>
24680+
<dt id="playwright.async_api.WebSocket.expect_event"><code class="name flex">
24681+
<span>def <span class="ident">expect_event</span></span>(<span>self, event: str, predicate: Callable[[Any], bool] = None, timeout: int = None) ‑> playwright.async_base.AsyncEventContextManager</span>
24682+
</code></dt>
24683+
<dd>
24684+
<div class="desc"></div>
24685+
<details class="source">
24686+
<summary>
24687+
<span>Expand source code</span>
24688+
</summary>
24689+
<pre><code class="python">def expect_event(
24690+
self,
24691+
event: str,
24692+
predicate: typing.Union[typing.Callable[[typing.Any], bool]] = None,
24693+
timeout: int = None,
24694+
) -&gt; AsyncEventContextManager:
24695+
return AsyncEventContextManager(
24696+
self._impl_obj.waitForEvent(event, predicate, timeout)
24697+
)</code></pre>
24698+
</details>
24699+
</dd>
24700+
<dt id="playwright.async_api.WebSocket.isClosed"><code class="name flex">
24701+
<span>def <span class="ident">isClosed</span></span>(<span>self) ‑> bool</span>
24702+
</code></dt>
24703+
<dd>
24704+
<div class="desc"><p>WebSocket.isClosed</p>
24705+
<p>Indicates that the web socket has been closed.</p>
24706+
<h2 id="returns">Returns</h2>
24707+
<dl>
24708+
<dt><code>bool</code></dt>
24709+
<dd>&nbsp;</dd>
24710+
</dl></div>
24711+
<details class="source">
24712+
<summary>
24713+
<span>Expand source code</span>
24714+
</summary>
24715+
<pre><code class="python">def isClosed(self) -&gt; bool:
24716+
&#34;&#34;&#34;WebSocket.isClosed
24717+
24718+
Indicates that the web socket has been closed.
24719+
24720+
Returns
24721+
-------
24722+
bool
24723+
&#34;&#34;&#34;
24724+
return mapping.from_maybe_impl(self._impl_obj.isClosed())</code></pre>
24725+
</details>
24726+
</dd>
24727+
<dt id="playwright.async_api.WebSocket.waitForEvent"><code class="name flex">
24728+
<span>async def <span class="ident">waitForEvent</span></span>(<span>self, event: str, predicate: Callable[[Any], bool] = None, timeout: int = None) ‑> Any</span>
24729+
</code></dt>
24730+
<dd>
24731+
<div class="desc"><p>WebSocket.waitForEvent</p>
24732+
<p>Waits for event to fire and passes its value into the predicate function. Resolves when the predicate returns truthy value. Will throw an error if the webSocket is closed before the event
24733+
is fired.</p>
24734+
<h2 id="parameters">Parameters</h2>
24735+
<dl>
24736+
<dt><strong><code>event</code></strong> :&ensp;<code>str</code></dt>
24737+
<dd>Event name, same one would pass into <code>webSocket.on(event)</code>.</dd>
24738+
</dl>
24739+
<h2 id="returns">Returns</h2>
24740+
<dl>
24741+
<dt><code>Any</code></dt>
24742+
<dd>Promise which resolves to the event data value.</dd>
24743+
</dl></div>
24744+
<details class="source">
24745+
<summary>
24746+
<span>Expand source code</span>
24747+
</summary>
24748+
<pre><code class="python">async def waitForEvent(
24749+
self,
24750+
event: str,
24751+
predicate: typing.Union[typing.Callable[[typing.Any], bool]] = None,
24752+
timeout: int = None,
24753+
) -&gt; typing.Any:
24754+
&#34;&#34;&#34;WebSocket.waitForEvent
24755+
24756+
Waits for event to fire and passes its value into the predicate function. Resolves when the predicate returns truthy value. Will throw an error if the webSocket is closed before the event
24757+
is fired.
24758+
24759+
Parameters
24760+
----------
24761+
event : str
24762+
Event name, same one would pass into `webSocket.on(event)`.
24763+
24764+
Returns
24765+
-------
24766+
Any
24767+
Promise which resolves to the event data value.
24768+
&#34;&#34;&#34;
24769+
return mapping.from_maybe_impl(
24770+
await self._impl_obj.waitForEvent(
24771+
event=event, predicate=self._wrap_handler(predicate), timeout=timeout
24772+
)
24773+
)</code></pre>
24774+
</details>
24775+
</dd>
24776+
</dl>
2458224777
</dd>
2458324778
<dt id="playwright.async_api.Worker"><code class="flex name class">
2458424779
<span>class <span class="ident">Worker</span></span>
@@ -25208,7 +25403,10 @@ <h4><code><a title="playwright.async_api.Video" href="#playwright.async_api.Vide
2520825403
<li>
2520925404
<h4><code><a title="playwright.async_api.WebSocket" href="#playwright.async_api.WebSocket">WebSocket</a></code></h4>
2521025405
<ul class="">
25406+
<li><code><a title="playwright.async_api.WebSocket.expect_event" href="#playwright.async_api.WebSocket.expect_event">expect_event</a></code></li>
25407+
<li><code><a title="playwright.async_api.WebSocket.isClosed" href="#playwright.async_api.WebSocket.isClosed">isClosed</a></code></li>
2521125408
<li><code><a title="playwright.async_api.WebSocket.url" href="#playwright.async_api.WebSocket.url">url</a></code></li>
25409+
<li><code><a title="playwright.async_api.WebSocket.waitForEvent" href="#playwright.async_api.WebSocket.waitForEvent">waitForEvent</a></code></li>
2521225410
</ul>
2521325411
</li>
2521425412
<li>

0 commit comments

Comments
 (0)