Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate Allure HTML report using playwright/test runner?

How to generate Allure HTML report using playwright/test runner?

We are planning to use Nodejs, Typescript and Playwright recommended test runner (playwright/test) but wasn't able to find any documentation regarding how to generate Allure HTML report using the mentioned technology stack. There are other report formats like json and junit but we would like to generate Allure HTML report and like to attach screenshots and videos for failed test cases. Any references would be really helpful.

like image 375
VinodGulia Avatar asked Sep 20 '25 05:09

VinodGulia


1 Answers

Install

npm i -D @playwright/test allure-playwright

Run

npx playwright test --reporter=line,allure-playwright
allure generate ./allure-result --clean
allure open ./allure-report

or

// playwright.config.ts
import { PlaywrightTestConfig } from '@playwright/test';

const config: PlaywrightTestConfig = {
  reporter: 'allure-playwright',
};
export default config;

You can specify target folder using ALLURE_RESULTS_DIR environment variable. e.g.

ALLURE_RESULTS_DIR=my-allure-results npx playwright test --reporter=line,allure-playwright

For more information, see here: https://github.com/allure-framework/allure-js/blob/master/packages/allure-playwright/README.md

like image 159
Yevhen Laichenkov Avatar answered Sep 22 '25 00:09

Yevhen Laichenkov