You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/api/python.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,13 +124,13 @@ Performs action and waits for given `event` to fire. If predicate is provided, i
124
124
event's value into the `predicate` function and waits for `predicate(event)` to return a truthy value.
125
125
Will throw an error if the page is closed before the `event`is fired.
126
126
127
-
```python-async
127
+
```pythonasync
128
128
asyncwith page.expect_event(event_name) as event_info:
129
129
await page.click("button")
130
130
value=await event_info.value
131
131
```
132
132
133
-
```python-sync
133
+
```pythonsync
134
134
with page.expect_event(event_name) as event_info:
135
135
page.click("button")
136
136
value= event_info.value
@@ -148,13 +148,13 @@ Performs action and waits for given `event` to fire. If predicate is provided, i
148
148
event's value into the `predicate` function and waits for `predicate(event)` to return a truthy value.
149
149
Will throw an error if browser context is closed before the `event`is fired.
150
150
151
-
```python-async
151
+
```pythonasync
152
152
asyncwith context.expect_event(event_name) as event_info:
153
153
await context.click("button")
154
154
value=await event_info.value
155
155
```
156
156
157
-
```python-sync
157
+
```pythonsync
158
158
with context.expect_event(event_name) as event_info:
159
159
context.click("button")
160
160
value= event_info.value
@@ -172,13 +172,13 @@ Performs action and waits for given `event` to fire. If predicate is provided, i
172
172
event's value into the `predicate` function and waits for `predicate(event)` to return a truthy value.
173
173
Will throw an error if the socket is closed before the `event`is fired.
174
174
175
-
```python-async
175
+
```pythonasync
176
176
asyncwith ws.expect_event(event_name) as event_info:
177
177
await ws.click("button")
178
178
value=await event_info.value
179
179
```
180
180
181
-
```python-sync
181
+
```pythonsync
182
182
with ws.expect_event(event_name) as event_info:
183
183
ws.click("button")
184
184
value= event_info.value
@@ -195,13 +195,13 @@ value = event_info.value
195
195
Performs action and waits for the required load state. It resolves when the page reaches a required load state, `load` by default. The navigation must have been committed when this method is called. If current document has
196
196
already reached the required state, resolves immediately.
@@ -219,13 +219,13 @@ Shortcut for main frame's [`method: Frame.expectLoadState`].
219
219
Performs action and waits for the required load state. It resolves when the page reaches a required load state, `load` by default. The navigation must have been committed when this method is called. If current document has
220
220
already reached the required state, resolves immediately.
0 commit comments