In this article, we will discuss in detail how we can create HTML reports with Allure in 5 simple steps.

Step 1: Install the allure-playwright node package. This project implements Allure integration with Playwright Test framework. To install, use the command:

1
npm i -D allure-playwright

allure-playwright installed
 
Step 2: Install the allure-commandline node package. Allure Commandline is a tool to generate Allure report from test results. Allure requires Java 8 or higher. To install, use the command:

1
npm i -D allure-commandline

allure-commandline installed
 
Step 3: Now to run the tests with allure-playwright reporter we will use the command:

1
npx playwright test --reporter=line,allure-playwright

command line after executing playwright tests with allure reporter

Once the above command is executed successfully, a folder will be created named ‘allure-results’ with multiple JSON files.

json files in allure results
 
Step 4: Using the allure commandline we will now generate the allure report. To do that we will use the command:

1
npx allure generate ./allure-results --clean

command line after executing allure report generate

Once the above command is executed successfully, a folder will be created named ‘allure-report’ with various files.

allure-report with html files generated
 
Step 5: Finally, we will open the HTML report on a browser using the command:

1
npx allure open ./allure-report

terminal after opening the allure html report

And this is how the Allure HTML report looks like:

playwright allure html report 1

playwright allure html report 2

playwright allure html report 3

playwright allure html report 4

Do check out 🙂

Github: https://github.com/alapanme/Playwright-Automation