简体   繁体   English

Allure Jenkins 行为 BDD 报告生成空白报告

[英]Allure Jenkins behave BDD report generating blank report

在此处输入图片说明 在此处输入图片说明 I have integrated my Acceptance testing Python Behave BDD with Jenkins and wanted to generate HTML report using Allure report.我已经将我的验收测试 Python Behave BDD 与 Jenkins 集成在一起,并希望使用 Allure 报告生成 HTML 报告。 I am not seeing correct results on Allure report, as all are blank/null.我在 Allure 报告中没有看到正确的结果,因为所有结果都是空白/空。

I am getting the below message from jenkins console however the folders are empty and report has no data.我从 jenkins 控制台收到以下消息,但是文件夹是空的,报告没有数据。

C:\\Program Files (x86)\\Jenkins\\workspace\\Scs Testing>cd C:\\checkouts\\scs\\test 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/ " 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 1 个特征通过,0 个失败,1 个跳过 1 个场景通过,0 个失败,98 个跳过 5 个步骤通过,0 个失败,356 个跳过,0 个未定义 花费 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" 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" 生成 -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报告成功生成到 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第一个图像 - 为每个构建创建了一个 zip 文件,但无法提取它

I am myself a newbie in allure.我自己是诱惑的新手。 My OS is Ubuntu.我的操作系统是 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.幕后发生的事情是,当您要求行为使用诱惑作为报告工具时,它会为测试输出创建一个 JSON 文件。 In your case you can see the output on console.在您的情况下,您可以在控制台上看到输出。 JSON should be generated on path:应该在路径上生成 JSON:

    C:\\checkouts\\scs\\test\\TestResults scs_acceptance_test\\ 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:然后当你给出命令 allure generate 时,allure 会读取上一步生成的 JSON 文件,并在路径上创建一个名为 reports 的新文件夹:

    C:\\checkouts\\scs\\test\\TestResults scs_acceptance_test\\reports 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.它在其中生成并放置 HTML 代码,并在启动的服务器上提供文件夹(报告)。

  2. Your command:你的命令:

    ~allure.bat generate -o "C:\\Program Files (x86)\\Jenkins\\workspace\\Scs Testing\\allure-report" ~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]格式是allure [path-to-directory-where-you-have-your-json-file] -o [path-to-directory-where-you-want-to-generate-your-reports-directory]

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我的windows批处理执行命令是: pytest -s -v Test_practice_file.py --alluredir=allure-results

在此处输入图片说明

After updating my allure reports folder n number of times, I updated the Post-build Actions for allure report as: -o ./allure-results在更新我的诱惑报告文件夹 n 次后,我将诱惑报告的构建后操作更新为: -o ./allure-results

在此处输入图片说明

In Allure Commandline, I have selected "From Maven Central">version 2.9.0在 Allure Commandline 中,我选择了“From Maven Central”> version 2.9.0
Select the check box "Install automatically"选中“自动安装”复选框
Save all the configurations and run your script保存所有配置并运行您的脚本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM