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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With