Reputation: 777
I am able to create allure report and open it. But I could not clean the previous results. I tried with the official document which does not give expected results.
Upvotes: 2
Views: 3818
Reputation: 4112
I really like using rimraf for this job. Never disappointed me... yet!
npm install --save-dev rimraf@latest
package.json
file, add the following npm scripts: "scripts": {
"report-open": "allure open allure-report",
"report-generate": "allure generate --clean allure-results",
"pretest": "rimraf allure-results && rimraf allure-report && rimraf test-screenshots && rimraf wdio-logs"
},
Usage:
pre-test: in order to start clean, run npm run-script pretest
(will remove all Allure results/reports, along with other mentioned logs & printscreens)
after-test: run npm run-script report-generate
(will generate the Allure report based on allure-results
folder contents)
npm run-script report-open
(will open the Allure created inside the allure-report
folder)!Note: You also have to have allure-commandline installed globally in order to run the above commands. (npm install -g allure-commandline@latest
)
Upvotes: 5