Senthil Kumar
Senthil Kumar

Reputation: 71

Allure Jenkins behave BDD report generating blank report

enter image description hereenter image description here I have integrated my Acceptance testing Python Behave BDD with Jenkins and wanted to generate HTML report using Allure report. I am not seeing correct results on Allure report, as all are blank/null.

I am getting the below message from jenkins console however the folders are empty and report has no data.

C:\Program Files (x86)\Jenkins\workspace\Scs Testing>cd C:\checkouts\scs\test

C:\checkouts\scs\test>"behave --tags=@defrost_007 -f allure_behave.formatter:AllureFormatter -o C:\checkouts\scs\test\TestResults scs_acceptance_test/ "

1 feature passed, 0 failed, 1 skipped 1 scenario passed, 0 failed, 98 skipped 5 steps passed, 0 failed, 356 skipped, 0 undefined Took 0m9.663s

C:\checkouts\scs\test>exit 0 [Scs Testing] $ "C:\Program Files (x86)\Jenkins\tools\ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation\allure_2\allure-2.5.0\bin\allure.bat" generate -o "C:\Program Files (x86)\Jenkins\workspace\Scs Testing\allure-report"

allure-results does not exists

Report successfully generated to C:\Program Files (x86)\Jenkins\workspace\Scs Testing\allure-report

Allure report was successfully generated.

Creating artifact for the build. Artifact was added to the build. Finished: SUCCESS

Could you please give me some input?

First image - there is a zip file creating for each build however it is not able to extract it

Upvotes: 2

Views: 2227

Answers (2)

Libin Thomas
Libin Thomas

Reputation: 969

I have been facing the same issue for a while. I somehow figured out a solution.
My windows batch execution command is: pytest -s -v Test_practice_file.py --alluredir=allure-results

enter image description here

After updating my allure reports folder n number of times, I updated the Post-build Actions for allure report as: -o ./allure-results

enter image description here

In Allure Commandline, I have selected "From Maven Central">version 2.9.0
Select the check box "Install automatically"
Save all the configurations and run your script

Upvotes: 0

trickster
trickster

Reputation: 99

I am myself a newbie in allure. My OS is Ubuntu. So my answer is based on what I have seen and observed on my OS.
But since this question is still open I will put in my two bits:

  1. You report is empty because the report format is incorrect. What happens behind the scene is when you ask behave to use allure as a reporter tool, it creates a JSON file for the test output. In your case you can see the output on console. JSON should be generated on path:

    C:\checkouts\scs\test\TestResults scs_acceptance_test\

    Then when you give command allure generate, allure will read the JSON file generated in previous step and create a new folder called reports on path:

    C:\checkouts\scs\test\TestResults scs_acceptance_test\reports

    in which it generates and places the HTML code and serves the folder (reports) on a server that is starts.

  2. Your command:

    ~allure.bat generate -o "C:\Program Files (x86)\Jenkins\workspace\Scs Testing\allure-report"

    is incorrect. The format is allure [path-to-directory-where-you-have-your-json-file] -o [path-to-directory-where-you-want-to-generate-your-reports-directory]

Upvotes: 0

Related Questions