Remove tests that were not executed from Allure report

本秂侑毒 提交于 2021-02-17 05:11:40

问题


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/logout; selecting main tabs; check that data is displayed).

But in generated allure report there are all test that are in the project (all methods with @Test annotation). And tests that have not been executed have statuses passed, failed; this information misleading to conclusion that we have tested more than we actually did.

How can I fix this? I need correct information about test execution (without misleading information that there are some more tests have been executed)


The same is inside testng report; report states that all tests were executed, and some are even passed (but they actually have not even started).


P.S.: If it is not fixable, how do you deal with this (getting results for a subset of tests of your project)?


回答1:


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:




回答2:


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.



来源:https://stackoverflow.com/questions/48822720/remove-tests-that-were-not-executed-from-allure-report

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!