0

Friends, does anyone have the code that allows me to include the screenshots in the line I want and make this print be attached to the standard playwright report?

I'm using playwright with javascriptenter image description here npx plawright show-report

Staulik
  • 19
  • 1
  • 5

1 Answers1

1

You can use page.screenshot() to capture the screenshot and use attach() to attach the captured screenshto the report like this:

  const screenshot = await page.screenshot();
  await testInfo.attach('screenshot', { body: screenshot, contentType: 'image/png' });
itronic1990
  • 1,231
  • 2
  • 4
  • 18