Skip to content

[Feature] Add an api to log message to the console for tracefiles #12327

@ryanrosello-og

Description

@ryanrosello-og

Currently if I wanted to log some information to the trace files I would need to write something like:

let someMessage = 'needs to be inside page.eval'
await page.evaluate((someMessage) =>{ console.log(someMessage)}, someMessage);

It would be nice if we had a native PW api that did this for me e.g. await page.consolelog('whatever')

As an extra requirement, it would be also nice if this function accepted an object too. Something like

let someObj = {blah: true, v: 100}
await page.consolelog(someObj)

Which would result in a nicely formatted json shown in the trace file

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions