allure-pytest test report for everyone to share

allure-pytest generate test reports, draw the following experience through practice, taken a lot of the great God of blog be accompanied

1, the installation allure-pytest

pip install allure-pytest

2, execute the command and generate json txt file:

pytest tests --alluredir report/allure_raw


pytest test_setupAndteardown --alluredir report/allure_raw

If the process error AttributeError: module 'allure' has no attribute 'severity_level' is executed:
PIP-Adapter Allure Uninstall pytest-
PIP-pytest the install Allure

 

3, after we execute the command to get a json and txt file format is not what we expect to open the html graphical interface

We need to lower the official website to download the latest allure zip file, extract the placement project lib folder

4, execute the command

allure generate <allure test results directory> -o <storage report catalog> --clean

allure test results directory is a place to store the result after running the above command pytest, here is the report directory under allure_raw folder;

Storage directory report is finally generated test report storage directory, I intend to generate a report on the case report of allure_report folder;

--clean parameter is used to clear the existing report, to avoid errors when coverage.

 

python reference documentation:

https://www.jianshu.com/p/54a88c8a8bc8?utm_campaign=hugo&utm_medium=reader_share&utm_content=note&utm_source=qq


--java reference address:
https://blog.csdn.net/qq_39421886/article/details/99562698

Guess you like

Origin www.cnblogs.com/yoyoblogs/p/11447571.html