Skip to content

Commit 2c99d01

Browse files
feat(roll): roll to ToT Playwright (03-12-25) (#1936)
Co-authored-by: microsoft-playwright-automation[bot] <203992400+microsoft-playwright-automation[bot]@users.noreply.github.com>
1 parent 610dcec commit 2c99d01

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

java/docs/api/class-worker.mdx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,36 @@ Worker.waitForClose(callback, options);
126126

127127
---
128128

129+
### waitForConsoleMessage {#worker-wait-for-console-message}
130+
131+
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.57</font><x-search>worker.waitForConsoleMessage</x-search>
132+
133+
Performs action and waits for a console message.
134+
135+
**Usage**
136+
137+
```java
138+
Worker.waitForConsoleMessage(callback);
139+
Worker.waitForConsoleMessage(callback, options);
140+
```
141+
142+
**Arguments**
143+
- `options` `Worker.WaitForConsoleMessageOptions` *(optional)*
144+
- `setPredicate` [Predicate]&lt;[ConsoleMessage]&gt; *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="worker-wait-for-console-message-option-predicate"/><a href="#worker-wait-for-console-message-option-predicate" class="list-anchor">#</a>
145+
146+
Receives the [ConsoleMessage] object and resolves to true when the waiting should resolve.
147+
- `setTimeout` [double] *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="worker-wait-for-console-message-option-timeout"/><a href="#worker-wait-for-console-message-option-timeout" class="list-anchor">#</a>
148+
149+
Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [BrowserContext.setDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout).
150+
- `callback` [Runnable]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="worker-wait-for-console-message-option-callback"/><a href="#worker-wait-for-console-message-option-callback" class="list-anchor">#</a>
151+
152+
Callback that performs the action triggering the event.
153+
154+
**Returns**
155+
- [ConsoleMessage]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="worker-wait-for-console-message-return"/><a href="#worker-wait-for-console-message-return" class="list-anchor">#</a>
156+
157+
---
158+
129159
## Events
130160

131161
### onClose(handler) {#worker-event-close}

java/docs/locators.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ Locators can be filtered by text with the [Locator.filter()](/api/class-locator.
459459
page.getByRole(AriaRole.LISTITEM)
460460
.filter(new Locator.FilterOptions().setHasText("Product 2"))
461461
.getByRole(AriaRole.BUTTON,
462-
new Page.GetByRoleOptions().setName("Add to cart"))
462+
new Locator.GetByRoleOptions().setName("Add to cart"))
463463
.click();
464464
```
465465

0 commit comments

Comments
 (0)