如何在Behave-Python中生成报告? [英] How to generate reports in Behave-Python?

查看:687
本文介绍了如何在Behave-Python中生成报告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于Java,有外部报告生成工具,例如扩展报告,testNG. Junit为单个功能文件生成xml格式输出.要获得详细的报告,我在行为"框架中看不到任何选择,广泛的方法或解决方案.

For Java there are external report generation tools like extent-report,testNG. The Junit produces the xml format output for individual feature file. To get a detailed report, I don't see an option or wide approach or solution within the Behave framework.

如何在Behave中生成报告,是否需要添加任何其他工具或框架以在Behave中生成报告?

How to produce the reports in Behave, do any other tools or framework needs to be added for the report generation in Behave?

推荐答案

您可以为您生成魅力"报告进行测试.

You can generate Allure report for your Behave tests.

首先,您需要安装Allure Behave格式化程序:

First you need to install Allure Behave formatter:

$ pip install allure-behave

然后在运行测试时指定格式化程序:

Then specify the formatter when run your tests:

$ behave -f allure_behave.formatter:AllureFormatter -o %allure_result_folder% ./features

这将生成到%allure_result_folder%的JSON报告.然后,要查看HTML报告,您可以使用Allure命令行(也可以使用Jenkins/TeamCity/Bamboo的插件)

This will generate JSON report to %allure_result_folder%. Then, to view HTML report you can use Allure Command line (plugins for Jenkins/TeamCity/Bamboo also available)

$ allure serve %allure_result_folder%

有关魅力"报告的更多详细信息,请参见文档.

For more details about Allure report you can see the docs.

这篇关于如何在Behave-Python中生成报告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆