Skip to content

Commit a0ee8a2

Browse files
committed
deploy: 39374d0
1 parent fbbb8db commit a0ee8a2

File tree

2 files changed

+38
-218
lines changed

2 files changed

+38
-218
lines changed

async_api/index.html

Lines changed: 23 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -1874,18 +1874,12 @@ <h2 id="returns">Returns</h2>
18741874
`predicate` function and waits for `predicate(event)` to return a truthy value. Will throw an error if browser context
18751875
is closed before the `event` is fired.
18761876

1877-
```python async
1877+
```py
18781878
async with context.expect_event(&#34;page&#34;) as event_info:
18791879
await context.click(&#34;button&#34;)
18801880
page = await event_info.value
18811881
```
18821882

1883-
```python sync
1884-
with context.expect_event(&#34;page&#34;) as event_info:
1885-
context.click(&#34;button&#34;)
1886-
page = event_info.value
1887-
```
1888-
18891883
Parameters
18901884
----------
18911885
event : str
@@ -2248,15 +2242,9 @@ <h2 id="returns">Returns</h2>
22482242
<p>Performs action and waits for given <code>event</code> to fire. If predicate is provided, it passes event's value into the
22492243
<code>predicate</code> function and waits for <code>predicate(event)</code> to return a truthy value. Will throw an error if browser context
22502244
is closed before the <code>event</code> is fired.</p>
2251-
<p>```python async
2252-
async with context.expect_event("page") as event_info:
2253-
await context.click("button")
2254-
page = await event_info.value</p>
2255-
<pre><code>
2256-
```python sync
2257-
with context.expect_event(&quot;page&quot;) as event_info:
2258-
context.click(&quot;button&quot;)
2259-
page = event_info.value
2245+
<pre><code class="language-py">async with context.expect_event(&quot;page&quot;) as event_info:
2246+
await context.click(&quot;button&quot;)
2247+
page = await event_info.value
22602248
</code></pre>
22612249
<h2 id="parameters">Parameters</h2>
22622250
<dl>
@@ -2286,18 +2274,12 @@ <h2 id="returns">Returns</h2>
22862274
`predicate` function and waits for `predicate(event)` to return a truthy value. Will throw an error if browser context
22872275
is closed before the `event` is fired.
22882276

2289-
```python async
2277+
```py
22902278
async with context.expect_event(&#34;page&#34;) as event_info:
22912279
await context.click(&#34;button&#34;)
22922280
page = await event_info.value
22932281
```
22942282

2295-
```python sync
2296-
with context.expect_event(&#34;page&#34;) as event_info:
2297-
context.click(&#34;button&#34;)
2298-
page = event_info.value
2299-
```
2300-
23012283
Parameters
23022284
----------
23032285
event : str
@@ -10926,18 +10908,12 @@ <h3>Class variables</h3>
1092610908
cause the page to navigate. e.g. The click target has an `onclick` handler that triggers navigation from a `setTimeout`.
1092710909
Consider this example:
1092810910

10929-
```python async
10911+
```py
1093010912
async with frame.expect_navigation():
1093110913
await frame.click(&#34;a.delayed-navigation&#34;) # Clicking the link will indirectly cause a navigation
1093210914
# Context manager waited for the navigation to happen.
1093310915
```
1093410916

10935-
```python sync
10936-
with frame.expect_navigation():
10937-
frame.click(&#34;a.delayed-navigation&#34;) # Clicking the link will indirectly cause a navigation
10938-
# Context manager waited for the navigation to happen.
10939-
```
10940-
1094110917
&gt; NOTE: Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL is
1094210918
considered a navigation.
1094310919

@@ -12066,14 +12042,8 @@ <h2 id="returns">Returns</h2>
1206612042
<p>This resolves when the page navigates to a new URL or reloads. It is useful for when you run code which will indirectly
1206712043
cause the page to navigate. e.g. The click target has an <code>onclick</code> handler that triggers navigation from a <code>setTimeout</code>.
1206812044
Consider this example:</p>
12069-
<p>```python async
12070-
async with frame.expect_navigation():
12071-
await frame.click("a.delayed-navigation") # Clicking the link will indirectly cause a navigation</p>
12072-
<h1 id="context-manager-waited-for-the-navigation-to-happen">Context manager waited for the navigation to happen.</h1>
12073-
<pre><code>
12074-
```python sync
12075-
with frame.expect_navigation():
12076-
frame.click(&quot;a.delayed-navigation&quot;) # Clicking the link will indirectly cause a navigation
12045+
<pre><code class="language-py">async with frame.expect_navigation():
12046+
await frame.click(&quot;a.delayed-navigation&quot;) # Clicking the link will indirectly cause a navigation
1207712047
# Context manager waited for the navigation to happen.
1207812048
</code></pre>
1207912049
<blockquote>
@@ -12120,18 +12090,12 @@ <h2 id="returns">Returns</h2>
1212012090
cause the page to navigate. e.g. The click target has an `onclick` handler that triggers navigation from a `setTimeout`.
1212112091
Consider this example:
1212212092

12123-
```python async
12093+
```py
1212412094
async with frame.expect_navigation():
1212512095
await frame.click(&#34;a.delayed-navigation&#34;) # Clicking the link will indirectly cause a navigation
1212612096
# Context manager waited for the navigation to happen.
1212712097
```
1212812098

12129-
```python sync
12130-
with frame.expect_navigation():
12131-
frame.click(&#34;a.delayed-navigation&#34;) # Clicking the link will indirectly cause a navigation
12132-
# Context manager waited for the navigation to happen.
12133-
```
12134-
1213512099
&gt; NOTE: Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL is
1213612100
considered a navigation.
1213712101

@@ -18618,18 +18582,12 @@ <h2 id="parameters">Parameters</h2>
1861818582
`predicate` function and waits for `predicate(event)` to return a truthy value. Will throw an error if the page is
1861918583
closed before the `event` is fired.
1862018584

18621-
```python async
18585+
```py
1862218586
async with page.expect_event(event_name) as event_info:
1862318587
await page.click(&#34;button&#34;)
1862418588
value = await event_info.value
1862518589
```
1862618590

18627-
```python sync
18628-
with page.expect_event(event_name) as event_info:
18629-
page.click(&#34;button&#34;)
18630-
value = event_info.value
18631-
```
18632-
1863318591
Parameters
1863418592
----------
1863518593
event : str
@@ -18752,18 +18710,12 @@ <h2 id="parameters">Parameters</h2>
1875218710
cause the page to navigate. e.g. The click target has an `onclick` handler that triggers navigation from a `setTimeout`.
1875318711
Consider this example:
1875418712

18755-
```python async
18713+
```py
1875618714
async with page.expect_navigation():
1875718715
await page.click(&#34;a.delayed-navigation&#34;) # Clicking the link will indirectly cause a navigation
1875818716
# Context manager waited for the navigation to happen.
1875918717
```
1876018718

18761-
```python sync
18762-
with page.expect_navigation():
18763-
page.click(&#34;a.delayed-navigation&#34;) # Clicking the link will indirectly cause a navigation
18764-
# Context manager waited for the navigation to happen.
18765-
```
18766-
1876718719
&gt; NOTE: Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL is
1876818720
considered a navigation.
1876918721

@@ -20473,15 +20425,9 @@ <h2 id="returns">Returns</h2>
2047320425
<p>Performs action and waits for given <code>event</code> to fire. If predicate is provided, it passes event's value into the
2047420426
<code>predicate</code> function and waits for <code>predicate(event)</code> to return a truthy value. Will throw an error if the page is
2047520427
closed before the <code>event</code> is fired.</p>
20476-
<p>```python async
20477-
async with page.expect_event(event_name) as event_info:
20478-
await page.click("button")
20479-
value = await event_info.value</p>
20480-
<pre><code>
20481-
```python sync
20482-
with page.expect_event(event_name) as event_info:
20483-
page.click(&quot;button&quot;)
20484-
value = event_info.value
20428+
<pre><code class="language-py">async with page.expect_event(event_name) as event_info:
20429+
await page.click(&quot;button&quot;)
20430+
value = await event_info.value
2048520431
</code></pre>
2048620432
<h2 id="parameters">Parameters</h2>
2048720433
<dl>
@@ -20511,18 +20457,12 @@ <h2 id="returns">Returns</h2>
2051120457
`predicate` function and waits for `predicate(event)` to return a truthy value. Will throw an error if the page is
2051220458
closed before the `event` is fired.
2051320459

20514-
```python async
20460+
```py
2051520461
async with page.expect_event(event_name) as event_info:
2051620462
await page.click(&#34;button&#34;)
2051720463
value = await event_info.value
2051820464
```
2051920465

20520-
```python sync
20521-
with page.expect_event(event_name) as event_info:
20522-
page.click(&#34;button&#34;)
20523-
value = event_info.value
20524-
```
20525-
2052620466
Parameters
2052720467
----------
2052820468
event : str
@@ -20609,14 +20549,8 @@ <h2 id="returns">Returns</h2>
2060920549
<p>This resolves when the page navigates to a new URL or reloads. It is useful for when you run code which will indirectly
2061020550
cause the page to navigate. e.g. The click target has an <code>onclick</code> handler that triggers navigation from a <code>setTimeout</code>.
2061120551
Consider this example:</p>
20612-
<p>```python async
20613-
async with page.expect_navigation():
20614-
await page.click("a.delayed-navigation") # Clicking the link will indirectly cause a navigation</p>
20615-
<h1 id="context-manager-waited-for-the-navigation-to-happen">Context manager waited for the navigation to happen.</h1>
20616-
<pre><code>
20617-
```python sync
20618-
with page.expect_navigation():
20619-
page.click(&quot;a.delayed-navigation&quot;) # Clicking the link will indirectly cause a navigation
20552+
<pre><code class="language-py">async with page.expect_navigation():
20553+
await page.click(&quot;a.delayed-navigation&quot;) # Clicking the link will indirectly cause a navigation
2062020554
# Context manager waited for the navigation to happen.
2062120555
</code></pre>
2062220556
<blockquote>
@@ -20664,18 +20598,12 @@ <h2 id="returns">Returns</h2>
2066420598
cause the page to navigate. e.g. The click target has an `onclick` handler that triggers navigation from a `setTimeout`.
2066520599
Consider this example:
2066620600

20667-
```python async
20601+
```py
2066820602
async with page.expect_navigation():
2066920603
await page.click(&#34;a.delayed-navigation&#34;) # Clicking the link will indirectly cause a navigation
2067020604
# Context manager waited for the navigation to happen.
2067120605
```
2067220606

20673-
```python sync
20674-
with page.expect_navigation():
20675-
page.click(&#34;a.delayed-navigation&#34;) # Clicking the link will indirectly cause a navigation
20676-
# Context manager waited for the navigation to happen.
20677-
```
20678-
2067920607
&gt; NOTE: Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL is
2068020608
considered a navigation.
2068120609

@@ -26899,18 +26827,12 @@ <h3>Class variables</h3>
2689926827
`predicate` function and waits for `predicate(event)` to return a truthy value. Will throw an error if the socket is
2690026828
closed before the `event` is fired.
2690126829

26902-
```python async
26830+
```py
2690326831
async with ws.expect_event(event_name) as event_info:
2690426832
await ws.click(&#34;button&#34;)
2690526833
value = await event_info.value
2690626834
```
2690726835

26908-
```python sync
26909-
with ws.expect_event(event_name) as event_info:
26910-
ws.click(&#34;button&#34;)
26911-
value = event_info.value
26912-
```
26913-
2691426836
Parameters
2691526837
----------
2691626838
event : str
@@ -26993,15 +26915,9 @@ <h3>Methods</h3>
2699326915
<p>Performs action and waits for given <code>event</code> to fire. If predicate is provided, it passes event's value into the
2699426916
<code>predicate</code> function and waits for <code>predicate(event)</code> to return a truthy value. Will throw an error if the socket is
2699526917
closed before the <code>event</code> is fired.</p>
26996-
<p>```python async
26997-
async with ws.expect_event(event_name) as event_info:
26998-
await ws.click("button")
26999-
value = await event_info.value</p>
27000-
<pre><code>
27001-
```python sync
27002-
with ws.expect_event(event_name) as event_info:
27003-
ws.click(&quot;button&quot;)
27004-
value = event_info.value
26918+
<pre><code class="language-py">async with ws.expect_event(event_name) as event_info:
26919+
await ws.click(&quot;button&quot;)
26920+
value = await event_info.value
2700526921
</code></pre>
2700626922
<h2 id="parameters">Parameters</h2>
2700726923
<dl>
@@ -27031,18 +26947,12 @@ <h2 id="returns">Returns</h2>
2703126947
`predicate` function and waits for `predicate(event)` to return a truthy value. Will throw an error if the socket is
2703226948
closed before the `event` is fired.
2703326949

27034-
```python async
26950+
```py
2703526951
async with ws.expect_event(event_name) as event_info:
2703626952
await ws.click(&#34;button&#34;)
2703726953
value = await event_info.value
2703826954
```
2703926955

27040-
```python sync
27041-
with ws.expect_event(event_name) as event_info:
27042-
ws.click(&#34;button&#34;)
27043-
value = event_info.value
27044-
```
27045-
2704626956
Parameters
2704726957
----------
2704826958
event : str

0 commit comments

Comments
 (0)