4

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.

I have installed pytest-html and successfully created a report but it doesn't support the Given, When, Then steps. I have also tried outputting the report as json using the --cucumber-json option but am unsure what I can do with that.

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!

Aimee Jones
  • 41
  • 1
  • 2

1 Answers1

4

Use allure-pytest-bdd==2.8.10 plugin and generate allure reports.

  • 2
    As far as I can tell with this approach is the lack of mature reporting plugin for purest-bdd, the listener implementation for allure has no link implementation. (Unless I am missing something) https://github.com/allure-framework/allure-python/pull/556/commits This seems to be an attempt to fix the issue, however it has not been touched for a year, IMO this is the weakest link in the chain and does not really give confidence that this approach will be maintained or developed. – PythonTester Jan 05 '22 at 12:14