mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 06:02:57 +03:00
Update class-page example code (#6379)
This commit is contained in:
parent
07fb81a4ef
commit
af92565bc7
@ -137,11 +137,11 @@ The arguments passed into `console.log` appear as arguments on the event handler
|
||||
An example of handling `console` event:
|
||||
|
||||
```js
|
||||
page.on('console', msg => {
|
||||
page.on('console', async msg => {
|
||||
for (let i = 0; i < msg.args().length; ++i)
|
||||
console.log(`${i}: ${await msg.args()[i].jsonValue()}`);
|
||||
});
|
||||
page.evaluate(() => console.log('hello', 5, {foo: 'bar'}));
|
||||
await page.evaluate(() => console.log('hello', 5, {foo: 'bar'}));
|
||||
```
|
||||
|
||||
```java
|
||||
|
Loading…
Reference in New Issue
Block a user