0

How might I be able to attach screenshot to allure report using MS Playwright

test('basic test', async ({ page }) => {

  await page.goto('https://playwright.dev/');
  const screen1 = await page.screenshot({path: './screenshots/screenshot.png',fullPage: true});
  allure.screenshot('screenShot', screen1, 'image/png');
  const title = await page.locator('.navbar__inner .navbar__title');
  await expect(title).toHaveText('Playwright');
  //await title.screenshot({path: './screenshots/title.png'});
  await page.close();
});


I already have allure installed using npm i -D allure-playwright

Yet I cannot get ad hoc screenshots attached to the rendered allure report during the test step.

user5199
  • 359
  • 2
  • 15
  • 1
    You can attach additional attachments see here: https://playwright.dev/docs/api/class-testinfo#test-info-attachments – Max Schmitt Oct 12 '21 at 10:13

0 Answers0