Vidya
Vidya

Reputation: 402

Allure Report unknown unknown - NoN%

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.

Report Image : - enter image description here

Pytest report image : - enter image description here

Upvotes: 1

Views: 6747

Answers (3)

shrima
shrima

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

  1. create empty folder for allure report in your framework.(ex. reports)
  2. run test with alluredir specified pytest --alluredir test/testname 3.check the reports directory in the framework has populated with .json file files after test execution
  3. In Command Prompt run allure serve

Upvotes: 0

rangoju srikanth
rangoju srikanth

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

Dragos Vasile
Dragos Vasile

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

Related Questions