File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff 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] < ; [ ConsoleMessage] > ; * (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 }
Original file line number Diff line number Diff line change @@ -459,7 +459,7 @@ Locators can be filtered by text with the [Locator.filter()](/api/class-locator.
459459page. 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
You can’t perform that action at this time.
0 commit comments