Reputation: 402
I am a newbie to allure and Pytest. I have created test cases in Ppytest framework. For reporting, I am using allure. when I execute the allure serve command report shown as NoN%. Is there any plugin missing?
I did not understand where I went wrong. Can anybody assist me to resolve this issue?
When I run,
pytest --alluredir=Reports
The JSON files are created instead of XML. Then I executed allure generate allure-reports inside the Report folder. When I run allure serve allure-reports, report shown as Non% even though 5 test cases passed.
Upvotes: 1
Views: 6747
Reputation: 1
Xml files are generated in older library pytest-adapter-allure If you have installed allure-pytest you will get json files. Getting Nan% in reports could be because of path provided does not contain the json files required for displaying the report
steps for generating and viewing reports in allure-pytest
Upvotes: 0
Reputation: 1
I fixed this issue by installing the missing JDK 8 on my machine and provided the JAVA_HOME path in the JDK section of the Global Tool Configuration in Jenkins.
Dashboard-->Manage Jenkins-->Global Tool Configuration-->JDK
Upvotes: 0
Reputation: 481
In order to create test reports with allure, you need to run pytest with alluredir argument as you said.
pytest --alluredir=results
After that from the same folder where you ran pytest run:
allure serve results
this command will create a report folder inside your /tmp dir and will serve reports at a random port from localhost.
If you want to find out more about allure commandline run:
allure --help
or Read the docs
Upvotes: 0