Skip to content

Commit 9e36f5c

Browse files
kblokmxschmitt
andauthored
docs(consoleMessage): add missing console message comments (#6320)
Co-authored-by: Max Schmitt <[email protected]>
1 parent 90de864 commit 9e36f5c

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

docs/src/api/class-consolemessage.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
## method: ConsoleMessage.args
66
- returns: <[Array]<[JSHandle]>>
77

8+
List of arguments passed to a `console` function call. See also [`event: Page.console`].
9+
810
## method: ConsoleMessage.location
911
* langs: js, python
1012
- returns: <[Object]>
@@ -21,6 +23,8 @@ URL of the resource followed by 0-based line and column numbers in the resource
2123
## method: ConsoleMessage.text
2224
- returns: <[string]>
2325

26+
The text of the console message.
27+
2428
## method: ConsoleMessage.type
2529
- returns: <[string]>
2630

docs/src/api/class-page.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ await page.evaluate(() => console.log('hello', 5, {foo: 'bar'}));
145145
```
146146

147147
```java
148-
page.onConsole(msg -> {
148+
page.onConsoleMessage(msg -> {
149149
for (int i = 0; i < msg.args().size(); ++i)
150150
System.out.println(i + ": " + msg.args().get(i).jsonValue());
151151
});

docs/src/verification.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ await msg.args[1].jsonValue() // 42
3535

3636
```java
3737
// Listen for all System.out.printlns
38-
page.onConsole(msg -> System.out.println(msg.text()));
38+
page.onConsoleMessage(msg -> System.out.println(msg.text()));
3939

4040
// Listen for all console events and handle errors
41-
page.onConsole(msg -> {
41+
page.onConsoleMessage(msg -> {
4242
if ("error".equals(msg.type()))
4343
System.out.println("Error text: " + msg.text());
4444
});

types/types.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9036,6 +9036,10 @@ export interface BrowserServer {
90369036
* [page.on('console')](https://playwright.dev/docs/api/class-page#pageonconsole) event.
90379037
*/
90389038
export interface ConsoleMessage {
9039+
/**
9040+
* List of arguments passed to a `console` function call. See also
9041+
* [page.on('console')](https://playwright.dev/docs/api/class-page#pageonconsole).
9042+
*/
90399043
args(): Array<JSHandle>;
90409044

90419045
location(): {
@@ -9055,6 +9059,9 @@ export interface ConsoleMessage {
90559059
columnNumber: number;
90569060
};
90579061

9062+
/**
9063+
* The text of the console message.
9064+
*/
90589065
text(): string;
90599066

90609067
/**

0 commit comments

Comments
 (0)