While running test I use different test-suites (xml files with list of tests to execute). E.g. I need to run smoke-tests so I choose corresponding xml with simplest tests (login
After cleaning test results new report is generated without tests that are not included in test suite (xml).
Because I am using maven the command to clean results is:
mvn clean
Or:
I am using WDIO with cucumber framework along with allure reporting. I got the same issue.
I used an external npm package called "clean-dir" to achieve this.
I installed cleandir as dev dependencies and added the following to the "package.json" file:
"test": "npm run cleandir && wdio",
"cleandir": "cleandir ./reports/allure/allure-results",
So whenever i trigger the test, it first cleans the existing results of allure.
I am not sure whether this is the best way but it simply solves my requirement.