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.
Asked
Active
Viewed 3,006 times
2
-
Try this answer: https://stackoverflow.com/questions/48822720/remove-tests-that-were-not-executed-from-allure-report/48976667#48976667 – Naveen Thiyagarajan Nov 14 '19 at 17:49
1 Answers
3
I really like using rimraf for this job. Never disappointed me... yet!
- Install package and save as project dependency:
npm install --save-dev rimraf@latest
- In your
package.jsonfile, 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 onallure-resultsfolder contents)- inspect report: run
npm run-script report-open(will open the Allure created inside theallure-reportfolder)
!Note: You also have to have allure-commandline installed globally in order to run the above commands. (npm install -g allure-commandline@latest)
iamdanchiv
- 4,052
- 4
- 37
- 42