[英]How to generate a useful pytest-bdd test report?
I am using pytest-bdd and want to generate a test report where the Given, When, Then steps are clearly shown and in the case of a failure, it shows you the error.我正在使用 pytest-bdd 并希望生成一个测试报告,其中清楚地显示了 Given、When、Then 步骤,并且在失败的情况下,它会向您显示错误。
I have installed pytest-html
and successfully created a report but it doesn't support the Given, When, Then steps.我已经安装了
pytest-html
并成功创建了一个报告,但它不支持 Given、When、Then 步骤。 I have also tried outputting the report as json using the --cucumber-json
option but am unsure what I can do with that.我还尝试使用
--cucumber-json
选项将报告输出为 json 但我不确定我能用它做什么。
Allure reporting is another avenue I have explored but it requires extra decorations on steps which I would like to avoid, but maybe it is the best/only way.引诱报告是我探索的另一种途径,但它需要在我想避免的步骤上进行额外的装饰,但也许这是最好/唯一的方法。
Something similar to the robot framework test report for example would be a great start!例如,类似于机器人框架测试报告的东西将是一个很好的开始!
Use allure-pytest-bdd==2.8.10 plugin and generate allure reports.使用 allure-pytest-bdd==2.8.10 插件并生成魅力报告。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.