0

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.

1 Answers1

2

I really like using rimraf for this job. Never disappointed me... yet!

  1. Install package and save as project dependency:

npm install --save-dev rimraf@latest

  1. In your 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)

  • inspect report: run 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)

iamdanchiv
  • 3,828
  • 4
  • 32
  • 40