How to write out a line to the default HTML reporter in Playwright?

Viewed 29

I am using the default HTML reporter in Playwright. I would like to write out some custom text to the default reporter. What is the command to do this? I am not seeing it off the page object.

1 Answers

You might find something of use here.
https://playwright.dev/docs/api/class-reporter

Annotations are key/value pairs accessible via test.info().annotations.

The HTML reporter will show Annotations that are added to tests. So in a test you could add this line:

test.info().annotations.push({ type: 'issue', description: 'descriptive text' });
Related